IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2790


Ignore:
Timestamp:
Dec 22, 2004, 11:00:50 AM (22 years ago)
Author:
gusciora
Message:

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/dataManip/tst_psFunc00.c

    r2742 r2790  
    2323#define CN 6
    2424#define DN 8
     25
     26// XXX: This test comes from Paul Price.  We should add into the code.
     27#define ORDER 3
     28#define BAD 1
     29int t01()
     30{
     31    psPolynomial1D *poly = psPolynomial1DAlloc(ORDER, PS_POLYNOMIAL_ORD);
     32
     33    for (int i = 0; i < poly->n; i++) {
     34        poly->coeff[i] = (float)i;
     35        if (i == BAD) {
     36            poly->mask[i] = 1;  // Don't use this coefficient!
     37        } else {
     38            poly->mask[i] = 0;
     39        }
     40    }
     41
     42    fprintf(stderr,"Value using mask: %f\n", psPolynomial1DEval(poly, 0.5));
     43
     44    // A different method of doing the same thing
     45    poly->coeff[BAD] = 0.0;
     46    poly->mask[BAD] = 0;
     47
     48    fprintf(stderr,"Value using coefficient zeroing: %f\n", psPolynomial1DEval(poly, 0.5));
     49
     50    psFree(poly);
     51
     52    return(0);
     53}
     54
     55
    2556psS32 main()
    2657{
     58    t01();
     59
    2760    psPolynomial1D *my1DPoly = NULL;
    2861    psPolynomial2D *my2DPoly = NULL;
     
    605638    return (!testStatus);
    606639}
     640
Note: See TracChangeset for help on using the changeset viewer.