IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5570


Ignore:
Timestamp:
Nov 22, 2005, 9:54:55 AM (21 years ago)
Author:
magnier
Message:

fixed compilation bugs

Location:
branches/eam_rel8_b1/psLib/src/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel8_b1/psLib/src/math/psMinimize.c

    r5567 r5570  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.142.6.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-11-22 18:06:10 $
     12 *  @version $Revision: 1.142.6.2 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-11-22 19:54:55 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    14411441}
    14421442
    1443 
    1444 /******************************************************************************
    1445 BuildSums4D(sums, x, y, z, t, nXterm, nYterm, nZterm, nTterm). equiv to
    1446 BuildSums2D(). The result is returned as a double ****
    1447  *****************************************************************************/
    1448 static psImage *BuildSums4D(
    1449     psF64 ****sums,
    1450     psF64 x,
    1451     psF64 y,
    1452     psF64 z,
    1453     psF64 t,
    1454     psS32 nXterm,
    1455     psS32 nYterm,
    1456     psS32 nZterm,
    1457     psS32 nTterm)
     1443// here is the definition for BuildSums4D.  ifdef'ed away until it is used
     1444// by psPolynomial4DFit..
     1445# if (0)
     1446    /******************************************************************************
     1447    BuildSums4D(sums, x, y, z, t, nXterm, nYterm, nZterm, nTterm). equiv to
     1448    BuildSums2D(). The result is returned as a double ****
     1449     *****************************************************************************/
     1450    static double ****BuildSums4D(
     1451        psF64 ****sums,
     1452        psF64 x,
     1453        psF64 y,
     1454        psF64 z,
     1455        psF64 t,
     1456        psS32 nXterm,
     1457        psS32 nYterm,
     1458        psS32 nZterm,
     1459        psS32 nTterm)
    14581460{
    14591461    psS32 nXsum = 0;
     
    14711473    nTsum = 2*nTterm;
    14721474    if (sums == NULL) {
    1473         sums = (psF64 ****) psAlloc (nXsum*PSELEMTYPE_SIZEOF(psF64));
     1475        sums = (psF64 ****) psAlloc (nXsum*sizeof(psF64));
    14741476        for (int i = 0; i < nXsum; i++) {
    1475             sums[i] = (psF64 ***) psAlloc (nYsum*PSELEMTYPE_SIZEOF(psF64));
     1477            sums[i] = (psF64 ***) psAlloc (nYsum*sizeof(psF64));
    14761478            for (int j = 0; j < nYsum; j++) {
    1477                 sums[i][j] = (psF64 **) psAlloc (nZsum*PSELEMTYPE_SIZEOF(psF64));
     1479                sums[i][j] = (psF64 **) psAlloc (nZsum*sizeof(psF64));
    14781480                for (int k = 0; k < nZsum; k++) {
    1479                     sums[i][j][k] = (psF64 *) psAlloc (nTsum*PSELEMTYPE_SIZEOF(psF64));
     1481                    sums[i][j][k] = (psF64 *) psAlloc (nTsum*sizeof(psF64));
    14801482                }
    14811483            }
     
    15031505    return (sums);
    15041506}
     1507# endif /* BuildSums4D */
    15051508
    15061509/******************************************************************************
     
    15091512in the output vector.  This routine works on single-precision polynomials with
    15101513double precision data.
     1514 
     1515XXX EAM : this function is now deprecated: psPolynomial2DEvalVector handles F32 and F64
    15111516 *****************************************************************************/
    15121517psVector *Polynomial2DEvalVectorD(
     
    18991904    // assign sequence vector if xIn is NULL
    19001905    if (xIn == NULL) {
    1901         x = psVectorCreate (NULL, 0, f->n, 1, f->type);
     1906        x = psVectorCreate (NULL, 0, f->n, 1, f->type.type);
    19021907    } else {
    1903         x = xIn;
     1908        x = (psVector *) xIn;
    19041909    }
    19051910
     
    19071912    float minClipSigma;
    19081913    float maxClipSigma;
    1909     if (finite(stats->max)) {
     1914    if (isfinite(stats->max)) {
    19101915        maxClipSigma = fabs(stats->clipSigma);
    19111916    } else {
    19121917        maxClipSigma = fabs(stats->max);
    19131918    }
    1914     if (finite(stats->min)) {
     1919    if (isfinite(stats->min)) {
    19151920        minClipSigma = fabs(stats->clipSigma);
    19161921    } else {
     
    20552060        } else {
    20562061            // this filters fErr == 0 values
    2057             wt = (fErr->data.F64[k] == ) ? 0.0 : 1.0 / PS_SQR(fErr->data.F64[k]);
     2062            wt = (fErr->data.F64[k] == 0.0) ? 0.0 : 1.0 / PS_SQR(fErr->data.F64[k]);
    20582063        }
    20592064
     
    20972102
    20982103
     2104// XXX EAM : I have implemented a single function to handle the mask/nomask cases
     2105//           this function can be deprecated
    20992106psPolynomial2D* RobustFit2D_nomask(
    21002107    psPolynomial2D* poly,
     
    23822389    float minClipSigma;
    23832390    float maxClipSigma;
    2384     if (finite(stats->max)) {
     2391    if (isfinite(stats->max)) {
     2392        maxClipSigma = fabs(stats->max);
     2393    } else {
    23852394        maxClipSigma = fabs(stats->clipSigma);
     2395    }
     2396    if (isfinite(stats->min)) {
     2397        minClipSigma = fabs(stats->min);
    23862398    } else {
    2387         maxClipSigma = fabs(stats->max);
    2388     }
    2389     if (finite(stats->min)) {
    23902399        minClipSigma = fabs(stats->clipSigma);
    2391     } else {
    2392         minClipSigma = fabs(stats->min);
    23932400    }
    23942401    psVector *fit   = NULL;
  • branches/eam_rel8_b1/psLib/src/math/psPolynomial.c

    r5566 r5570  
    77*  polynomials.  It also contains a Gaussian functions.
    88*
    9 *  @version $Revision: 1.130.4.1.2.1 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-11-22 18:04:28 $
     9*  @version $Revision: 1.130.4.1.2.2 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-11-22 19:54:55 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    784784}
    785785
    786 
    787 
    788 
    789 
    790 
    791 
    792 
    793 
    794 
    795 
    796 
    797 
    798 
    799 
    800 
    801 
    802 
    803 
    804 
    805 
    806 
    807 
    808786psF64 psPolynomial1DEval(const psPolynomial1D* poly,
    809787                         psF64 x)
     
    829807    PS_ASSERT_POLY_NON_NULL(poly, NULL);
    830808    PS_ASSERT_VECTOR_NON_NULL(x, NULL);
    831     // PS_ASSERT_VECTOR_TYPE(x, PS_TYPE_F64, NULL);
     809    PS_ASSERT_VECTOR_TYPE_F32_OR_F64(x, NULL);
    832810
    833811    psVector *tmp;
    834812
    835     switch (x->type) {
     813    switch (x->type.type) {
    836814    case PS_TYPE_F64:
    837815        tmp = psVectorAlloc(x->n, PS_TYPE_F64);
     
    880858    PS_ASSERT_POLY_NON_NULL(poly, NULL);
    881859    PS_ASSERT_VECTOR_NON_NULL(x, NULL);
    882     PS_ASSERT_VECTOR_TYPE(x, PS_TYPE_F64, NULL);
     860    PS_ASSERT_VECTOR_TYPE_F32_OR_F64(x, NULL);
    883861    PS_ASSERT_VECTOR_NON_NULL(y, NULL);
    884     PS_ASSERT_VECTOR_TYPE(y, PS_TYPE_F64, NULL);
     862    PS_ASSERT_VECTOR_TYPE_F32_OR_F64(y, NULL);
    885863
    886864    psVector *tmp;
     
    892870    }
    893871
    894     switch (x->type) {
     872    switch (x->type.type) {
    895873    case PS_TYPE_F32:
    896         if (y->type != x->type) {
     874        if (y->type.type != x->type.type) {
    897875            psError(PS_ERR_UNKNOWN, true, "type mismatch in data vectors");
    898876            return (NULL);
     
    908886        break;
    909887    case PS_TYPE_F64:
    910         if (y->type != x->type) {
     888        if (y->type.type != x->type.type) {
    911889            psError(PS_ERR_UNKNOWN, true, "type mismatch in data vectors");
    912890            return (NULL);
Note: See TracChangeset for help on using the changeset viewer.