IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12458


Ignore:
Timestamp:
Mar 15, 2007, 2:33:55 PM (19 years ago)
Author:
magnier
Message:

cleanup: moved tmp variables into PS_BIN_FOR_VALUE

File:
1 edited

Legend:

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

    r12437 r12458  
    1313 * use ->min and ->max (PS_STAT_USE_RANGE)
    1414 *
    15  *  @version $Revision: 1.202 $ $Name: not supported by cvs2svn $
    16  *  @date $Date: 2007-03-14 02:43:47 $
     15 *  @version $Revision: 1.203 $ $Name: not supported by cvs2svn $
     16 *  @date $Date: 2007-03-16 00:33:55 $
    1717 *
    1818 *  Copyright 2006 IfA, University of Hawaii
     
    6969// set the bin closest to the corresponding value.  if USE_END is +/- 1,
    7070// out-of-range saturates on lower/upper bin REGARDLESS of actual value
    71 #define PS_BIN_FOR_VALUE(RESULT, VECTOR, VALUE, USE_END) \
     71#define PS_BIN_FOR_VALUE(RESULT, VECTOR, VALUE, USE_END) { \
     72        psVectorBinaryDisectResult result; \
     73        psScalar tmpScalar; \
     74        tmpScalar.type.type = PS_TYPE_F32; \
    7275        tmpScalar.data.F32 = (VALUE); \
    7376        RESULT = psVectorBinaryDisect (&result, VECTOR, &tmpScalar); \
     
    8487            psAbort ("programming error"); \
    8588            break; \
    86         }
     89        } }
    8790
    8891# define PS_BIN_INTERPOLATE(RESULT, VECTOR, BOUNDS, BIN, VALUE) { \
     
    626629    }
    627630
    628     psVectorBinaryDisectResult result;
    629     psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
    630     tmpScalar.type.type = PS_TYPE_F32;
    631 
    632631    // we need to generate an internal mask and maskVal which ensures a bit is set
    633632    // and tested even if there is no supplied mask (and/or the maskVal is 0)
     
    920919    float guessMean = stats->robustMedian;  // pass the guess mean
    921920
    922     psVectorBinaryDisectResult result;
    923 
    924921    psTrace("psLib.math", 6, "The guess mean  is %f.\n", guessMean);
    925922    psTrace("psLib.math", 6, "The guess stdev is %f.\n", guessStdev);
     
    928925    for (int iteration = 0; !done && (iteration < 2); iteration ++) {
    929926        psStats *statsMinMax = psStatsAlloc(PS_STAT_MIN | PS_STAT_MAX); // Statistics for min and max
    930 
    931         psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
    932         tmpScalar.type.type = PS_TYPE_F32;
    933927
    934928        psF32 binSize = 1;
     
    11031097    float guessMean = stats->robustMedian;  // pass the guess mean
    11041098
    1105     psVectorBinaryDisectResult result;
    11061099    psTrace("psLib.math", 6, "The ** starting ** guess mean  is %f.\n", guessMean);
    11071100    psTrace("psLib.math", 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
     
    11101103    for (int iteration = 0; !done && (iteration < 2); iteration ++) {
    11111104        psStats *statsMinMax = psStatsAlloc(PS_STAT_MIN | PS_STAT_MAX); // Statistics for min and max
    1112 
    1113         psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
    1114         tmpScalar.type.type = PS_TYPE_F32;
    11151105
    11161106        psF32 binSize = 1;
     
    12991289    float guessMean = stats->robustMedian;  // pass the guess mean
    13001290
    1301     psVectorBinaryDisectResult result;
    13021291    psTrace("psLib.math", 6, "The ** starting ** guess mean  is %f.\n", guessMean);
    13031292    psTrace("psLib.math", 6, "The ** starting ** guess stdev is %f.\n", guessStdev);
     
    13061295    for (int iteration = 0; !done && (iteration < 2); iteration ++) {
    13071296        psStats *statsMinMax = psStatsAlloc(PS_STAT_MIN | PS_STAT_MAX); // Statistics for min and max
    1308 
    1309         psScalar tmpScalar;                 // Temporary scalar variable, for psVectorBinaryDisect
    1310         tmpScalar.type.type = PS_TYPE_F32;
    13111297
    13121298        psF32 binSize = 1;
Note: See TracChangeset for help on using the changeset viewer.