Changeset 15254 for trunk/psLib/src/math/psPolynomialMetadata.c
- Timestamp:
- Oct 9, 2007, 9:27:04 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psPolynomialMetadata.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psPolynomialMetadata.c
r11669 r15254 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2007- 02-06 21:55:28$14 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-10-09 19:25:45 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 62 62 // an undefined component implies the component was masked 63 63 // this is symmetrical with the 1DtoMD function 64 poly->mask[nx] = 1;65 64 poly->coeff[nx] = 0; 66 65 poly->coeffErr[nx] = 0; 66 poly->coeffMask[nx] = PS_POLY_MASK_SET; 67 67 } else { 68 poly-> mask[nx] = 0;68 poly->coeffMask[nx] = PS_POLY_MASK_NONE; 69 69 nElements ++; 70 70 } … … 123 123 // place polynomial entries on folder 124 124 for (int nx = 0; nx < poly->nX + 1; nx++) { 125 if ( poly->mask[nx] == 0) {125 if (!(poly->coeffMask[nx] & PS_POLY_MASK_SET)) { 126 126 sprintf(namespace, "VAL_X%02d", nx); 127 127 sprintf(namespace_err, "ERR_X%02d", nx); … … 174 174 // an undefined component implies the component was masked 175 175 // this is symmetrical with the 2DtoMD function 176 poly->mask[nx][ny] = 1;177 176 poly->coeff[nx][ny] = 0; 178 177 poly->coeffErr[nx][ny] = 0; 178 poly->coeffMask[nx][ny] = PS_POLY_MASK_SET; 179 179 } else { 180 poly-> mask[nx][ny] = 0;180 poly->coeffMask[nx][ny] = PS_POLY_MASK_NONE; 181 181 nElements ++; 182 182 } … … 203 203 PS_ASSERT_PTR_NON_NULL(md, false); 204 204 PS_ASSERT_PTR_NON_NULL(poly, false); 205 //XXX: Current implementation only supports ordinary polynomials. 205 206 // XXX Current implementation only supports ordinary polynomials. 206 207 if (poly->type != PS_POLYNOMIAL_ORD) 207 208 return false; 208 209 // XXX I'm puzzled by this test. a polynomial of 0 order with a value of 0 is a210 // perfectly valid polynomial and can be written out. a polynomial with all elements211 // masked still carries information.212 //Make sure polynomial isn't 0, completely empty213 //if (poly->nX == 0 && poly->nY == 0 && poly->coeff[0][0] == 0)214 //return false;215 209 216 210 int Nbyte; … … 245 239 for (int nx = 0; nx < poly->nX + 1; nx++) { 246 240 for (int ny = 0; ny < poly->nY + 1; ny++) { 247 if ( poly->mask[nx][ny] == 0) {241 if (!(poly->coeffMask[nx][ny] & PS_POLY_MASK_SET)) { 248 242 sprintf(namespace, "VAL_X%02d_Y%02d", nx, ny); 249 243 sprintf(namespace_err, "ERR_X%02d_Y%02d", nx, ny); … … 304 298 // an undefined component implies the component was masked 305 299 // this is symmetrical with the 3DtoMD function 306 poly->mask[nx][ny][nz] = 1;307 300 poly->coeff[nx][ny][nz] = 0; 308 301 poly->coeffErr[nx][ny][nz] = 0; 302 poly->coeffMask[nx][ny][nz] = PS_POLY_MASK_SET; 309 303 } else { 310 poly-> mask[nx][ny][nz] = 0;304 poly->coeffMask[nx][ny][nz] = PS_POLY_MASK_NONE; 311 305 nElements ++; 312 306 } … … 370 364 for (int ny = 0; ny < poly->nY + 1; ny++) { 371 365 for (int nz = 0; nz < poly->nZ + 1; nz++) { 372 if ( poly->mask[nx][ny][nz] == 0) {366 if (!(poly->coeffMask[nx][ny][nz] & PS_POLY_MASK_SET)) { 373 367 sprintf(namespace, "VAL_X%02d_Y%02d_Z%02d", nx, ny, nz); 374 368 sprintf(namespace_err, "ERR_X%02d_Y%02d_Z%02d", nx, ny, nz); … … 437 431 // an undefined component implies the component was masked 438 432 // this is symmetrical with the 4DtoMD function 439 poly->mask[nx][ny][nz][nt] = 1;440 433 poly->coeff[nx][ny][nz][nt] = 0; 441 434 poly->coeffErr[nx][ny][nz][nt] = 0; 435 poly->coeffMask[nx][ny][nz][nt] = PS_POLY_MASK_SET; 442 436 } else { 443 poly-> mask[nx][ny][nz][nt] = 0;437 poly->coeffMask[nx][ny][nz][nt] = PS_POLY_MASK_NONE; 444 438 nElements ++; 445 439 } … … 506 500 for (int nz = 0; nz < poly->nZ + 1; nz++) { 507 501 for (int nt = 0; nt < poly->nT + 1; nt++) { 508 if ( poly->mask[nx][ny][nz][nt] == 0) {502 if (!(poly->coeffMask[nx][ny][nz][nt] & PS_POLY_MASK_SET)) { 509 503 sprintf(namespace, "VAL_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt); 510 504 sprintf(namespace_err, "ERR_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt);
Note:
See TracChangeset
for help on using the changeset viewer.
