IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 9, 2007, 9:27:04 AM (19 years ago)
Author:
eugene
Message:

changed mask to coeffMask, define PS_POLY_MASK_FIT,SET; distinguish between coeffs masked for fitting (FIT) and masked for evaluation (SET)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psPolynomialMetadata.c

    r11669 r15254  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    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 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6262            // an undefined component implies the component was masked
    6363            // this is symmetrical with the 1DtoMD function
    64             poly->mask[nx] = 1;
    6564            poly->coeff[nx] = 0;
    6665            poly->coeffErr[nx] = 0;
     66            poly->coeffMask[nx] = PS_POLY_MASK_SET;
    6767        } else {
    68             poly->mask[nx] = 0;
     68            poly->coeffMask[nx] = PS_POLY_MASK_NONE;
    6969            nElements ++;
    7070        }
     
    123123    // place polynomial entries on folder
    124124    for (int nx = 0; nx < poly->nX + 1; nx++) {
    125         if (poly->mask[nx] == 0) {
     125        if (!(poly->coeffMask[nx] & PS_POLY_MASK_SET)) {
    126126            sprintf(namespace, "VAL_X%02d", nx);
    127127            sprintf(namespace_err, "ERR_X%02d", nx);
     
    174174                // an undefined component implies the component was masked
    175175                // this is symmetrical with the 2DtoMD function
    176                 poly->mask[nx][ny] = 1;
    177176                poly->coeff[nx][ny] = 0;
    178177                poly->coeffErr[nx][ny] = 0;
     178                poly->coeffMask[nx][ny] = PS_POLY_MASK_SET;
    179179            } else {
    180                 poly->mask[nx][ny] = 0;
     180                poly->coeffMask[nx][ny] = PS_POLY_MASK_NONE;
    181181                nElements ++;
    182182            }
     
    203203    PS_ASSERT_PTR_NON_NULL(md, false);
    204204    PS_ASSERT_PTR_NON_NULL(poly, false);
    205     //XXX:  Current implementation only supports ordinary polynomials.
     205
     206    // XXX Current implementation only supports ordinary polynomials.
    206207    if (poly->type != PS_POLYNOMIAL_ORD)
    207208        return false;
    208 
    209     // XXX I'm puzzled by this test.  a polynomial of 0 order with a value of 0 is a
    210     // perfectly valid polynomial and can be written out.  a polynomial with all elements
    211     // masked still carries information.
    212     //Make sure polynomial isn't 0, completely empty
    213     //if (poly->nX == 0 && poly->nY == 0 && poly->coeff[0][0] == 0)
    214     //return false;
    215209
    216210    int Nbyte;
     
    245239    for (int nx = 0; nx < poly->nX + 1; nx++) {
    246240        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)) {
    248242                sprintf(namespace, "VAL_X%02d_Y%02d", nx, ny);
    249243                sprintf(namespace_err, "ERR_X%02d_Y%02d", nx, ny);
     
    304298                    // an undefined component implies the component was masked
    305299                    // this is symmetrical with the 3DtoMD function
    306                     poly->mask[nx][ny][nz] = 1;
    307300                    poly->coeff[nx][ny][nz] = 0;
    308301                    poly->coeffErr[nx][ny][nz] = 0;
     302                    poly->coeffMask[nx][ny][nz] = PS_POLY_MASK_SET;
    309303                } else {
    310                     poly->mask[nx][ny][nz] = 0;
     304                    poly->coeffMask[nx][ny][nz] = PS_POLY_MASK_NONE;
    311305                    nElements ++;
    312306                }
     
    370364        for (int ny = 0; ny < poly->nY + 1; ny++) {
    371365            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)) {
    373367                    sprintf(namespace, "VAL_X%02d_Y%02d_Z%02d", nx, ny, nz);
    374368                    sprintf(namespace_err, "ERR_X%02d_Y%02d_Z%02d", nx, ny, nz);
     
    437431                        // an undefined component implies the component was masked
    438432                        // this is symmetrical with the 4DtoMD function
    439                         poly->mask[nx][ny][nz][nt] = 1;
    440433                        poly->coeff[nx][ny][nz][nt] = 0;
    441434                        poly->coeffErr[nx][ny][nz][nt] = 0;
     435                        poly->coeffMask[nx][ny][nz][nt] = PS_POLY_MASK_SET;
    442436                    } else {
    443                         poly->mask[nx][ny][nz][nt] = 0;
     437                        poly->coeffMask[nx][ny][nz][nt] = PS_POLY_MASK_NONE;
    444438                        nElements ++;
    445439                    }
     
    506500            for (int nz = 0; nz < poly->nZ + 1; nz++) {
    507501                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)) {
    509503                        sprintf(namespace, "VAL_X%02d_Y%02d_Z%02d_T%02d", nx, ny, nz, nt);
    510504                        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.