IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5294


Ignore:
Timestamp:
Oct 12, 2005, 11:02:20 AM (21 years ago)
Author:
gusciora
Message:

Polynomial members are now nX, nY, nZ, nT.

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r5090 r5294  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.87 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-09-22 02:47:16 $
     12*  @version $Revision: 1.88 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-10-12 21:02:20 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9090
    9191    A = transform->x->coeff[0][0];
    92     if (transform->x->COOL_2D_nX >= 1) {
     92    if (transform->x->nX >= 1) {
    9393        B = transform->x->coeff[1][0];
    9494    }
    95     if (transform->x->COOL_2D_nY >= 1) {
     95    if (transform->x->nY >= 1) {
    9696        C = transform->x->coeff[0][1];
    9797    }
    9898    D = transform->y->coeff[0][0];
    99     if (transform->y->COOL_2D_nX >= 1) {
     99    if (transform->y->nX >= 1) {
    100100        E = transform->y->coeff[1][0];
    101101    }
    102     if (transform->y->COOL_2D_nY >= 1) {
     102    if (transform->y->nY >= 1) {
    103103        F = transform->y->coeff[0][1];
    104104    }
     
    154154    PS_ASSERT_PTR_NON_NULL(transform->y, 0);
    155155
    156     for (psS32 i=0;i<(1 + transform->x->COOL_2D_nX);i++) {
    157         for (psS32 j=0;j<(1 + transform->x->COOL_2D_nY);j++) {
     156    for (psS32 i=0;i<(1 + transform->x->nX);i++) {
     157        for (psS32 j=0;j<(1 + transform->x->nY);j++) {
    158158            if (transform->x->coeff[i][j] != 0.0) {
    159159                if (!(((i == 0) && (j == 0)) ||
     
    166166    }
    167167
    168     for (psS32 i=0;i<(1 + transform->y->COOL_2D_nX);i++) {
    169         for (psS32 j=0;j<(1 + transform->y->COOL_2D_nY);j++) {
     168    for (psS32 i=0;i<(1 + transform->y->nX);i++) {
     169        for (psS32 j=0;j<(1 + transform->y->nY);j++) {
    170170            if (transform->y->coeff[i][j] != 0.0) {
    171171                if (!(((i == 0) && (j == 0)) ||
     
    501501                                       psPolynomial2D *trans2)
    502502{
    503     //TRACE: printf("multiplyDPoly2D(%d %d: %d %d)\n", trans1->COOL_2D_nX, trans1->COOL_2D_nY, trans2->COOL_2D_nX, trans2->COOL_2D_nY);
     503    //TRACE: printf("multiplyDPoly2D(%d %d: %d %d)\n", trans1->nX, trans1->nY, trans2->nX, trans2->nY);
    504504    // XXX: OLD:  psS32 orderX = (trans1->nX + trans2->nX) - 1;
    505505    // XXX: Verify this (the poly order change)
    506     psS32 orderX = trans1->COOL_2D_nX + trans2->COOL_2D_nX + 1;
    507     psS32 orderY = trans1->COOL_2D_nY + trans2->COOL_2D_nY + 1;
     506    psS32 orderX = trans1->nX + trans2->nX + 1;
     507    psS32 orderY = trans1->nY + trans2->nY + 1;
    508508
    509509    // XXX: Verify this (the poly order change)
    510510    psPolynomial2D *out = psPolynomial2DAlloc(orderX-1, orderY-1, PS_POLYNOMIAL_ORD);
    511511    //TRACE: printf("Creating poly (%d, %d)\n", orderX, orderY);
    512     for (psS32 i = 0 ; i < (1 + out->COOL_2D_nX); i++) {
    513         for (psS32 j = 0 ; j < (1 + out->COOL_2D_nY); j++) {
     512    for (psS32 i = 0 ; i < (1 + out->nX); i++) {
     513        for (psS32 j = 0 ; j < (1 + out->nY); j++) {
    514514            out->coeff[i][j] = 0.0;
    515515            out->mask[i][j] = 0;
     
    517517    }
    518518
    519     for (psS32 t1x = 0 ; t1x < (1 + trans1->COOL_2D_nX) ; t1x++) {
    520         for (psS32 t1y = 0 ; t1y < (1 + trans1->COOL_2D_nY) ; t1y++) {
     519    for (psS32 t1x = 0 ; t1x < (1 + trans1->nX) ; t1x++) {
     520        for (psS32 t1y = 0 ; t1y < (1 + trans1->nY) ; t1y++) {
    521521            if (0.0 != trans1->coeff[t1x][t1y]) {
    522                 for (psS32 t2x = 0 ; t2x < (1 + trans2->COOL_2D_nX) ; t2x++) {
    523                     for (psS32 t2y = 0 ; t2y < (1 + trans2->COOL_2D_nY) ; t2y++) {
     522                for (psS32 t2x = 0 ; t2x < (1 + trans2->nX) ; t2x++) {
     523                    for (psS32 t2y = 0 ; t2y < (1 + trans2->nY) ; t2y++) {
    524524                        /* Possible debug-only macro which checks these coords?
    525525                        if ((t1x+t2x) >= orderX)
     
    552552    PS_ASSERT_PTR_NON_NULL(trans1, NULL);
    553553    PS_ASSERT_PTR_NON_NULL(trans2, NULL);
    554     //TRACE: printf("psPlaneTransformCombine(%d, %d, %d, %d: %d, %d, %d, %d)\n", trans1->x->COOL_2D_nX, trans1->x->COOL_2D_nY, trans1->y->COOL_2D_nX, trans1->y->COOL_2D_nY, trans2->x->COOL_2D_nX, trans2->x->COOL_2D_nY, trans2->y->COOL_2D_nX, trans2->y->COOL_2D_nY);
     554    //TRACE: printf("psPlaneTransformCombine(%d, %d, %d, %d: %d, %d, %d, %d)\n", trans1->x->nX, trans1->x->nY, trans1->y->nX, trans1->y->nY, trans2->x->COOL_2D_nX, trans2->x->COOL_2D_nY, trans2->y->COOL_2D_nX, trans2->y->COOL_2D_nY);
    555555    //
    556556    // Determine the size of the new psPlaneTransform.
     
    558558    // PS_MAX(  Number of x terms in T2->x * number of x terms in T1->x,
    559559    //          Number of y terms in T2->x * number of x terms in T1->y,
    560     psS32 orderXnX = PS_MAX(((1 + trans2->x->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nX)),
    561                             ((1 + trans2->x->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nX)));
    562     psS32 orderXnY = PS_MAX(((1 + trans2->x->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nY)),
    563                             ((1 + trans2->x->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nY)));
    564 
    565     psS32 orderYnX = PS_MAX(((1 + trans2->y->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nX)),
    566                             ((1 + trans2->y->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nX)));
    567     psS32 orderYnY = PS_MAX(((1 + trans2->y->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nY)),
    568                             ((1 + trans2->y->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nY)));
     560    psS32 orderXnX = PS_MAX(((1 + trans2->x->nX) * (1 + trans1->x->nX)),
     561                            ((1 + trans2->x->nY) * (1 + trans1->y->nX)));
     562    psS32 orderXnY = PS_MAX(((1 + trans2->x->nX) * (1 + trans1->x->nY)),
     563                            ((1 + trans2->x->nY) * (1 + trans1->y->nY)));
     564
     565    psS32 orderYnX = PS_MAX(((1 + trans2->y->nX) * (1 + trans1->x->nX)),
     566                            ((1 + trans2->y->nY) * (1 + trans1->y->nX)));
     567    psS32 orderYnY = PS_MAX(((1 + trans2->y->nX) * (1 + trans1->x->nY)),
     568                            ((1 + trans2->y->nY) * (1 + trans1->y->nY)));
    569569    psS32 orderX = PS_MAX(orderXnX, orderYnX);
    570570    psS32 orderY = PS_MAX(orderXnY, orderYnY);
     
    578578        myPT = psPlaneTransformAlloc(orderX, orderY);
    579579    } else {
    580         if (((1 + out->x->COOL_2D_nX) == orderX) && ((1 + out->x->COOL_2D_nY) == orderY) &&
    581                 ((1 + out->y->COOL_2D_nX) == orderX) && ((1 + out->y->COOL_2D_nY) == orderY)) {
     580        if (((1 + out->x->nX) == orderX) && ((1 + out->x->nY) == orderY) &&
     581                ((1 + out->y->nX) == orderX) && ((1 + out->y->nY) == orderY)) {
    582582            myPT = out;
    583583        } else {
     
    609609    //
    610610
    611     for (psS32 t2x = 0 ; t2x < (1 + trans2->x->COOL_2D_nX) ; t2x++) {
    612         for (psS32 t2y = 0 ; t2y < (1 + trans2->x->COOL_2D_nX) ; t2y++) {
     611    for (psS32 t2x = 0 ; t2x < (1 + trans2->x->nX) ; t2x++) {
     612        for (psS32 t2y = 0 ; t2y < (1 + trans2->x->nX) ; t2y++) {
    613613            // XXX: Verify this (poly order/nterm change)
    614614            psPolynomial2D *currPoly = psPolynomial2DAlloc(1-1, 1-1, PS_POLYNOMIAL_ORD);
     
    634634
    635635                // Set the appropriate coeffs in myPT->x
    636                 for (psS32 i = 0 ; i < (1 + currPoly->COOL_2D_nX) ; i++) {
    637                     for (psS32 j = 0 ; j < (1 + currPoly->COOL_2D_nY) ; j++) {
     636                for (psS32 i = 0 ; i < (1 + currPoly->nX) ; i++) {
     637                    for (psS32 j = 0 ; j < (1 + currPoly->nY) ; j++) {
    638638                        myPT->x->coeff[i][j]+= currPoly->coeff[i][j] * trans2->x->coeff[t2x][t2y];
    639639                    }
     
    645645
    646646
    647     for (psS32 t2x = 0 ; t2x < (1 + trans2->y->COOL_2D_nX) ; t2x++) {
    648         for (psS32 t2y = 0 ; t2y < (1 + trans2->y->COOL_2D_nY) ; t2y++) {
     647    for (psS32 t2x = 0 ; t2x < (1 + trans2->y->nX) ; t2x++) {
     648        for (psS32 t2y = 0 ; t2y < (1 + trans2->y->nY) ; t2y++) {
    649649            // XXX: Verify this (poly order/nterm change)
    650650            psPolynomial2D *currPoly = psPolynomial2DAlloc(1-1, 1-1, PS_POLYNOMIAL_ORD);
     
    670670
    671671                // Set the appropriate coeffs in myPT->x
    672                 for (psS32 i = 0 ; i < (1 + currPoly->COOL_2D_nX) ; i++) {
    673                     for (psS32 j = 0 ; j < (1 + currPoly->COOL_2D_nY) ; j++) {
     672                for (psS32 i = 0 ; i < (1 + currPoly->nX) ; i++) {
     673                    for (psS32 j = 0 ; j < (1 + currPoly->nY) ; j++) {
    674674                        myPT->y->coeff[i][j]+= currPoly->coeff[i][j] * trans2->y->coeff[t2x][t2y];
    675675                    }
     
    702702
    703703    psS32 numCoords = PS_MIN(source->n, dest->n);
    704     psS32 order = PS_MAX(trans->x->COOL_2D_nX, trans->x->COOL_2D_nY);
    705     order = PS_MAX(order, trans->y->COOL_2D_nX);
    706     order = PS_MAX(order, trans->y->COOL_2D_nY);
     704    psS32 order = PS_MAX(trans->x->nX, trans->x->nY);
     705    order = PS_MAX(order, trans->y->nX);
     706    order = PS_MAX(order, trans->y->nY);
    707707    // XXX: Verify, or recode, after the poly norder/nterm change.
    708708    order++;
     
    822822
    823823    // Ensure that the input transformation is symmetrical.
    824     if ((in->x->COOL_2D_nX != in->x->COOL_2D_nY) ||
    825             (in->y->COOL_2D_nX != in->y->COOL_2D_nY) ||
    826             (in->x->COOL_2D_nX != in->y->COOL_2D_nX)) {
     824    if ((in->x->nX != in->x->nY) ||
     825            (in->y->nX != in->y->nY) ||
     826            (in->x->nX != in->y->nX)) {
    827827        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Input transformation must have same nX==nY.");
    828828    }
    829829    // XXX: recode or verify after poly changes
    830     psS32 order = 1 + in->x->COOL_2D_nX;
     830    psS32 order = 1 + in->x->nX;
    831831
    832832    psPlaneTransform *myPT = NULL;
     
    842842    } else {
    843843        // XXX: recode or verify after poly changes
    844         if (((1 + out->x->COOL_2D_nX) == order) && ((1 + out->x->COOL_2D_nY) == order) &&
    845                 ((1 + out->y->COOL_2D_nX) == order) && ((1 + out->y->COOL_2D_nX) == order)) {
     844        if (((1 + out->x->nX) == order) && ((1 + out->x->nY) == order) &&
     845                ((1 + out->y->nX) == order) && ((1 + out->y->nX) == order)) {
    846846            myPT = out;
    847847        } else {
     
    854854    // Copy the input transform to myPT.
    855855    //
    856     for (psS32 i = 0 ; i < (1 + in->x->COOL_2D_nX) ; i++) {
    857         for (psS32 j = 0 ; j < (1 + in->x->COOL_2D_nY) ; j++) {
     856    for (psS32 i = 0 ; i < (1 + in->x->nX) ; i++) {
     857        for (psS32 j = 0 ; j < (1 + in->x->nY) ; j++) {
    858858            myPT->x->coeff[i][j] = in->x->coeff[i][j];
    859859        }
    860860    }
    861     for (psS32 i = 0 ; i < (1 + in->y->COOL_2D_nX) ; i++) {
    862         for (psS32 j = 0 ; j < (1 + in->y->COOL_2D_nY) ; j++) {
     861    for (psS32 i = 0 ; i < (1 + in->y->nX) ; i++) {
     862        for (psS32 j = 0 ; j < (1 + in->y->nY) ; j++) {
    863863            myPT->y->coeff[i][j] = in->y->coeff[i][j];
    864864        }
     
    940940
    941941    // This loop starts at loop_x=1 since the derivative of the loop_x=0 terms are all 0.0
    942     for (psS32 loop_x = 1; loop_x < (1 + xPoly->COOL_2D_nX); loop_x++) {
     942    for (psS32 loop_x = 1; loop_x < (1 + xPoly->nX); loop_x++) {
    943943        ySum = 1.0;
    944         for (psS32 loop_y = 0; loop_y < (1 + xPoly->COOL_2D_nY); loop_y++) {
     944        for (psS32 loop_y = 0; loop_y < (1 + xPoly->nY); loop_y++) {
    945945            //
    946946            // For each iteration of the loop, we multiple the (x, y) coefficient
     
    960960
    961961    // This loop starts at loop_y=1 since the derivative of the loop_y=0 terms are all 0.0
    962     for (psS32 loop_x = 0; loop_x < (1 + yPoly->COOL_2D_nX); loop_x++) {
     962    for (psS32 loop_x = 0; loop_x < (1 + yPoly->nX); loop_x++) {
    963963        ySum = 1.0;
    964         for (psS32 loop_y = 1; loop_y < (1 + yPoly->COOL_2D_nY); loop_y++) {
     964        for (psS32 loop_y = 1; loop_y < (1 + yPoly->nY); loop_y++) {
    965965            //
    966966            // For each iteration of the loop, we multiple the (x, y) coefficient
  • trunk/psLib/src/imageops/psImageStats.c

    r5213 r5294  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-09-30 23:09:13 $
     11 *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-10-12 21:02:20 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    233233    chebPolys[1]->coeff[1] = 1;
    234234    for (i = 2; i < maxChebyPoly; i++) {
    235         for (j = 0; j < (1 + chebPolys[i - 1]->COOL_1D_n); j++) {
     235        for (j = 0; j < (1 + chebPolys[i - 1]->nX); j++) {
    236236            chebPolys[i]->coeff[j + 1] = 2 * chebPolys[i - 1]->coeff[j];
    237237        }
    238         for (j = 0; j < (1 + chebPolys[i - 2]->COOL_1D_n); j++) {
     238        for (j = 0; j < (1 + chebPolys[i - 2]->nX); j++) {
    239239            chebPolys[i]->coeff[j] -= chebPolys[i - 2]->coeff[j];
    240240        }
     
    291291    // 29 in the ADD: sums[k][l] = SUM {
    292292    // image(x,y) * Tk(x) * Tl(y) }
    293     sums = (double **)psAlloc((1 + coeffs->COOL_2D_nX) * sizeof(double *));
    294     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
    295         sums[i] = (double *)psAlloc((1 + coeffs->COOL_2D_nY) * sizeof(double));
     293    sums = (double **)psAlloc((1 + coeffs->nX) * sizeof(double *));
     294    for (i = 0; i < (1 + coeffs->nX); i++) {
     295        sums[i] = (double *)psAlloc((1 + coeffs->nY) * sizeof(double));
    296296    }
    297297    // We scale the pixel positions to values
     
    303303    // are needed, then create them.
    304304    // XXX: recorde or verify the poly order/nterm change
    305     maxChebyPoly = coeffs->COOL_2D_nX;
    306     if (coeffs->COOL_2D_nY > coeffs->COOL_2D_nX) {
    307         maxChebyPoly = coeffs->COOL_2D_nY;
     305    maxChebyPoly = coeffs->nX;
     306    if (coeffs->nY > coeffs->nX) {
     307        maxChebyPoly = coeffs->nY;
    308308    }
    309309    chebPolys = p_psCreateChebyshevPolys(maxChebyPoly + 1);
    310310
    311311    // Compute the sums[][] data structure.
    312     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
    313         for (j = 0; j < (1 + coeffs->COOL_2D_nY); j++) {
     312    for (i = 0; i < (1 + coeffs->nX); i++) {
     313        for (j = 0; j < (1 + coeffs->nY); j++) {
    314314            sums[i][j] = 0.0;
    315315            for (x = 0; x < input->numRows; x++) {
     
    332332    }
    333333
    334     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
    335         for (j = 0; j < (1 + coeffs->COOL_2D_nY); j++) {
     334    for (i = 0; i < (1 + coeffs->nX); i++) {
     335        for (j = 0; j < (1 + coeffs->nY); j++) {
    336336            coeffs->coeff[i][j] = sums[i][j];
    337337            coeffs->coeff[i][j] /= (double)(input->numRows * input->numCols);
     
    355355
    356356    // Free some data
    357     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
     357    for (i = 0; i < (1 + coeffs->nX); i++) {
    358358        psFree(sums[i]);
    359359    }
     
    438438    // 29 in the ADD: sums[k][l] = SUM {
    439439    // image(x,y) * Tk(x) * Tl(y) }
    440     sums = (double **)psAlloc((1 + coeffs->COOL_2D_nX) * sizeof(double *));
    441     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
    442         sums[i] = (double *)psAlloc((1 + coeffs->COOL_2D_nY) * sizeof(double));
     440    sums = (double **)psAlloc((1 + coeffs->nX) * sizeof(double *));
     441    for (i = 0; i < (1 + coeffs->nX); i++) {
     442        sums[i] = (double *)psAlloc((1 + coeffs->nY) * sizeof(double));
    443443    }
    444444    // We scale the pixel positions to values
     
    449449    // Determine how many Chebyshev polynomials
    450450    // are needed, then create them.
    451     maxChebyPoly = coeffs->COOL_2D_nX;
    452     if (coeffs->COOL_2D_nY > coeffs->COOL_2D_nX) {
    453         maxChebyPoly = coeffs->COOL_2D_nY;
     451    maxChebyPoly = coeffs->nX;
     452    if (coeffs->nY > coeffs->nX) {
     453        maxChebyPoly = coeffs->nY;
    454454    }
    455455    chebPolys = p_psCreateChebyshevPolys(maxChebyPoly + 1);
    456456
    457457    // Compute the sums[][] data structure.
    458     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
    459         for (j = 0; j < (1 + coeffs->COOL_2D_nY); j++) {
     458    for (i = 0; i < (1 + coeffs->nX); i++) {
     459        for (j = 0; j < (1 + coeffs->nY); j++) {
    460460            sums[i][j] = 0.0;
    461461            for (x = 0; x < input->numRows; x++) {
     
    481481    }
    482482
    483     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
    484         for (j = 0; j < (1 + coeffs->COOL_2D_nY); j++) {
     483    for (i = 0; i < (1 + coeffs->nX); i++) {
     484        for (j = 0; j < (1 + coeffs->nY); j++) {
    485485            coeffs->coeff[i][j] = sums[i][j];
    486486            coeffs->coeff[i][j] /= (double)(input->numRows * input->numCols);
     
    504504
    505505    // Free some data
    506     for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
     506    for (i = 0; i < (1 + coeffs->nX); i++) {
    507507        psFree(sums[i]);
    508508    }
     
    540540    // Determine how many Chebyshev polynomials
    541541    // are needed, then create them.
    542     maxChebyPoly = coeffs->COOL_2D_nX;
    543     if (coeffs->COOL_2D_nY > coeffs->COOL_2D_nX) {
    544         maxChebyPoly = coeffs->COOL_2D_nY;
     542    maxChebyPoly = coeffs->nX;
     543    if (coeffs->nY > coeffs->nX) {
     544        maxChebyPoly = coeffs->nY;
    545545    }
    546546
     
    550550        for (y = 0; y < input->numCols; y++) {
    551551            polySum = 0.0;
    552             for (i = 0; i < (1 + coeffs->COOL_2D_nX); i++) {
    553                 for (j = 0; j < (1 + coeffs->COOL_2D_nY); j++) {
     552            for (i = 0; i < (1 + coeffs->nX); i++) {
     553                for (j = 0; j < (1 + coeffs->nY); j++) {
    554554                    polySum +=
    555555                        psPolynomial1DEval(chebPolys[i], rScalingFactors[x]) *
  • trunk/psLib/src/math/psConstants.h

    r5155 r5294  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.77 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-09-27 23:16:59 $
     8 *  @version $Revision: 1.78 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-10-12 21:02:20 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    579579
    580580#define PS_POLY_PRINT_1D(NAME) \
    581 for (psS32 i = 0 ; i < NAME->COOL_1D_n ; i++) {\
     581for (psS32 i = 0 ; i < NAME->nX ; i++) {\
    582582    printf("%s->coeff[%d] is %f\n", #NAME, i, NAME->coeff[i]); \
    583583}\
  • trunk/psLib/src/math/psMinimize.c

    r5175 r5294  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.141 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-09-29 02:13:54 $
     12 *  @version $Revision: 1.142 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-10-12 21:02:20 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    15071507    // XXX: these ASSERTS are redundant.
    15081508    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    1509     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_1D_n, NULL);
     1509    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
    15101510    PS_ASSERT_VECTOR_NON_NULL(y, NULL);
    15111511    PS_ASSERT_VECTOR_TYPE(y, PS_TYPE_F64, NULL);
     
    15711571    fac = 2.0/((psF32) n);
    15721572    // XXX: is this loop bound correct?
    1573     for (j=0;j<myPoly->COOL_1D_n+1;j++) {
     1573    for (j=0;j<myPoly->nX+1;j++) {
    15741574        sum = 0.0;
    15751575        for (k=0;k<n;k++) {
     
    16001600    // XXX: these ASSERTS are redundant.
    16011601    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    1602     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_1D_n, NULL);
     1602    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
    16031603    PS_ASSERT_VECTOR_NON_NULL(f, NULL);
    16041604    PS_ASSERT_VECTOR_TYPE(f, PS_TYPE_F64, NULL);
     
    16431643    }
    16441644
    1645     nTerm = 1 + myPoly->COOL_1D_n;
     1645    nTerm = 1 + myPoly->nX;
    16461646    nOrder = nTerm - 1;
    16471647
     
    17431743
    17441744    PS_ASSERT_POLY_NON_NULL(poly, NULL);
    1745     PS_ASSERT_INT_NONNEGATIVE(poly->COOL_1D_n, NULL);
     1745    PS_ASSERT_INT_NONNEGATIVE(poly->nX, NULL);
    17461746    PS_ASSERT_VECTOR_NON_NULL(f, NULL);
    17471747    PS_ASSERT_VECTOR_NON_EMPTY(f, NULL);
     
    18831883    // These ASSERTS are redundant.
    18841884    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    1885     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_2D_nX, NULL);
    1886     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_2D_nY, NULL);
     1885    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
     1886    PS_ASSERT_INT_NONNEGATIVE(myPoly->nY, NULL);
    18871887
    18881888    PS_ASSERT_VECTOR_NON_NULL(f, NULL);
     
    19111911
    19121912    // XXX:Watch for changes to the psPolys: nTerm != nOrder.
    1913     psS32 nXterm = 1 + myPoly->COOL_2D_nX;
    1914     psS32 nYterm = 1 + myPoly->COOL_2D_nY;
     1913    psS32 nXterm = 1 + myPoly->nX;
     1914    psS32 nYterm = 1 + myPoly->nY;
    19151915    nTerm = nXterm * nYterm;
    19161916
     
    23102310    // These ASSERTS are redundant.
    23112311    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    2312     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_3D_nX, NULL);
    2313     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_3D_nY, NULL);
    2314     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_3D_nZ, NULL);
     2312    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
     2313    PS_ASSERT_INT_NONNEGATIVE(myPoly->nY, NULL);
     2314    PS_ASSERT_INT_NONNEGATIVE(myPoly->nZ, NULL);
    23152315
    23162316    PS_ASSERT_VECTOR_NON_NULL(f, NULL);
     
    25732573    // These ASSERTS are redundant.
    25742574    PS_ASSERT_POLY_NON_NULL(myPoly, NULL);
    2575     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_4D_nX, NULL);
    2576     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_4D_nY, NULL);
    2577     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_4D_nZ, NULL);
    2578     PS_ASSERT_INT_NONNEGATIVE(myPoly->COOL_4D_nT, NULL);
     2575    PS_ASSERT_INT_NONNEGATIVE(myPoly->nX, NULL);
     2576    PS_ASSERT_INT_NONNEGATIVE(myPoly->nY, NULL);
     2577    PS_ASSERT_INT_NONNEGATIVE(myPoly->nZ, NULL);
     2578    PS_ASSERT_INT_NONNEGATIVE(myPoly->nT, NULL);
    25792579    PS_ASSERT_VECTOR_NON_NULL(f, NULL);
    25802580    PS_ASSERT_VECTOR_TYPE(f, PS_TYPE_F64, NULL);
  • trunk/psLib/src/math/psPolynomial.c

    r5180 r5294  
    77*  polynomials.  It also contains a Gaussian functions.
    88*
    9 *  @version $Revision: 1.129 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-09-29 20:06:58 $
     9*  @version $Revision: 1.130 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-10-12 21:02:20 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9595    unsigned int x = 0;
    9696
    97     for (x = 0; x < (1 + poly->COOL_2D_nX); x++) {
     97    for (x = 0; x < (1 + poly->nX); x++) {
    9898        psFree(poly->coeff[x]);
    9999        psFree(poly->coeffErr[x]);
     
    110110    unsigned int y = 0;
    111111
    112     for (x = 0; x < (1 + poly->COOL_3D_nX); x++) {
    113         for (y = 0; y < (1 + poly->COOL_3D_nY); y++) {
     112    for (x = 0; x < (1 + poly->nX); x++) {
     113        for (y = 0; y < (1 + poly->nY); y++) {
    114114            psFree(poly->coeff[x][y]);
    115115            psFree(poly->coeffErr[x][y]);
     
    132132    unsigned int z = 0;
    133133
    134     for (x = 0; x < (1 + poly->COOL_4D_nX); x++) {
    135         for (y = 0; y < (1 + poly->COOL_4D_nY); y++) {
    136             for (z = 0; z < (1 + poly->COOL_4D_nZ); z++) {
     134    for (x = 0; x < (1 + poly->nX); x++) {
     135        for (y = 0; y < (1 + poly->nY); y++) {
     136            for (z = 0; z < (1 + poly->nZ); z++) {
    137137                psFree(poly->coeff[x][y][z]);
    138138                psFree(poly->coeffErr[x][y][z]);
     
    185185
    186186        for (psS32 i = 2; i < maxChebyPoly; i++) {
    187             for (psS32 j = 0; j < chebPolys[i - 1]->COOL_1D_n; j++) {
     187            for (psS32 j = 0; j < chebPolys[i - 1]->nX; j++) {
    188188                chebPolys[i]->coeff[j + 1] = 2 * chebPolys[i - 1]->coeff[j];
    189189            }
    190             for (psS32 j = 0; j < chebPolys[i - 2]->COOL_1D_n; j++) {
     190            for (psS32 j = 0; j < chebPolys[i - 2]->nX; j++) {
    191191                chebPolys[i]->coeff[j] -= chebPolys[i - 2]->coeff[j];
    192192            }
     
    213213            "---- Calling ordPolynomial1DEval(%lf)\n", x);
    214214    psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4,
    215             "Polynomial order is %u\n", poly->COOL_1D_n);
    216     for (loop_x = 0; loop_x < poly->COOL_1D_n+1; loop_x++) {
     215            "Polynomial order is %u\n", poly->nX);
     216    for (loop_x = 0; loop_x < poly->nX+1; loop_x++) {
    217217        psTrace(".psLib.dataManip.psPolynomial.ordPolynomial1DEval", 4,
    218218                "Polynomial coeff[%u] is %lf\n", loop_x, poly->coeff[loop_x]);
    219219    }
    220220
    221     for (loop_x = 0; loop_x < poly->COOL_1D_n+1; loop_x++) {
     221    for (loop_x = 0; loop_x < poly->nX+1; loop_x++) {
    222222        if (poly->mask[loop_x] == 0) {
    223223            // XXX: If you set the tracelevel to 10 here, and later set the tracelevel to
     
    241241    PS_ASSERT_DOUBLE_WITHIN_RANGE(x, -1.0, 1.0, 0.0);
    242242    // XXX: Create a macro for this in psConstants.h
    243     if (poly->COOL_1D_n < 1) {
    244         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: Chebyshev polynomial is order %u.", poly->COOL_1D_n);
     243    if (poly->nX < 1) {
     244        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: Chebyshev polynomial is order %u.", poly->nX);
    245245        return(NAN);
    246246    }
    247247    psVector *d;
    248248    // XXX: n should be nTerms here (for clarity).  Or get rid of the variable.
    249     unsigned int n = 1 + poly->COOL_1D_n;
     249    unsigned int n = 1 + poly->nX;
    250250    unsigned int i;
    251251    psF64 tmp = 0.0;
     
    305305    psPolynomial1D **chebPolys = NULL;
    306306
    307     chebPolys = createChebyshevPolys(1 + poly->COOL_1D_n);
     307    chebPolys = createChebyshevPolys(1 + poly->nX);
    308308
    309309    tmp = 0.0;
    310     for (i=0;i<(1 + poly->COOL_1D_n);i++) {
     310    for (i=0;i<(1 + poly->nX);i++) {
    311311        tmp+= (poly->coeff[i] * psPolynomial1DEval(x, chebPolys[i]));
    312312    }
     
    330330    psF64 ySum = 1.0;
    331331
    332     for (loop_x = 0; loop_x < (1 + poly->COOL_2D_nX); loop_x++) {
     332    for (loop_x = 0; loop_x < (1 + poly->nX); loop_x++) {
    333333        ySum = xSum;
    334         for (loop_y = 0; loop_y < (1 + poly->COOL_2D_nY); loop_y++) {
     334        for (loop_y = 0; loop_y < (1 + poly->nY); loop_y++) {
    335335            if (poly->mask[loop_x][loop_y] == 0) {
    336336                polySum += ySum * poly->coeff[loop_x][loop_y];
     
    361361    // Determine how many Chebyshev polynomials
    362362    // are needed, then create them.
    363     maxChebyPoly = poly->COOL_2D_nX;
    364     if (poly->COOL_2D_nY > maxChebyPoly) {
    365         maxChebyPoly = poly->COOL_2D_nY;
     363    maxChebyPoly = poly->nX;
     364    if (poly->nY > maxChebyPoly) {
     365        maxChebyPoly = poly->nY;
    366366    }
    367367    chebPolys = createChebyshevPolys(maxChebyPoly + 1);
    368368
    369     for (loop_x = 0; loop_x < (1 + poly->COOL_2D_nX); loop_x++) {
    370         for (loop_y = 0; loop_y < (1 + poly->COOL_2D_nY); loop_y++) {
     369    for (loop_x = 0; loop_x < (1 + poly->nX); loop_x++) {
     370        for (loop_y = 0; loop_y < (1 + poly->nY); loop_y++) {
    371371            if (poly->mask[loop_x][loop_y] == 0) {
    372372                polySum += poly->coeff[loop_x][loop_y] *
     
    396396    psF64 zSum = 1.0;
    397397
    398     for (loop_x = 0; loop_x < (1 + poly->COOL_3D_nX); loop_x++) {
     398    for (loop_x = 0; loop_x < (1 + poly->nX); loop_x++) {
    399399        ySum = xSum;
    400         for (loop_y = 0; loop_y < (1 + poly->COOL_3D_nY); loop_y++) {
     400        for (loop_y = 0; loop_y < (1 + poly->nY); loop_y++) {
    401401            zSum = ySum;
    402             for (loop_z = 0; loop_z < (1 + poly->COOL_3D_nZ); loop_z++) {
     402            for (loop_z = 0; loop_z < (1 + poly->nZ); loop_z++) {
    403403                if (poly->mask[loop_x][loop_y][loop_z] == 0) {
    404404                    polySum += zSum * poly->coeff[loop_x][loop_y][loop_z];
     
    432432    // Determine how many Chebyshev polynomials
    433433    // are needed, then create them.
    434     maxChebyPoly = poly->COOL_3D_nX;
    435     if (poly->COOL_3D_nY > maxChebyPoly) {
    436         maxChebyPoly = poly->COOL_3D_nY;
    437     }
    438     if (poly->COOL_3D_nZ > maxChebyPoly) {
    439         maxChebyPoly = poly->COOL_3D_nZ;
     434    maxChebyPoly = poly->nX;
     435    if (poly->nY > maxChebyPoly) {
     436        maxChebyPoly = poly->nY;
     437    }
     438    if (poly->nZ > maxChebyPoly) {
     439        maxChebyPoly = poly->nZ;
    440440    }
    441441    chebPolys = createChebyshevPolys(maxChebyPoly + 1);
    442442
    443     for (loop_x = 0; loop_x < (1 + poly->COOL_3D_nX); loop_x++) {
    444         for (loop_y = 0; loop_y < (1 + poly->COOL_3D_nY); loop_y++) {
    445             for (loop_z = 0; loop_z < (1 + poly->COOL_3D_nZ); loop_z++) {
     443    for (loop_x = 0; loop_x < (1 + poly->nX); loop_x++) {
     444        for (loop_y = 0; loop_y < (1 + poly->nY); loop_y++) {
     445            for (loop_z = 0; loop_z < (1 + poly->nZ); loop_z++) {
    446446                if (poly->mask[loop_x][loop_y][loop_z] == 0) {
    447447                    polySum += poly->coeff[loop_x][loop_y][loop_z] *
     
    477477    psF64 tSum = 1.0;
    478478
    479     for (loop_x = 0; loop_x < (1 + poly->COOL_4D_nX); loop_x++) {
     479    for (loop_x = 0; loop_x < (1 + poly->nX); loop_x++) {
    480480        ySum = xSum;
    481         for (loop_y = 0; loop_y < (1 + poly->COOL_4D_nY); loop_y++) {
     481        for (loop_y = 0; loop_y < (1 + poly->nY); loop_y++) {
    482482            zSum = ySum;
    483             for (loop_z = 0; loop_z < (1 + poly->COOL_4D_nZ); loop_z++) {
     483            for (loop_z = 0; loop_z < (1 + poly->nZ); loop_z++) {
    484484                tSum = zSum;
    485                 for (loop_t = 0; loop_t < (1 + poly->COOL_4D_nT); loop_t++) {
     485                for (loop_t = 0; loop_t < (1 + poly->nT); loop_t++) {
    486486                    if (poly->mask[loop_x][loop_y][loop_z][loop_t] == 0) {
    487487                        polySum += tSum * poly->coeff[loop_x][loop_y][loop_z][loop_t];
     
    520520    // Determine how many Chebyshev polynomials
    521521    // are needed, then create them.
    522     maxChebyPoly = poly->COOL_4D_nX;
    523     if (poly->COOL_4D_nY > maxChebyPoly) {
    524         maxChebyPoly = poly->COOL_4D_nY;
    525     }
    526     if (poly->COOL_4D_nZ > maxChebyPoly) {
    527         maxChebyPoly = poly->COOL_4D_nZ;
    528     }
    529     if (poly->COOL_4D_nT > maxChebyPoly) {
    530         maxChebyPoly = poly->COOL_4D_nT;
     522    maxChebyPoly = poly->nX;
     523    if (poly->nY > maxChebyPoly) {
     524        maxChebyPoly = poly->nY;
     525    }
     526    if (poly->nZ > maxChebyPoly) {
     527        maxChebyPoly = poly->nZ;
     528    }
     529    if (poly->nT > maxChebyPoly) {
     530        maxChebyPoly = poly->nT;
    531531    }
    532532    // XXX: Add 1 since createChebyshevPolys() takes nTerms, not nOrder.
    533533    chebPolys = createChebyshevPolys(maxChebyPoly + 1);
    534534
    535     for (loop_x = 0; loop_x < (1 + poly->COOL_4D_nX); loop_x++) {
    536         for (loop_y = 0; loop_y < (1 + poly->COOL_4D_nY); loop_y++) {
    537             for (loop_z = 0; loop_z < (1 + poly->COOL_4D_nZ); loop_z++) {
    538                 for (loop_t = 0; loop_t < (1 + poly->COOL_4D_nT); loop_t++) {
     535    for (loop_x = 0; loop_x < (1 + poly->nX); loop_x++) {
     536        for (loop_y = 0; loop_y < (1 + poly->nY); loop_y++) {
     537            for (loop_z = 0; loop_z < (1 + poly->nZ); loop_z++) {
     538                for (loop_t = 0; loop_t < (1 + poly->nT); loop_t++) {
    539539                    if (poly->mask[loop_x][loop_y][loop_z][loop_t] == 0) {
    540540                        polySum += poly->coeff[loop_x][loop_y][loop_z][loop_t] *
     
    627627
    628628    newPoly->type = type;
    629     newPoly->COOL_1D_n = n;
     629    newPoly->nX = n;
    630630    newPoly->coeff = psAlloc((n + 1) * sizeof(psF64));
    631631    newPoly->coeffErr = psAlloc((n + 1) * sizeof(psF64));
     
    655655
    656656    newPoly->type = type;
    657     newPoly->COOL_2D_nX = nX;
    658     newPoly->COOL_2D_nY = nY;
     657    newPoly->nX = nX;
     658    newPoly->nY = nY;
    659659
    660660    newPoly->coeff = psAlloc((1 + nX) * sizeof(psF64 *));
     
    695695
    696696    newPoly->type = type;
    697     newPoly->COOL_3D_nX = nX;
    698     newPoly->COOL_3D_nY = nY;
    699     newPoly->COOL_3D_nZ = nZ;
     697    newPoly->nX = nX;
     698    newPoly->nY = nY;
     699    newPoly->nZ = nZ;
    700700
    701701    newPoly->coeff = psAlloc((nX + 1) * sizeof(psF64 **));
     
    746746
    747747    newPoly->type = type;
    748     newPoly->COOL_4D_nX = nX;
    749     newPoly->COOL_4D_nY = nY;
    750     newPoly->COOL_4D_nZ = nZ;
    751     newPoly->COOL_4D_nT = nT;
     748    newPoly->nX = nX;
     749    newPoly->nY = nY;
     750    newPoly->nZ = nZ;
     751    newPoly->nT = nT;
    752752
    753753    newPoly->coeff = psAlloc((nX + 1) * sizeof(psF64 ***));
  • trunk/psLib/src/math/psPolynomial.h

    r5090 r5294  
    1111 *  @author GLG, MHPCC
    1212 *
    13  *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-09-22 02:47:16 $
     13 *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-10-12 21:02:20 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7676{
    7777    psPolynomialType type;              ///< Polynomial type
    78     unsigned int COOL_1D_n;             ///< Polynomial order
     78    unsigned int nX;             ///< Polynomial order
    7979    psF64 *coeff;                       ///< Coefficients
    8080    psF64 *coeffErr;                    ///< Error in coefficients
     
    9090{
    9191    psPolynomialType type;              ///< Polynomial type
    92     unsigned int COOL_2D_nX;            ///< Polynomial order in x
    93     unsigned int COOL_2D_nY;            ///< Polynomial order in y
     92    unsigned int nX;            ///< Polynomial order in x
     93    unsigned int nY;            ///< Polynomial order in y
    9494    psF64 **coeff;                      ///< Coefficients
    9595    psF64 **coeffErr;                   ///< Error in coefficients
     
    105105{
    106106    psPolynomialType type;              ///< Polynomial type
    107     unsigned int COOL_3D_nX;            ///< Polynomial order in x
    108     unsigned int COOL_3D_nY;            ///< Polynomial order in y
    109     unsigned int COOL_3D_nZ;            ///< Polynomial order in z
     107    unsigned int nX;            ///< Polynomial order in x
     108    unsigned int nY;            ///< Polynomial order in y
     109    unsigned int nZ;            ///< Polynomial order in z
    110110    psF64 ***coeff;                     ///< Coefficients
    111111    psF64 ***coeffErr;                  ///< Error in coefficients
     
    121121{
    122122    psPolynomialType type;              ///< Polynomial type
    123     unsigned int COOL_4D_nX;            ///< Polynomial order in x
    124     unsigned int COOL_4D_nY;            ///< Polynomial order in y
    125     unsigned int COOL_4D_nZ;            ///< Polynomial order in z
    126     unsigned int COOL_4D_nT;            ///< Polynomial order in t
     123    unsigned int nX;            ///< Polynomial order in x
     124    unsigned int nY;            ///< Polynomial order in y
     125    unsigned int nZ;            ///< Polynomial order in z
     126    unsigned int nT;            ///< Polynomial order in t
    127127    psF64 ****coeff;                    ///< Coefficients
    128128    psF64 ****coeffErr;                 ///< Error in coefficients
  • trunk/psLib/test/astro/tst_psCoord.c

    r5095 r5294  
    66*  @author GLG, MHPCC
    77*
    8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-09-22 22:24:58 $
     8*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-10-12 21:02:20 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5252
    5353    // Verify returned transform has members set properly
    54     if ((1 + myPT->x->COOL_2D_nX) != NX_TERMS) {
    55         psError(PS_ERR_UNKNOWN,true,"myPT->x->COOL_2D_nX is %d, should be %d",
    56                 myPT->x->COOL_2D_nX, NX_TERMS-1);
     54    if ((1 + myPT->x->nX) != NX_TERMS) {
     55        psError(PS_ERR_UNKNOWN,true,"myPT->x->nX is %d, should be %d",
     56                myPT->x->nX, NX_TERMS-1);
    5757        return 2;
    5858    }
    59     if ((1 + myPT->y->COOL_2D_nX) != NX_TERMS) {
    60         psError(PS_ERR_UNKNOWN,true,"myPT->y->COOL_2D_nX is %d, should be %d",
    61                 myPT->y->COOL_2D_nX, NX_TERMS-1);
     59    if ((1 + myPT->y->nX) != NX_TERMS) {
     60        psError(PS_ERR_UNKNOWN,true,"myPT->y->nX is %d, should be %d",
     61                myPT->y->nX, NX_TERMS-1);
    6262        return 3;
    6363    }
    64     if ((1 + myPT->x->COOL_2D_nY) != NY_TERMS) {
    65         psError(PS_ERR_UNKNOWN,true,"myPT->x->COOL_2D_nY is %d, should be %d",
    66                 myPT->x->COOL_2D_nY, NY_TERMS-1);
     64    if ((1 + myPT->x->nY) != NY_TERMS) {
     65        psError(PS_ERR_UNKNOWN,true,"myPT->x->nY is %d, should be %d",
     66                myPT->x->nY, NY_TERMS-1);
    6767        return 4;
    6868    }
    69     if ((1 + myPT->y->COOL_2D_nY) != NY_TERMS) {
    70         psError(PS_ERR_UNKNOWN,true,"myPT->y->COOL_2D_nY is %d, should be %d",
    71                 myPT->y->COOL_2D_nY, NY_TERMS-1);
     69    if ((1 + myPT->y->nY) != NY_TERMS) {
     70        psError(PS_ERR_UNKNOWN,true,"myPT->y->nY is %d, should be %d",
     71                myPT->y->nY, NY_TERMS-1);
    7272        return 5;
    7373    }
     
    109109    }
    110110    // Verify the terms are properly set after allocation
    111     if ((1 + myPD->x->COOL_4D_nX) != NX_TERMS) {
    112         psError(PS_ERR_UNKNOWN,true,"myPD->x->COOL_4D_nX is %d, should be %d",
    113                 myPD->x->COOL_4D_nX, NX_TERMS-1);
     111    if ((1 + myPD->x->nX) != NX_TERMS) {
     112        psError(PS_ERR_UNKNOWN,true,"myPD->x->nX is %d, should be %d",
     113                myPD->x->nX, NX_TERMS-1);
    114114        return 2;
    115115    }
    116     if ((1 + myPD->y->COOL_4D_nX) != NX_TERMS) {
    117         psError(PS_ERR_UNKNOWN,true,"myPD->y->COOL_4D_nX is %d, should be %d",
    118                 myPD->y->COOL_4D_nX, NX_TERMS-1);
     116    if ((1 + myPD->y->nX) != NX_TERMS) {
     117        psError(PS_ERR_UNKNOWN,true,"myPD->y->nX is %d, should be %d",
     118                myPD->y->nX, NX_TERMS-1);
    119119        return 3;
    120120    }
    121     if ((1 + myPD->x->COOL_4D_nY) != NY_TERMS) {
    122         psError(PS_ERR_UNKNOWN,true,"myPD->x->COOL_4D_nY is %d, should be %d",
    123                 myPD->x->COOL_4D_nY, NY_TERMS-1);
     121    if ((1 + myPD->x->nY) != NY_TERMS) {
     122        psError(PS_ERR_UNKNOWN,true,"myPD->x->nY is %d, should be %d",
     123                myPD->x->nY, NY_TERMS-1);
    124124        return 4;
    125125    }
    126     if ((1 + myPD->y->COOL_4D_nY) != NY_TERMS) {
    127         psError(PS_ERR_UNKNOWN,true,"myPD->y->COOL_4D_nY is %d, should be %d",
    128                 myPD->y->COOL_4D_nY, NY_TERMS-1);
     126    if ((1 + myPD->y->nY) != NY_TERMS) {
     127        psError(PS_ERR_UNKNOWN,true,"myPD->y->nY is %d, should be %d",
     128                myPD->y->nY, NY_TERMS-1);
    129129        return 5;
    130130    }
    131     if ((1 + myPD->x->COOL_4D_nZ) != NZ_TERMS) {
    132         psError(PS_ERR_UNKNOWN,true,"myPD->x->COOL_4D_nZ is %d, should be %d",
    133                 myPD->x->COOL_4D_nX, NZ_TERMS-1);
     131    if ((1 + myPD->x->nZ) != NZ_TERMS) {
     132        psError(PS_ERR_UNKNOWN,true,"myPD->x->nZ is %d, should be %d",
     133                myPD->x->nX, NZ_TERMS-1);
    134134        return 6;
    135135    }
    136     if ((1 + myPD->y->COOL_4D_nZ) != NZ_TERMS) {
    137         psError(PS_ERR_UNKNOWN,true,"myPD->y->COOL_4D_nZ is %d, should be %d",
    138                 myPD->y->COOL_4D_nZ, NZ_TERMS-1);
     136    if ((1 + myPD->y->nZ) != NZ_TERMS) {
     137        psError(PS_ERR_UNKNOWN,true,"myPD->y->nZ is %d, should be %d",
     138                myPD->y->nZ, NZ_TERMS-1);
    139139        return 7;
    140140    }
    141     if ((1 + myPD->x->COOL_4D_nT) != NT_TERMS) {
    142         psError(PS_ERR_UNKNOWN,true,"myPD->x->COOL_4D_nT is %d, should be %d",
    143                 myPD->x->COOL_4D_nT, NT_TERMS-1);
     141    if ((1 + myPD->x->nT) != NT_TERMS) {
     142        psError(PS_ERR_UNKNOWN,true,"myPD->x->nT is %d, should be %d",
     143                myPD->x->nT, NT_TERMS-1);
    144144        return 8;
    145145    }
    146     if ((1 + myPD->y->COOL_4D_nT) != NT_TERMS) {
    147         psError(PS_ERR_UNKNOWN,true,"myPD->y->COOL_4D_nT is %d, should be %d",
    148                 myPD->y->COOL_4D_nT, NT_TERMS-1);
     146    if ((1 + myPD->y->nT) != NT_TERMS) {
     147        psError(PS_ERR_UNKNOWN,true,"myPD->y->nT is %d, should be %d",
     148                myPD->y->nT, NT_TERMS-1);
    149149        return 9;
    150150    }
  • trunk/psLib/test/math/tst_psFunc00.c

    r5091 r5294  
    1616*    XXX: Compare to FLT_EPSILON
    1717*
    18 *    @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
    19 *    @date $Date: 2005-09-22 03:00:31 $
     18*    @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
     19*    @date $Date: 2005-10-12 21:02:20 $
    2020*
    2121*  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    6565    }
    6666    // Verify polynomial structure members set properly
    67     if(my1DPoly->COOL_1D_n != ORDER) {
    68         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    69                 my1DPoly->COOL_1D_n, ORDER);
     67    if(my1DPoly->nX != ORDER) {
     68        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     69                my1DPoly->nX, ORDER);
    7070        return 2;
    7171    }
     
    117117    }
    118118    // Verify polynomial structure members set properly
    119     if(my2DPoly->COOL_2D_nX != ORDER) {
    120         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    121                 my2DPoly->COOL_2D_nX, ORDER);
     119    if(my2DPoly->nX != ORDER) {
     120        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     121                my2DPoly->nX, ORDER);
    122122        return 2;
    123123    }
    124124    // Verify polynomial structure members set properly
    125     if(my2DPoly->COOL_2D_nY != ORDER+1) {
    126         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    127                 my2DPoly->COOL_2D_nY, ORDER+1);
     125    if(my2DPoly->nY != ORDER+1) {
     126        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     127                my2DPoly->nY, ORDER+1);
    128128        return 3;
    129129    }
     
    184184    }
    185185    // Verify polynomial structure members set properly
    186     if(my3DPoly->COOL_3D_nX != ORDER) {
    187         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    188                 my3DPoly->COOL_3D_nX, ORDER);
     186    if(my3DPoly->nX != ORDER) {
     187        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     188                my3DPoly->nX, ORDER);
    189189        return 2;
    190190    }
    191191    // Verify polynomial structure members set properly
    192     if(my3DPoly->COOL_3D_nY != ORDER+1) {
    193         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    194                 my3DPoly->COOL_3D_nY, ORDER+1);
     192    if(my3DPoly->nY != ORDER+1) {
     193        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     194                my3DPoly->nY, ORDER+1);
    195195        return 3;
    196196    }
    197197    // Verify polynomial structure members set properly
    198     if(my3DPoly->COOL_3D_nZ != ORDER+2) {
    199         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    200                 my3DPoly->COOL_3D_nZ, ORDER+2);
     198    if(my3DPoly->nZ != ORDER+2) {
     199        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     200                my3DPoly->nZ, ORDER+2);
    201201        return 4;
    202202    }
     
    264264    }
    265265    // Verify polynomial structure members set properly
    266     if(my4DPoly->COOL_4D_nX != ORDER) {
    267         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    268                 my4DPoly->COOL_4D_nX, ORDER);
     266    if(my4DPoly->nX != ORDER) {
     267        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     268                my4DPoly->nX, ORDER);
    269269        return 2;
    270270    }
    271271    // Verify polynomial structure members set properly
    272     if(my4DPoly->COOL_4D_nY != ORDER+1) {
    273         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    274                 my4DPoly->COOL_4D_nX, ORDER+1);
     272    if(my4DPoly->nY != ORDER+1) {
     273        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     274                my4DPoly->nX, ORDER+1);
    275275        return 3;
    276276    }
    277277    // Verify polynomial structure members set properly
    278     if(my4DPoly->COOL_4D_nZ != ORDER+2) {
    279         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    280                 my4DPoly->COOL_4D_nZ, ORDER+2);
     278    if(my4DPoly->nZ != ORDER+2) {
     279        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     280                my4DPoly->nZ, ORDER+2);
    281281        return 4;
    282282    }
    283283    // Verify polynomial structure members set properly
    284     if(my4DPoly->COOL_4D_nT != ORDER+3) {
    285         psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
    286                 my4DPoly->COOL_4D_nT, ORDER+3);
     284    if(my4DPoly->nT != ORDER+3) {
     285        psError(PS_ERR_UNKNOWN,true,"Number of terms %d not as expected %d",
     286                my4DPoly->nT, ORDER+3);
    287287        return 5;
    288288    }
  • trunk/psModules/src/imsubtract/pmSubtractBias.c

    r5188 r5294  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-09-29 21:57:30 $
     8 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-10-12 21:02:04 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2626{
    2727    printf("-------------- PS_POLY1D_PRINT() --------------\n");
    28     printf("poly->COOL_1D_n is %d\n", poly->COOL_1D_n);
    29     for (psS32 i = 0 ; i < (1 + poly->COOL_1D_n) ; i++) {
     28    printf("poly->nX is %d\n", poly->nX);
     29    for (psS32 i = 0 ; i < (1 + poly->nX) ; i++) {
    3030        printf("poly->coeff[%d] is %f\n", i, poly->coeff[i]);
    3131    }
  • trunk/psModules/src/imsubtract/pmSubtractSky.c

    r5170 r5294  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2005-09-28 20:43:52 $
     8 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2005-10-12 21:02:04 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    306306    // polynomial if there are not enough rows/columns in the input image.
    307307
    308     if ((myPoly->COOL_2D_nX + 1) > dataImage->numRows) {
     308    if ((myPoly->nX + 1) > dataImage->numRows) {
    309309        psLogMsg(__func__, PS_LOG_WARN,
    310310                 "WARNING: ImageFitPolynomial(): Reducing polynomial complexity in x-dimension.\n");
    311         oldPolyX = myPoly->COOL_2D_nX;
    312         myPoly->COOL_2D_nX = dataImage->numRows - 1;
    313     }
    314     if ((myPoly->COOL_2D_nY + 1) > dataImage->numCols) {
     311        oldPolyX = myPoly->nX;
     312        myPoly->nX = dataImage->numRows - 1;
     313    }
     314    if ((myPoly->nY + 1) > dataImage->numCols) {
    315315        psLogMsg(__func__, PS_LOG_WARN,
    316316                 "WARNING: ImageFitPolynomial(): Reducing polynomial complexity in y-dimension.\n");
    317         oldPolyY = myPoly->COOL_2D_nY;
    318         myPoly->COOL_2D_nY = dataImage->numCols - 1;
     317        oldPolyY = myPoly->nY;
     318        myPoly->nY = dataImage->numCols - 1;
    319319    }
    320320    psS32 i;
     
    324324    psS32 aRow;
    325325    psS32 aCol;
    326     psS32 **polyTerms = buildPolyTerms(myPoly->COOL_2D_nX, myPoly->COOL_2D_nY);
     326    psS32 **polyTerms = buildPolyTerms(myPoly->nX, myPoly->nY);
    327327    // We determine how many coefficients will be in the polynomial that we
    328328    // are fitting to this image.
    329     psS32 localPolyTerms = CalculatePolyTerms(myPoly->COOL_2D_nX, myPoly->COOL_2D_nY);
     329    psS32 localPolyTerms = CalculatePolyTerms(myPoly->nX, myPoly->nY);
    330330    psImage *A = psImageAlloc(localPolyTerms, localPolyTerms, PS_TYPE_F64);
    331331    psImage *Aout = psImageAlloc(localPolyTerms, localPolyTerms, PS_TYPE_F64);
     
    345345        for (y=0;y<dataImage->numCols;y++) {
    346346            if (maskImage->data.U8[x][y] == 0) {
    347                 buildSums((psF64) x, (psF64) y, myPoly->COOL_2D_nX, myPoly->COOL_2D_nY);
     347                buildSums((psF64) x, (psF64) y, myPoly->nX, myPoly->nY);
    348348
    349349                /************************************************************
     
    428428    //
    429429    if (oldPolyX != -1) {
    430         myPoly->COOL_2D_nX = oldPolyX;
    431         for (i=oldPolyX ; i < (1 + myPoly->COOL_2D_nX) ; i++) {
    432             for (j=0;j<(1 + myPoly->COOL_2D_nY) ; j++) {
     430        myPoly->nX = oldPolyX;
     431        for (i=oldPolyX ; i < (1 + myPoly->nX) ; i++) {
     432            for (j=0;j<(1 + myPoly->nY) ; j++) {
    433433                myPoly->coeff[i][j] = 0.0;
    434434            }
     
    436436    }
    437437    if (oldPolyY != -1) {
    438         myPoly->COOL_2D_nY = oldPolyY;
    439         for (i=0 ; i < (1 + myPoly->COOL_2D_nX) ; i++) {
    440             for (j=oldPolyY;j < (1 + myPoly->COOL_2D_nY) ; j++) {
     438        myPoly->nY = oldPolyY;
     439        for (i=0 ; i < (1 + myPoly->nX) ; i++) {
     440            for (j=oldPolyY;j < (1 + myPoly->nY) ; j++) {
    441441                myPoly->coeff[i][j] = 0.0;
    442442            }
Note: See TracChangeset for help on using the changeset viewer.