IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2780


Ignore:
Timestamp:
Dec 21, 2004, 1:25:14 PM (22 years ago)
Author:
gusciora
Message:

...

Location:
trunk/psLib
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psRandom.h

    r2432 r2780  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-11-24 20:55:01 $
     12*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-12-21 23:25:14 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1616*/
    1717
    18 #if !defined(PS_FUNCTIONS_H)
    19 #define PS_FUNCTIONS_H
     18#if !defined(PS_RANDOM_H)
     19#define PS_RANDOM_H
    2020
    2121#include <stdio.h>
  • trunk/psLib/src/dataManip/psStats.c

    r2778 r2780  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.105 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-12-21 20:42:07 $
     11 *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-12-21 23:25:14 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    151151                         psStats* stats)
    152152{
     153
    153154    psS32 i = 0;                // Loop index variable
    154155    float mean = 0.0;           // The mean
     
    920921                    sumDiffs += diff;
    921922                    countInt++;
    922                     errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     923                    if (errors != NULL) {
     924                        errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     925                    }
    923926                }
    924927            }
     
    931934                    sumDiffs += diff;
    932935                    countInt++;
    933                     errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     936                    if (errors != NULL) {
     937                        errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     938                    }
    934939                }
    935940            }
     
    944949                    sumDiffs += diff;
    945950                    countInt++;
    946                     errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     951                    if (errors != NULL) {
     952                        errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     953                    }
    947954                }
    948955            }
     
    955962            }
    956963            countInt = myVector->n;
    957             errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     964            if (errors != NULL) {
     965                errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     966            }
    958967        }
    959968    }
     
    19621971psVector* p_psConvertToF32(psVector* in)
    19631972{
     1973    if (in == NULL) {
     1974        return(NULL);
     1975    }
    19641976    psS32 i = 0;
    19651977    psVector* tmp = NULL;
  • trunk/psLib/src/math/psRandom.h

    r2432 r2780  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-11-24 20:55:01 $
     12*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-12-21 23:25:14 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    1616*/
    1717
    18 #if !defined(PS_FUNCTIONS_H)
    19 #define PS_FUNCTIONS_H
     18#if !defined(PS_RANDOM_H)
     19#define PS_RANDOM_H
    2020
    2121#include <stdio.h>
  • trunk/psLib/src/math/psStats.c

    r2778 r2780  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.105 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-12-21 20:42:07 $
     11 *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-12-21 23:25:14 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    151151                         psStats* stats)
    152152{
     153
    153154    psS32 i = 0;                // Loop index variable
    154155    float mean = 0.0;           // The mean
     
    920921                    sumDiffs += diff;
    921922                    countInt++;
    922                     errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     923                    if (errors != NULL) {
     924                        errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     925                    }
    923926                }
    924927            }
     
    931934                    sumDiffs += diff;
    932935                    countInt++;
    933                     errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     936                    if (errors != NULL) {
     937                        errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     938                    }
    934939                }
    935940            }
     
    944949                    sumDiffs += diff;
    945950                    countInt++;
    946                     errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     951                    if (errors != NULL) {
     952                        errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     953                    }
    947954                }
    948955            }
     
    955962            }
    956963            countInt = myVector->n;
    957             errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     964            if (errors != NULL) {
     965                errorDivisor+= (1.0 / PS_SQR(errors->data.F32[i]));
     966            }
    958967        }
    959968    }
     
    19621971psVector* p_psConvertToF32(psVector* in)
    19631972{
     1973    if (in == NULL) {
     1974        return(NULL);
     1975    }
    19641976    psS32 i = 0;
    19651977    psVector* tmp = NULL;
  • trunk/psLib/test/dataManip/Makefile

    r2759 r2780  
    33##  Makefile:   test/sysUtils
    44##
    5 ##  $Revision: 1.53 $  $Name: not supported by cvs2svn $
    6 ##  $Date: 2004-12-20 19:33:53 $
     5##  $Revision: 1.54 $  $Name: not supported by cvs2svn $
     6##  $Date: 2004-12-21 23:24:49 $
    77##
    88##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5757tst_psStats08 \
    5858tst_psStats09 \
     59tst_psRandom \
    5960tst_psVectorFFT
    6061# tst_psFunc06 \
  • trunk/psLib/test/dataManip/tst_psHist02.c

    r2721 r2780  
    6666
    6767        myHist = psHistogramAlloc( LOWER, UPPER, numBins );
    68         myHist = psVectorHistogram( myHist, myData, NULL, 0 );
     68        myHist = psVectorHistogram( myHist, myData, NULL, NULL, 0 );
    6969
    7070        for ( i = 0;i < numBins;i++ ) {
     
    9191
    9292        myHist = psHistogramAlloc( LOWER, UPPER, numBins );
    93         myHist = psVectorHistogram( myHist, myData, myMask, 1 );
     93        myHist = psVectorHistogram( myHist, myData, NULL, myMask, 1 );
    9494
    9595        for ( i = 0;i < numBins;i++ ) {
     
    121121
    122122    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
    123     myHist2 = psVectorHistogram( NULL, myData, NULL, 0 );
     123    myHist2 = psVectorHistogram( NULL, myData, NULL, NULL, 0 );
    124124    if ( myHist2 != NULL ) {
    125125        printf( "ERROR: myHist2!=NULL\n" );
     
    136136    myHist = psHistogramAlloc( LOWER, UPPER, numBins );
    137137    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
    138     myHist = psVectorHistogram( myHist, NULL, NULL, 0 );
     138    myHist = psVectorHistogram( myHist, NULL, NULL, NULL, 0 );
    139139    if ( myHist == NULL ) {
    140140        printf( "ERROR: myHist==NULL\n" );
     
    155155    myData->n = myData->nalloc;
    156156    myHist = psHistogramAlloc(LOWER, UPPER, numBins);
    157     myHist = psVectorHistogram(myHist, NULL, NULL, 0);
     157    myHist = psVectorHistogram(myHist, NULL, NULL, NULL, 0);
    158158    if (myHist == NULL) {
    159159        printf("ERROR: myHist==NULL\n");
  • trunk/psLib/test/dataManip/tst_psHist03.c

    r2392 r2780  
    8989        }
    9090
    91         myHist = psVectorHistogram( myHist, myData, NULL, 0 );
     91        myHist = psVectorHistogram( myHist, myData, NULL, NULL, 0 );
    9292        for (i=0;i<numBins;i++) {
    9393            printf("Bin number %d bounds: (%6.3f - %6.3f): data: (%d)\n", i,
  • trunk/psLib/test/dataManip/tst_psStats00.c

    r2723 r2780  
    6363                            "PS_STAT_SAMPLE_MEAN: no vector mask");
    6464
    65     myStats = psVectorStats(myStats, myVector, NULL, 0);
     65    myStats = psVectorStats(myStats, myVector, NULL, NULL, 0);
    6666    mean = myStats->sampleMean;
    6767
     
    8686                            "PS_STAT_SAMPLE_MEAN: with vector mask=1");
    8787
    88     myStats = psVectorStats(myStats, myVector, maskVector, 1);
     88    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1);
    8989    mean = myStats->sampleMean;
    9090    printf("Called psVectorStats() on a vector with last N/2 elements masked.\n");
     
    117117    }
    118118
    119     myStats = psVectorStats(myStats, myVector, maskVector, 2);
     119    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 2);
    120120    mean = myStats->sampleMean;
    121121    printf("Called psVectorStats() on a vector with last N/2 elements masked.\n");
     
    148148    }
    149149
    150     myStats = psVectorStats(myStats, myVector, maskVector, 3);
     150    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 3);
    151151    mean = myStats->sampleMean;
    152152    printf("Called psVectorStats() on a vector with last N/2 elements masked.\n");
     
    173173
    174174    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
    175     if( psVectorStats(myStats, NULL, NULL, 0) != myStats ) {
     175    if( psVectorStats(myStats, NULL, NULL, NULL, 0) != myStats ) {
    176176        psError(PS_ERR_UNKNOWN,true,"psVectorStats did not return stats when input NULL");
    177177        return 10;
    178178    }
    179179    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message.");
    180     psStats *myStats2 = psVectorStats(NULL, myVector, NULL, 0);
     180    psStats *myStats2 = psVectorStats(NULL, myVector, NULL, NULL, 0);
    181181    if ( myStats2 != NULL ) {
    182182        psError(PS_ERR_UNKNOWN,true,"psVectorStats did not return NULL");
  • trunk/psLib/test/dataManip/tst_psStats01.c

    r2392 r2780  
    6161                            "PS_STAT_MAX: no vector mask");
    6262
    63     myStats = psVectorStats(myStats, myVector, NULL, 0);
     63    myStats = psVectorStats(myStats, myVector, NULL, NULL, 0);
    6464    max = myStats->max;
    6565
     
    8484                            "PS_STAT_MAX: with vector mask");
    8585
    86     myStats = psVectorStats(myStats, myVector, maskVector, 1);
     86    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1);
    8787    max = myStats->max;
    8888    printf("Called psVectorStats() on a vector with last N/2 elements masked.\n");
  • trunk/psLib/test/dataManip/tst_psStats02.c

    r2392 r2780  
    5959                            "PS_STAT_MIN: no vector mask");
    6060
    61     myStats = psVectorStats(myStats, myVector, NULL, 0);
     61    myStats = psVectorStats(myStats, myVector, NULL, NULL, 0);
    6262    min = myStats->min;
    6363
     
    8383                            "PS_STAT_MIN: with vector mask");
    8484
    85     myStats = psVectorStats(myStats, myVector, maskVector, 1);
     85    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1);
    8686    min = myStats->min;
    8787    printf("Called psVectorStats() on a vector with last N/2 elements masked.\n");
  • trunk/psLib/test/dataManip/tst_psStats03.c

    r2392 r2780  
    5353                            "PS_STAT_SAMPLE_MEDIAN: no vector mask");
    5454
    55     myStats = psVectorStats(myStats, myVector, NULL, 0);
     55    myStats = psVectorStats(myStats, myVector, NULL, NULL, 0);
    5656    median = myStats->sampleMedian;
    5757
     
    7878                            "PS_STAT_SAMPLE_MEDIAN: with vector mask");
    7979
    80     myStats = psVectorStats(myStats, myVector, maskVector, 1);
     80    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1);
    8181    median = myStats->sampleMedian;
    8282    printf("Called psVectorStats() on a vector with last N/2 elements masked.\n");
  • trunk/psLib/test/dataManip/tst_psStats06.c

    r2392 r2780  
    6262                            "PS_STAT_SAMPLE_STDEV: no vector mask");
    6363
    64     myStats = psVectorStats(myStats, myVector, NULL, 0);
     64    myStats = psVectorStats(myStats, myVector, NULL, NULL, 0);
    6565    stdev = myStats->sampleStdev;
    6666
     
    8686                            "PS_STAT_SAMPLE_STDEV: with vector mask");
    8787
    88     myStats = psVectorStats(myStats, myVector, maskVector, 1);
     88    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1);
    8989    stdev = myStats->sampleStdev;
    9090    printf("Called psVectorStats() on a vector with last N/2 elements masked.\n");
  • trunk/psLib/test/dataManip/tst_psStats07.c

    r2738 r2780  
    7272                             "PS_STAT_ROBUST_STATS: robust mean: no vector mask" );
    7373
    74     myStats = psVectorStats( myStats, myVector, NULL, 0 );
     74    myStats = psVectorStats( myStats, myVector, NULL, NULL, 0 );
    7575
    7676    printf( "The expected Mean was %.2f; the calculated Mean was %.2f\n",
     
    312312
    313313    printf( "Calling psVectorStats() on a vector with elements masked.\n" );
    314     myStats = psVectorStats( myStats, myVector, maskVector, 1 );
     314    myStats = psVectorStats( myStats, myVector, NULL, maskVector, 1 );
    315315    printf( "Called psVectorStats() on a vector with elements masked.\n" );
    316316    printf( "The expected Mean was %.2f; the calculated Mean was %.2f\n",
  • trunk/psLib/test/dataManip/tst_psStats08.c

    r2392 r2780  
    6363                            "PS_STAT_SAMPLE_LQ: no vector mask");
    6464
    65     myStats = psVectorStats(myStats, myVector, NULL, 0);
     65    myStats = psVectorStats(myStats, myVector, NULL, NULL, 0);
    6666
    6767    printf("Called psVectorStats() on a vector with no elements masked.\n");
     
    8585                            "PS_STAT_SAMPLE_UQ: no vector mask");
    8686
    87     myStats = psVectorStats(myStats, myVector, NULL, 0);
     87    myStats = psVectorStats(myStats, myVector, NULL, NULL, 0);
    8888
    8989    printf("Called psVectorStats() on a vector with no elements masked.\n");
     
    108108                            "PS_STAT_SAMPLE_LQ: with vector mask");
    109109
    110     myStats = psVectorStats(myStats, myVector, maskVector, 1);
     110    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1);
    111111
    112112    printf("Called psVectorStats() on a vector with elements masked.\n");
     
    130130                            "PS_STAT_SAMPLE_UQ: with vector mask");
    131131
    132     myStats = psVectorStats(myStats, myVector, maskVector, 1);
     132    myStats = psVectorStats(myStats, myVector, NULL, maskVector, 1);
    133133
    134134    printf("Called psVectorStats() on a vector with elements masked.\n");
  • trunk/psLib/test/dataManip/tst_psStats09.c

    r2392 r2780  
    6868                            "PS_STAT_CLIPPED_MEAN: no vector mask");
    6969
    70     myStats = psVectorStats(myStats, myGaussData, NULL, 0);
     70    myStats = psVectorStats(myStats, myGaussData, NULL, NULL, 0);
    7171
    7272    printf("Called psVectorStats() on a vector with no elements masked.\n");
     
    9999                            "PS_STAT_CLIPPED_MEAN: vector mask");
    100100
    101     myStats = psVectorStats(myStats, myGaussData, maskVector, 1);
     101    myStats = psVectorStats(myStats, myGaussData, NULL, maskVector, 1);
    102102
    103103    printf("Called psVectorStats() on a vector with elements masked.\n");
Note: See TracChangeset for help on using the changeset viewer.