IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1022


Ignore:
Timestamp:
Jun 14, 2004, 9:40:15 AM (22 years ago)
Author:
gusciora
Message:

...

Location:
trunk/psLib
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psFunctions.c

    r1020 r1022  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-06-14 19:32:42 $
     9 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-06-14 19:40:14 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7373 Gaussian distribution as well.
    7474 
    75  GUS: There is no way to seed the random generator.
     75 NOTE: There is no way to seed the random generator.
    7676 *****************************************************************************/
    7777psVector *psGaussianDev(float mean,
     
    9494    }
    9595
    96     // GUS: Should I free r as well?
     96    // NOTE: Should I free r as well?
    9797    return(gauss);
    9898}
     
    320320    float xSum = 1.0;
    321321
    322     // GUS: Do we want to flag this case?
     322    // NOTE: Do we want to flag this case?
    323323    if (myPoly->n == 0) {
    324324        return(1.0);
     
    646646    double xSum = 1.0;
    647647
    648     // GUS: Do we want to flag this case?
     648    // NOTE: Do we want to flag this case?
    649649    if (myPoly->n == 0) {
    650650        return(1.0);
  • trunk/psLib/src/dataManip/psMinimize.c

    r845 r1022  
    1515#include "float.h"
    1616#include <math.h>
    17 // GUS: rewrite so there is no maximum order for the polynomials.
     17// NOTE: rewrite so there is no maximum order for the polynomials.
    1818#define MAX_POLY_ORDER 10
    1919#define MAX_POLYNOMIAL_TERMS  (((MAX_POLY_ORDER+1) * (MAX_POLY_ORDER + 2)) / 2)
     
    243243        }
    244244        col[j] = 1.0;
    245         // GUS: substitue the LUD rotine
     245        // NOTE: substitue the LUD rotine
    246246        //        lubksb(A, N, indx, col);
    247247        for(i=1;i<=N;i++) {
  • trunk/psLib/src/dataManip/psStats.c

    r1020 r1022  
    9595    float binSize = 0.0;                // The histogram bin size
    9696
    97     // GUS: Verify that this is the correct action.
     97    // NOTE: Verify that this is the correct action.
    9898    if (n == 0) {
    9999        return(NULL);
    100100    }
    101101
    102     // GUS: Verify that this is the correct action.
     102    // NOTE: Verify that this is the correct action.
    103103    if (lower > upper) {
    104104        return(NULL);
     
    146146    int i;                              // Loop index variable
    147147
    148     // GUS: Verify that this is the correct action.
     148    // NOTE: Verify that this is the correct action.
    149149    if (bounds == NULL) {
    150150        //        psAbort(__func__, "psHistogram requested with NULL bounds");
     
    152152    }
    153153
    154     // GUS: Verify that this is the correct action.
     154    // NOTE: Verify that this is the correct action.
    155155    if (bounds->n <= 1) {
    156156        //        psAbort(__func__, "psHistogram requested with NULL bounds");
     
    215215    int numBins = 0;                            // The total number of bins
    216216
    217     // GUS: Verify that this is the correct action.
     217    // NOTE: Verify that this is the correct action.
    218218    if (out == NULL) {
    219219        return(NULL);
    220220    }
    221221
    222     // GUS: Verify that this is the correct action.
     222    // NOTE: Verify that this is the correct action.
    223223    if (in == NULL) {
    224224        return(out);
     
    240240        }
    241241    }
    242     // GUS: determine the correct action for a variety of other cases:
     242    // NOTE: determine the correct action for a variety of other cases:
    243243    // in vector has 0 elements, and histogram structure has zero bins.
    244244
     
    268268                    // bin number requires a bit more work.
    269269                } else {
    270                     // GUS: This is slow.  Put a smarter algorithm here to
     270                    // NOTE: This is slow.  Put a smarter algorithm here to
    271271                    // find the correct bin number (bin search, probably)
    272272                    for (j=0;j<(out->bounds->n)-1;j++) {
     
    841841    psVectorFree(unsortedVector);
    842842    psVectorFree(sortedVector);
    843     // GUS: This is the
     843    // NOTE: This is the
    844844}
    845845
     
    950950
    951951    // Fit a Gaussian to the bins in the range MODE-dL to Mode+dL
    952     // GUS: This step is dependent on the functions in psMinimize.c being
     952    // NOTE: This step is dependent on the functions in psMinimize.c being
    953953    // implemented.  Currently, they are not.
    954954
     
    11221122
    11231123    // 1. Compute the sample median.
    1124     // GUS: This seems odd.  Verify with IfA that we want to calculate the
     1124    // NOTE: This seems odd.  Verify with IfA that we want to calculate the
    11251125    // median here, not the mean.
    11261126    p_psVectorSampleMedian(myVector, maskVector, maskVal, stats);
     
    11981198                       unsigned int maskVal)
    11991199{
    1200     // GUS: Verify that this is the correct action.
     1200    // NOTE: Verify that this is the correct action.
    12011201    if (in == NULL) {
    12021202        return(stats);
     
    12371237
    12381238    // ************************************************************************
    1239     // GUS: The Stdev calculation requires the mean.  Should we assume the
     1239    // NOTE: The Stdev calculation requires the mean.  Should we assume the
    12401240    // mean has already been calculated?  Or should we always calculate it?
    12411241    if (stats->options & PS_STAT_SAMPLE_STDEV) {
  • trunk/psLib/src/image/psImageStats.c

    r896 r1022  
    1919/// This routine must determine the various statistics for the image.
    2020/*****************************************************************************
    21     GUS: verify that image/mask have the correct types, and sizes.
     21    NOTE: verify that image/mask have the correct types, and sizes.
    2222 *****************************************************************************/
    2323psStats *psImageStats(psStats *stats,
     
    3232    int j = 0;
    3333
    34     // GUS: Verify this action.
     34    // NOTE: Verify this action.
    3535    if ((stats == NULL) ||
    3636            (in == NULL)) {
    3737        return(NULL);
    3838    }
    39     // GUS: Verify this action.
     39    // NOTE: Verify this action.
    4040    if (stats->options == 0) {
    4141        return(stats);
     
    5252
    5353    if (mask != NULL) {
    54         // GUS: verify that mask data is PS_TYPE_U8.
    55         // GUS: figure out mask types
     54        // NOTE: verify that mask data is PS_TYPE_U8.
     55        // NOTE: figure out mask types
    5656
    5757        junkMask = psVectorAlloc(mask->numRows * mask->numCols,
    5858                                 mask->type.type);
    5959        junkMask->n = junkMask->nalloc;
    60         // GUS: Is there a more efficient way to do this?
     60        // NOTE: Is there a more efficient way to do this?
    6161        ptr=0;
    6262        for (i=0;i<mask->numRows;i++) {
     
    7878    NOTE: We assume that the psHistogram structure out has already been
    7979    allocated and initialized.
    80     GUS: verify that image/mask have the, correct types and  sizes.
     80    NOTE: verify that image/mask have the, correct types and  sizes.
    8181 *****************************************************************************/
    8282psHistogram *psImageHistogram(psHistogram *out,
     
    9191    int j = 0;
    9292
    93     // GUS: Verify this action.
     93    // NOTE: Verify this action.
    9494    if ((out == NULL) ||
    9595            (in == NULL)) {
     
    100100    junkData->n = junkData->nalloc;
    101101
    102     // GUS: Is there a more efficient way to do this?  memcopy() won't work.
     102    // NOTE: Is there a more efficient way to do this?  memcopy() won't work.
    103103    // Can we trick the junkData structure to use the image buffer, then
    104104    // untrick it before we deallocate it (so we won't deallocate that buffer
    105105    // twice?
    106106
    107     // GUS: Make sure you have the numRows/NumCols in the right place.
     107    // NOTE: Make sure you have the numRows/NumCols in the right place.
    108108    ptr=0;
    109109    for (i=0;i<in->numRows;i++) {
     
    114114
    115115    if (mask != NULL) {
    116         // GUS: verify that mask data is PS_TYPE_U8.
    117         // GUS: figure out mask types
     116        // NOTE: verify that mask data is PS_TYPE_U8.
     117        // NOTE: figure out mask types
    118118
    119119        junkMask = psVectorAlloc(mask->numRows * mask->numCols,
     
    121121        junkMask->n = junkMask->nalloc;
    122122
    123         // GUS: Is there a more efficient way to do this?
     123        // NOTE: Is there a more efficient way to do this?
    124124        ptr=0;
    125125        for (i=0;i<mask->numRows;i++) {
     
    137137    return(out);
    138138}
     139
     140float *p_psCalcScaleFactorsFit(int n)
     141{
     142    int i = 0;
     143    float tmp = 0.0;
     144    float *scalingFactors = (float *) psAlloc(n * sizeof(float));
     145
     146    for (i=0;i<n;i++) {
     147        //     ((2.0 * (float) i) / ((float) (n-1))) - 1.0;
     148        //        tmp = (float) (i + 1);
     149        tmp = (float) (n - i);
     150        tmp = (M_PI * (tmp - 0.5)) / ((float) n);
     151        scalingFactors[i] = cos(tmp);
     152    }
     153
     154    return(scalingFactors);
     155}
     156
     157float *p_psCalcScaleFactorsEval(int n)
     158{
     159    return p_psCalcScaleFactorsFit(n);
     160
     161    int i = 0;
     162    //    float tmp = 0.0;
     163    float *scalingFactors = (float *) psAlloc(n * sizeof(float));
     164    for (i=0;i<n;i++) {
     165        //          scalingFactors[i] = ((2.0 * (float) i) / ((float) (n-1))) - 1.0;
     166        tmp = (float) (i + 1);
     167        tmp = (M_PI * (tmp - 0.5)) / ((float) n);
     168        scalingFactors[i] = cos(tmp);
     169    }
     170    return(scalingFactors);
     171}
     172
     173psPolynomial1D **p_psCreateChebyshevPolys(int maxChebyPoly)
     174{
     175    psPolynomial1D **chebPolys = NULL;
     176    int i = 0;
     177    int j = 0;
     178
     179    chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly *
     180                                            sizeof(psPolynomial1D *));
     181    for (i=0;i<maxChebyPoly;i++) {
     182        chebPolys[i] = psPolynomial1DAlloc(i+1);
     183    }
     184
     185    // Create the Chebyshev polynomials.  Polynomial i has i-th order.
     186    chebPolys[0]->coeff[0] = 1;
     187    chebPolys[1]->coeff[1] = 1;
     188    for (i=2;i<maxChebyPoly;i++) {
     189        for (j=0;j<chebPolys[i-1]->n;j++) {
     190            chebPolys[i]->coeff[j+1] = 2 * chebPolys[i-1]->coeff[j];
     191        }
     192        for (j=0;j<chebPolys[i-2]->n;j++) {
     193            chebPolys[i]->coeff[j]-= chebPolys[i-2]->coeff[j];
     194        }
     195    }
     196
     197    return(chebPolys);
     198}
     199
    139200
    140201/*****************************************************************************
     
    146207    Output:
    147208    Internal Data Structures:
     209 
    148210 chebPolys[i][j]
    149         sums[i][j]
     211 
     212 sums[i][j]: This will contain the sum of
     213  input->data.F32[x][y] *
     214                psEvalPolynomial1D((float) x, chebPolys[i]) *
     215                psEvalPolynomial1D((float) y, chebPolys[j]);
     216      over all pixels (x,y) in the image.
     217 
     218 
    150219 *****************************************************************************/
    151220psPolynomial2D *
     
    153222                     psPolynomial2D *coeffs)
    154223{
     224    int k = 0;
     225    int l = 0;
    155226    int x = 0;
    156227    int y = 0;
     
    160231    psPolynomial1D **chebPolys = NULL;
    161232    int maxChebyPoly = 0;
    162 
     233    float *cScalingFactors = NULL;
     234    float *rScalingFactors = NULL;
     235    float tmp = 0.0;
    163236
    164237    // Create the sums[][] data structure.  This will hold the LHS of equation
    165238    // 29 in the ADD: sums[k][l] = SUM { image(x,y) * Tk(x) * Tl(y) }
    166 
    167239    sums = (float **) psAlloc(coeffs->nX * sizeof(float *));
    168240    for (i=0;i<coeffs->nX;i++) {
    169241        sums[i] = (float *) psAlloc(coeffs->nY * sizeof(float));
    170242    }
    171     for (i=0;i<coeffs->nX;i++) {
    172         for (j=0;j<coeffs->nY;j++) {
    173             sums[i][j] = 0.0;
    174         }
    175     }
     243
     244    // We scale the pixel positions to values between -1.0 and 1.0
     245    cScalingFactors = p_psCalcScaleFactorsFit(input->numRows);
     246    rScalingFactors = p_psCalcScaleFactorsFit(input->numCols);
    176247
    177248    // Determine how many Chebyshev polynomials are needed, then create them.
     
    180251        maxChebyPoly = coeffs->nY;
    181252    }
    182 
    183     chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly *
    184                                             sizeof(psPolynomial1D *));
    185     for (i=0;i<maxChebyPoly;i++) {
    186         chebPolys[i] = psPolynomial1DAlloc(i);
    187     }
    188 
    189     // Create the Chebyshev polynomials
    190     chebPolys[1]->coeff[0] = 1;
    191     for (i=2;i<maxChebyPoly;i++) {
    192         for (j=0;j<chebPolys[i-1]->n;j++) {
    193             chebPolys[i]->coeff[j+1] = 2 * chebPolys[i-1]->coeff[j];
    194         }
    195         for (j=0;j<chebPolys[i-2]->n;j++) {
    196             chebPolys[i]->coeff[j]-= chebPolys[i-2]->coeff[j];
    197         }
    198     }
    199 
    200     for (x=0;x<input->numRows;x++) {
    201         for (y=0;y<input->numCols;y++) {
    202             for (i=0;i<coeffs->nX;i++) {
    203                 for (j=0;j<coeffs->nY;j++) {
     253    chebPolys = p_psCreateChebyshevPolys(maxChebyPoly);
     254
     255    // Sanity check for the Chebyshevs
     256    for (i=0;i<coeffs->nX;i++) {
     257        for (j=0;j<coeffs->nY;j++) {
     258            tmp = 0.0;
     259            for (x=0;x<input->numRows;x++) {
     260                tmp+= psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     261                      psEvalPolynomial1D(rScalingFactors[x], chebPolys[j]);
     262
     263            }
     264        }
     265    }
     266
     267    for (i=0;i<coeffs->nX;i++) {
     268        for (j=0;j<coeffs->nY;j++) {
     269            sums[i][j] = 0.0;
     270            for (x=0;x<input->numRows;x++) {
     271                for (y=0;y<input->numCols;y++) {
    204272                    sums[i][j]+= input->data.F32[x][y] *
    205                                  psEvalPolynomial1D((float) x, chebPolys[i]) *
    206                                  psEvalPolynomial1D((float) y, chebPolys[j]);
    207 
     273                                 psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     274                                 psEvalPolynomial1D(cScalingFactors[y], chebPolys[j]);
    208275                }
    209276            }
     
    211278    }
    212279
    213     // GUS: Check the math on this at a later date.
    214     coeffs->coeff[0][0] = sums[0][0] / (coeffs->nX * coeffs->nY);
    215     for (i=0;i<coeffs->nX;i++) {
    216         coeffs->coeff[i][0] = 0.5 *
    217                               ((sums[i][0] * 4.0) / (coeffs->nX * coeffs->nY)) -
    218                               (2.0 * coeffs->coeff[0][0]);
     280    // NOTE: Check the math on this at a later date.
     281    coeffs->coeff[0][0] = sums[0][0] / ((float) (coeffs->nX * coeffs->nY));
     282    for (i=0;i<coeffs->nX;i++) {
     283        coeffs->coeff[i][0] = ((sums[i][0] * 2.0) /
     284                               ((float) (coeffs->nX * coeffs->nY))) -
     285                              coeffs->coeff[0][0];
    219286    }
    220287    for (j=0;j<coeffs->nY;j++) {
    221         coeffs->coeff[0][j] = 0.5 *
    222                               ((sums[0][j] * 4.0) / (coeffs->nX * coeffs->nY)) -
    223                               (2.0 * coeffs->coeff[0][0]);
     288        coeffs->coeff[0][j] =
     289            ((sums[0][j] * 2.0) /
     290             ((float) (coeffs->nX * coeffs->nY))) -
     291            coeffs->coeff[0][0];
    224292    }
    225293    for (i=1;i<coeffs->nX;i++) {
    226294        for (j=1;j<coeffs->nY;j++) {
    227295            coeffs->coeff[i][j] =
    228                 (sums[i][0] * 4.0) / (coeffs->nX * coeffs->nY) -
    229                 coeffs->coeff[0][0] -
    230                 coeffs->coeff[i][0] -
    231                 coeffs->coeff[0][j];
    232         }
    233     }
     296                ((sums[i][0] * 4.0) / ((float) (coeffs->nX * coeffs->nY))) -
     297                (coeffs->coeff[0][0] +
     298                 coeffs->coeff[i][0] +
     299                 coeffs->coeff[0][j]);
     300        }
     301    }
     302
     303    for (k=0;k<coeffs->nX;k++) {
     304        for (l=0;l<coeffs->nY;l++) {
     305            tmp = 0.0;
     306            for (i=0;i<coeffs->nX;i++) {
     307                for (j=0;j<coeffs->nY;j++) {
     308                    for (x=0;x<input->numRows;x++) {
     309                        for (y=0;y<input->numCols;y++) {
     310                            tmp+= (coeffs->coeff[i][j] *
     311                                   psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     312                                   psEvalPolynomial1D(rScalingFactors[y], chebPolys[j]) *
     313                                   psEvalPolynomial1D(rScalingFactors[x], chebPolys[k]) *
     314                                   psEvalPolynomial1D(rScalingFactors[y], chebPolys[l]));
     315
     316                        }
     317                    }
     318                }
     319            }
     320        }
     321    }
     322
    234323
    235324    // Free the Chebyshev polynomials that were created in this routine.
     
    244333    }
    245334    psFree(sums);
     335    psFree(cScalingFactors);
     336    psFree(rScalingFactors);
    246337
    247338    return(coeffs);
     
    255346                      const psPolynomial2D *coeffs)
    256347{
    257     int i = 0;
    258     int j = 0;
    259348    int x = 0;
    260349    int y = 0;
     350    int i = 0;
     351    int j = 0;
    261352    float **sums = NULL;
    262353    psPolynomial1D **chebPolys = NULL;
    263354    int maxChebyPoly = 0;
     355    float *cScalingFactors = NULL;
     356    float *rScalingFactors = NULL;
    264357    float polySum = 0.0;
    265358
     
    275368        }
    276369    }
     370
     371    // We scale the pixel positions to values between -1.0 and 1.0
     372    cScalingFactors = p_psCalcScaleFactorsEval(input->numRows);
     373    rScalingFactors = p_psCalcScaleFactorsEval(input->numCols);
    277374
    278375    // Determine how many Chebyshev polynomials are needed, then create them.
     
    282379    }
    283380
    284     chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly *
    285                                             sizeof(psPolynomial1D *));
    286     for (i=0;i<maxChebyPoly;i++) {
    287         chebPolys[i] = psPolynomial1DAlloc(i);
    288     }
    289 
    290     // Create the Chebyshev polynomials
    291     chebPolys[1]->coeff[0] = 1;
    292     for (i=2;i<maxChebyPoly;i++) {
    293         for (j=0;j<chebPolys[i-1]->n;j++) {
    294             chebPolys[i]->coeff[j+1] = 2 * chebPolys[i-1]->coeff[j];
    295         }
    296         for (j=0;j<chebPolys[i-2]->n;j++) {
    297             chebPolys[i]->coeff[j]-= chebPolys[i-2]->coeff[j];
    298         }
    299     }
     381    chebPolys = p_psCreateChebyshevPolys(maxChebyPoly);
    300382
    301383    for (x=0;x<input->numRows;x++) {
     
    304386            for (i=0;i<coeffs->nX;i++) {
    305387                for (j=0;j<coeffs->nY;j++) {
    306                     polySum+= psEvalPolynomial1D((float)x, chebPolys[i]) *
    307                               psEvalPolynomial1D((float)y, chebPolys[j]) *
     388                    polySum+= psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     389                              psEvalPolynomial1D(cScalingFactors[y], chebPolys[j]) *
    308390                              coeffs->coeff[i][j];
     391
    309392                }
    310393            }
     
    324407    }
    325408    psFree(sums);
     409    psFree(cScalingFactors);
     410    psFree(rScalingFactors);
    326411
    327412    return(0);
  • trunk/psLib/src/image/psImageStats.h

    r797 r1022  
     1/** @file psImageStats.h
     2 *  \brief Routines for calculating statistics on images.
     3 *  \ingroup Stats
     4 *  @ingroup Stats
     5 *
     6 *  This file will hold the prototypes for procedures which calculate
     7 *  statistic on images, histograms on images, and fit/evaluate Chebyshev
     8 *  polynomials to images.
     9 *
     10 *  @author George Gusciora, MHPCC
     11 *
     12 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-06-14 19:40:14 $
     14 *
     15 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     16 */
    117#if !defined(PS_IMAGE_STATS_H)
    218#define PS_IMAGE_STATS_H
     19
     20
    321#include "psVector.h"
    422#include "psImage.h"
  • trunk/psLib/src/imageops/psImageStats.c

    r896 r1022  
    1919/// This routine must determine the various statistics for the image.
    2020/*****************************************************************************
    21     GUS: verify that image/mask have the correct types, and sizes.
     21    NOTE: verify that image/mask have the correct types, and sizes.
    2222 *****************************************************************************/
    2323psStats *psImageStats(psStats *stats,
     
    3232    int j = 0;
    3333
    34     // GUS: Verify this action.
     34    // NOTE: Verify this action.
    3535    if ((stats == NULL) ||
    3636            (in == NULL)) {
    3737        return(NULL);
    3838    }
    39     // GUS: Verify this action.
     39    // NOTE: Verify this action.
    4040    if (stats->options == 0) {
    4141        return(stats);
     
    5252
    5353    if (mask != NULL) {
    54         // GUS: verify that mask data is PS_TYPE_U8.
    55         // GUS: figure out mask types
     54        // NOTE: verify that mask data is PS_TYPE_U8.
     55        // NOTE: figure out mask types
    5656
    5757        junkMask = psVectorAlloc(mask->numRows * mask->numCols,
    5858                                 mask->type.type);
    5959        junkMask->n = junkMask->nalloc;
    60         // GUS: Is there a more efficient way to do this?
     60        // NOTE: Is there a more efficient way to do this?
    6161        ptr=0;
    6262        for (i=0;i<mask->numRows;i++) {
     
    7878    NOTE: We assume that the psHistogram structure out has already been
    7979    allocated and initialized.
    80     GUS: verify that image/mask have the, correct types and  sizes.
     80    NOTE: verify that image/mask have the, correct types and  sizes.
    8181 *****************************************************************************/
    8282psHistogram *psImageHistogram(psHistogram *out,
     
    9191    int j = 0;
    9292
    93     // GUS: Verify this action.
     93    // NOTE: Verify this action.
    9494    if ((out == NULL) ||
    9595            (in == NULL)) {
     
    100100    junkData->n = junkData->nalloc;
    101101
    102     // GUS: Is there a more efficient way to do this?  memcopy() won't work.
     102    // NOTE: Is there a more efficient way to do this?  memcopy() won't work.
    103103    // Can we trick the junkData structure to use the image buffer, then
    104104    // untrick it before we deallocate it (so we won't deallocate that buffer
    105105    // twice?
    106106
    107     // GUS: Make sure you have the numRows/NumCols in the right place.
     107    // NOTE: Make sure you have the numRows/NumCols in the right place.
    108108    ptr=0;
    109109    for (i=0;i<in->numRows;i++) {
     
    114114
    115115    if (mask != NULL) {
    116         // GUS: verify that mask data is PS_TYPE_U8.
    117         // GUS: figure out mask types
     116        // NOTE: verify that mask data is PS_TYPE_U8.
     117        // NOTE: figure out mask types
    118118
    119119        junkMask = psVectorAlloc(mask->numRows * mask->numCols,
     
    121121        junkMask->n = junkMask->nalloc;
    122122
    123         // GUS: Is there a more efficient way to do this?
     123        // NOTE: Is there a more efficient way to do this?
    124124        ptr=0;
    125125        for (i=0;i<mask->numRows;i++) {
     
    137137    return(out);
    138138}
     139
     140float *p_psCalcScaleFactorsFit(int n)
     141{
     142    int i = 0;
     143    float tmp = 0.0;
     144    float *scalingFactors = (float *) psAlloc(n * sizeof(float));
     145
     146    for (i=0;i<n;i++) {
     147        //     ((2.0 * (float) i) / ((float) (n-1))) - 1.0;
     148        //        tmp = (float) (i + 1);
     149        tmp = (float) (n - i);
     150        tmp = (M_PI * (tmp - 0.5)) / ((float) n);
     151        scalingFactors[i] = cos(tmp);
     152    }
     153
     154    return(scalingFactors);
     155}
     156
     157float *p_psCalcScaleFactorsEval(int n)
     158{
     159    return p_psCalcScaleFactorsFit(n);
     160
     161    int i = 0;
     162    //    float tmp = 0.0;
     163    float *scalingFactors = (float *) psAlloc(n * sizeof(float));
     164    for (i=0;i<n;i++) {
     165        //          scalingFactors[i] = ((2.0 * (float) i) / ((float) (n-1))) - 1.0;
     166        tmp = (float) (i + 1);
     167        tmp = (M_PI * (tmp - 0.5)) / ((float) n);
     168        scalingFactors[i] = cos(tmp);
     169    }
     170    return(scalingFactors);
     171}
     172
     173psPolynomial1D **p_psCreateChebyshevPolys(int maxChebyPoly)
     174{
     175    psPolynomial1D **chebPolys = NULL;
     176    int i = 0;
     177    int j = 0;
     178
     179    chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly *
     180                                            sizeof(psPolynomial1D *));
     181    for (i=0;i<maxChebyPoly;i++) {
     182        chebPolys[i] = psPolynomial1DAlloc(i+1);
     183    }
     184
     185    // Create the Chebyshev polynomials.  Polynomial i has i-th order.
     186    chebPolys[0]->coeff[0] = 1;
     187    chebPolys[1]->coeff[1] = 1;
     188    for (i=2;i<maxChebyPoly;i++) {
     189        for (j=0;j<chebPolys[i-1]->n;j++) {
     190            chebPolys[i]->coeff[j+1] = 2 * chebPolys[i-1]->coeff[j];
     191        }
     192        for (j=0;j<chebPolys[i-2]->n;j++) {
     193            chebPolys[i]->coeff[j]-= chebPolys[i-2]->coeff[j];
     194        }
     195    }
     196
     197    return(chebPolys);
     198}
     199
    139200
    140201/*****************************************************************************
     
    146207    Output:
    147208    Internal Data Structures:
     209 
    148210 chebPolys[i][j]
    149         sums[i][j]
     211 
     212 sums[i][j]: This will contain the sum of
     213  input->data.F32[x][y] *
     214                psEvalPolynomial1D((float) x, chebPolys[i]) *
     215                psEvalPolynomial1D((float) y, chebPolys[j]);
     216      over all pixels (x,y) in the image.
     217 
     218 
    150219 *****************************************************************************/
    151220psPolynomial2D *
     
    153222                     psPolynomial2D *coeffs)
    154223{
     224    int k = 0;
     225    int l = 0;
    155226    int x = 0;
    156227    int y = 0;
     
    160231    psPolynomial1D **chebPolys = NULL;
    161232    int maxChebyPoly = 0;
    162 
     233    float *cScalingFactors = NULL;
     234    float *rScalingFactors = NULL;
     235    float tmp = 0.0;
    163236
    164237    // Create the sums[][] data structure.  This will hold the LHS of equation
    165238    // 29 in the ADD: sums[k][l] = SUM { image(x,y) * Tk(x) * Tl(y) }
    166 
    167239    sums = (float **) psAlloc(coeffs->nX * sizeof(float *));
    168240    for (i=0;i<coeffs->nX;i++) {
    169241        sums[i] = (float *) psAlloc(coeffs->nY * sizeof(float));
    170242    }
    171     for (i=0;i<coeffs->nX;i++) {
    172         for (j=0;j<coeffs->nY;j++) {
    173             sums[i][j] = 0.0;
    174         }
    175     }
     243
     244    // We scale the pixel positions to values between -1.0 and 1.0
     245    cScalingFactors = p_psCalcScaleFactorsFit(input->numRows);
     246    rScalingFactors = p_psCalcScaleFactorsFit(input->numCols);
    176247
    177248    // Determine how many Chebyshev polynomials are needed, then create them.
     
    180251        maxChebyPoly = coeffs->nY;
    181252    }
    182 
    183     chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly *
    184                                             sizeof(psPolynomial1D *));
    185     for (i=0;i<maxChebyPoly;i++) {
    186         chebPolys[i] = psPolynomial1DAlloc(i);
    187     }
    188 
    189     // Create the Chebyshev polynomials
    190     chebPolys[1]->coeff[0] = 1;
    191     for (i=2;i<maxChebyPoly;i++) {
    192         for (j=0;j<chebPolys[i-1]->n;j++) {
    193             chebPolys[i]->coeff[j+1] = 2 * chebPolys[i-1]->coeff[j];
    194         }
    195         for (j=0;j<chebPolys[i-2]->n;j++) {
    196             chebPolys[i]->coeff[j]-= chebPolys[i-2]->coeff[j];
    197         }
    198     }
    199 
    200     for (x=0;x<input->numRows;x++) {
    201         for (y=0;y<input->numCols;y++) {
    202             for (i=0;i<coeffs->nX;i++) {
    203                 for (j=0;j<coeffs->nY;j++) {
     253    chebPolys = p_psCreateChebyshevPolys(maxChebyPoly);
     254
     255    // Sanity check for the Chebyshevs
     256    for (i=0;i<coeffs->nX;i++) {
     257        for (j=0;j<coeffs->nY;j++) {
     258            tmp = 0.0;
     259            for (x=0;x<input->numRows;x++) {
     260                tmp+= psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     261                      psEvalPolynomial1D(rScalingFactors[x], chebPolys[j]);
     262
     263            }
     264        }
     265    }
     266
     267    for (i=0;i<coeffs->nX;i++) {
     268        for (j=0;j<coeffs->nY;j++) {
     269            sums[i][j] = 0.0;
     270            for (x=0;x<input->numRows;x++) {
     271                for (y=0;y<input->numCols;y++) {
    204272                    sums[i][j]+= input->data.F32[x][y] *
    205                                  psEvalPolynomial1D((float) x, chebPolys[i]) *
    206                                  psEvalPolynomial1D((float) y, chebPolys[j]);
    207 
     273                                 psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     274                                 psEvalPolynomial1D(cScalingFactors[y], chebPolys[j]);
    208275                }
    209276            }
     
    211278    }
    212279
    213     // GUS: Check the math on this at a later date.
    214     coeffs->coeff[0][0] = sums[0][0] / (coeffs->nX * coeffs->nY);
    215     for (i=0;i<coeffs->nX;i++) {
    216         coeffs->coeff[i][0] = 0.5 *
    217                               ((sums[i][0] * 4.0) / (coeffs->nX * coeffs->nY)) -
    218                               (2.0 * coeffs->coeff[0][0]);
     280    // NOTE: Check the math on this at a later date.
     281    coeffs->coeff[0][0] = sums[0][0] / ((float) (coeffs->nX * coeffs->nY));
     282    for (i=0;i<coeffs->nX;i++) {
     283        coeffs->coeff[i][0] = ((sums[i][0] * 2.0) /
     284                               ((float) (coeffs->nX * coeffs->nY))) -
     285                              coeffs->coeff[0][0];
    219286    }
    220287    for (j=0;j<coeffs->nY;j++) {
    221         coeffs->coeff[0][j] = 0.5 *
    222                               ((sums[0][j] * 4.0) / (coeffs->nX * coeffs->nY)) -
    223                               (2.0 * coeffs->coeff[0][0]);
     288        coeffs->coeff[0][j] =
     289            ((sums[0][j] * 2.0) /
     290             ((float) (coeffs->nX * coeffs->nY))) -
     291            coeffs->coeff[0][0];
    224292    }
    225293    for (i=1;i<coeffs->nX;i++) {
    226294        for (j=1;j<coeffs->nY;j++) {
    227295            coeffs->coeff[i][j] =
    228                 (sums[i][0] * 4.0) / (coeffs->nX * coeffs->nY) -
    229                 coeffs->coeff[0][0] -
    230                 coeffs->coeff[i][0] -
    231                 coeffs->coeff[0][j];
    232         }
    233     }
     296                ((sums[i][0] * 4.0) / ((float) (coeffs->nX * coeffs->nY))) -
     297                (coeffs->coeff[0][0] +
     298                 coeffs->coeff[i][0] +
     299                 coeffs->coeff[0][j]);
     300        }
     301    }
     302
     303    for (k=0;k<coeffs->nX;k++) {
     304        for (l=0;l<coeffs->nY;l++) {
     305            tmp = 0.0;
     306            for (i=0;i<coeffs->nX;i++) {
     307                for (j=0;j<coeffs->nY;j++) {
     308                    for (x=0;x<input->numRows;x++) {
     309                        for (y=0;y<input->numCols;y++) {
     310                            tmp+= (coeffs->coeff[i][j] *
     311                                   psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     312                                   psEvalPolynomial1D(rScalingFactors[y], chebPolys[j]) *
     313                                   psEvalPolynomial1D(rScalingFactors[x], chebPolys[k]) *
     314                                   psEvalPolynomial1D(rScalingFactors[y], chebPolys[l]));
     315
     316                        }
     317                    }
     318                }
     319            }
     320        }
     321    }
     322
    234323
    235324    // Free the Chebyshev polynomials that were created in this routine.
     
    244333    }
    245334    psFree(sums);
     335    psFree(cScalingFactors);
     336    psFree(rScalingFactors);
    246337
    247338    return(coeffs);
     
    255346                      const psPolynomial2D *coeffs)
    256347{
    257     int i = 0;
    258     int j = 0;
    259348    int x = 0;
    260349    int y = 0;
     350    int i = 0;
     351    int j = 0;
    261352    float **sums = NULL;
    262353    psPolynomial1D **chebPolys = NULL;
    263354    int maxChebyPoly = 0;
     355    float *cScalingFactors = NULL;
     356    float *rScalingFactors = NULL;
    264357    float polySum = 0.0;
    265358
     
    275368        }
    276369    }
     370
     371    // We scale the pixel positions to values between -1.0 and 1.0
     372    cScalingFactors = p_psCalcScaleFactorsEval(input->numRows);
     373    rScalingFactors = p_psCalcScaleFactorsEval(input->numCols);
    277374
    278375    // Determine how many Chebyshev polynomials are needed, then create them.
     
    282379    }
    283380
    284     chebPolys = (psPolynomial1D **) psAlloc(maxChebyPoly *
    285                                             sizeof(psPolynomial1D *));
    286     for (i=0;i<maxChebyPoly;i++) {
    287         chebPolys[i] = psPolynomial1DAlloc(i);
    288     }
    289 
    290     // Create the Chebyshev polynomials
    291     chebPolys[1]->coeff[0] = 1;
    292     for (i=2;i<maxChebyPoly;i++) {
    293         for (j=0;j<chebPolys[i-1]->n;j++) {
    294             chebPolys[i]->coeff[j+1] = 2 * chebPolys[i-1]->coeff[j];
    295         }
    296         for (j=0;j<chebPolys[i-2]->n;j++) {
    297             chebPolys[i]->coeff[j]-= chebPolys[i-2]->coeff[j];
    298         }
    299     }
     381    chebPolys = p_psCreateChebyshevPolys(maxChebyPoly);
    300382
    301383    for (x=0;x<input->numRows;x++) {
     
    304386            for (i=0;i<coeffs->nX;i++) {
    305387                for (j=0;j<coeffs->nY;j++) {
    306                     polySum+= psEvalPolynomial1D((float)x, chebPolys[i]) *
    307                               psEvalPolynomial1D((float)y, chebPolys[j]) *
     388                    polySum+= psEvalPolynomial1D(rScalingFactors[x], chebPolys[i]) *
     389                              psEvalPolynomial1D(cScalingFactors[y], chebPolys[j]) *
    308390                              coeffs->coeff[i][j];
     391
    309392                }
    310393            }
     
    324407    }
    325408    psFree(sums);
     409    psFree(cScalingFactors);
     410    psFree(rScalingFactors);
    326411
    327412    return(0);
  • trunk/psLib/src/imageops/psImageStats.h

    r797 r1022  
     1/** @file psImageStats.h
     2 *  \brief Routines for calculating statistics on images.
     3 *  \ingroup Stats
     4 *  @ingroup Stats
     5 *
     6 *  This file will hold the prototypes for procedures which calculate
     7 *  statistic on images, histograms on images, and fit/evaluate Chebyshev
     8 *  polynomials to images.
     9 *
     10 *  @author George Gusciora, MHPCC
     11 *
     12 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-06-14 19:40:14 $
     14 *
     15 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     16 */
    117#if !defined(PS_IMAGE_STATS_H)
    218#define PS_IMAGE_STATS_H
     19
     20
    321#include "psVector.h"
    422#include "psImage.h"
  • trunk/psLib/src/math/psMinimize.c

    r845 r1022  
    1515#include "float.h"
    1616#include <math.h>
    17 // GUS: rewrite so there is no maximum order for the polynomials.
     17// NOTE: rewrite so there is no maximum order for the polynomials.
    1818#define MAX_POLY_ORDER 10
    1919#define MAX_POLYNOMIAL_TERMS  (((MAX_POLY_ORDER+1) * (MAX_POLY_ORDER + 2)) / 2)
     
    243243        }
    244244        col[j] = 1.0;
    245         // GUS: substitue the LUD rotine
     245        // NOTE: substitue the LUD rotine
    246246        //        lubksb(A, N, indx, col);
    247247        for(i=1;i<=N;i++) {
  • trunk/psLib/src/math/psPolynomial.c

    r1020 r1022  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-06-14 19:32:42 $
     9 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-06-14 19:40:14 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7373 Gaussian distribution as well.
    7474 
    75  GUS: There is no way to seed the random generator.
     75 NOTE: There is no way to seed the random generator.
    7676 *****************************************************************************/
    7777psVector *psGaussianDev(float mean,
     
    9494    }
    9595
    96     // GUS: Should I free r as well?
     96    // NOTE: Should I free r as well?
    9797    return(gauss);
    9898}
     
    320320    float xSum = 1.0;
    321321
    322     // GUS: Do we want to flag this case?
     322    // NOTE: Do we want to flag this case?
    323323    if (myPoly->n == 0) {
    324324        return(1.0);
     
    646646    double xSum = 1.0;
    647647
    648     // GUS: Do we want to flag this case?
     648    // NOTE: Do we want to flag this case?
    649649    if (myPoly->n == 0) {
    650650        return(1.0);
  • trunk/psLib/src/math/psSpline.c

    r1020 r1022  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2004-06-14 19:32:42 $
     9 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2004-06-14 19:40:14 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7373 Gaussian distribution as well.
    7474 
    75  GUS: There is no way to seed the random generator.
     75 NOTE: There is no way to seed the random generator.
    7676 *****************************************************************************/
    7777psVector *psGaussianDev(float mean,
     
    9494    }
    9595
    96     // GUS: Should I free r as well?
     96    // NOTE: Should I free r as well?
    9797    return(gauss);
    9898}
     
    320320    float xSum = 1.0;
    321321
    322     // GUS: Do we want to flag this case?
     322    // NOTE: Do we want to flag this case?
    323323    if (myPoly->n == 0) {
    324324        return(1.0);
     
    646646    double xSum = 1.0;
    647647
    648     // GUS: Do we want to flag this case?
     648    // NOTE: Do we want to flag this case?
    649649    if (myPoly->n == 0) {
    650650        return(1.0);
  • trunk/psLib/src/math/psStats.c

    r1020 r1022  
    9595    float binSize = 0.0;                // The histogram bin size
    9696
    97     // GUS: Verify that this is the correct action.
     97    // NOTE: Verify that this is the correct action.
    9898    if (n == 0) {
    9999        return(NULL);
    100100    }
    101101
    102     // GUS: Verify that this is the correct action.
     102    // NOTE: Verify that this is the correct action.
    103103    if (lower > upper) {
    104104        return(NULL);
     
    146146    int i;                              // Loop index variable
    147147
    148     // GUS: Verify that this is the correct action.
     148    // NOTE: Verify that this is the correct action.
    149149    if (bounds == NULL) {
    150150        //        psAbort(__func__, "psHistogram requested with NULL bounds");
     
    152152    }
    153153
    154     // GUS: Verify that this is the correct action.
     154    // NOTE: Verify that this is the correct action.
    155155    if (bounds->n <= 1) {
    156156        //        psAbort(__func__, "psHistogram requested with NULL bounds");
     
    215215    int numBins = 0;                            // The total number of bins
    216216
    217     // GUS: Verify that this is the correct action.
     217    // NOTE: Verify that this is the correct action.
    218218    if (out == NULL) {
    219219        return(NULL);
    220220    }
    221221
    222     // GUS: Verify that this is the correct action.
     222    // NOTE: Verify that this is the correct action.
    223223    if (in == NULL) {
    224224        return(out);
     
    240240        }
    241241    }
    242     // GUS: determine the correct action for a variety of other cases:
     242    // NOTE: determine the correct action for a variety of other cases:
    243243    // in vector has 0 elements, and histogram structure has zero bins.
    244244
     
    268268                    // bin number requires a bit more work.
    269269                } else {
    270                     // GUS: This is slow.  Put a smarter algorithm here to
     270                    // NOTE: This is slow.  Put a smarter algorithm here to
    271271                    // find the correct bin number (bin search, probably)
    272272                    for (j=0;j<(out->bounds->n)-1;j++) {
     
    841841    psVectorFree(unsortedVector);
    842842    psVectorFree(sortedVector);
    843     // GUS: This is the
     843    // NOTE: This is the
    844844}
    845845
     
    950950
    951951    // Fit a Gaussian to the bins in the range MODE-dL to Mode+dL
    952     // GUS: This step is dependent on the functions in psMinimize.c being
     952    // NOTE: This step is dependent on the functions in psMinimize.c being
    953953    // implemented.  Currently, they are not.
    954954
     
    11221122
    11231123    // 1. Compute the sample median.
    1124     // GUS: This seems odd.  Verify with IfA that we want to calculate the
     1124    // NOTE: This seems odd.  Verify with IfA that we want to calculate the
    11251125    // median here, not the mean.
    11261126    p_psVectorSampleMedian(myVector, maskVector, maskVal, stats);
     
    11981198                       unsigned int maskVal)
    11991199{
    1200     // GUS: Verify that this is the correct action.
     1200    // NOTE: Verify that this is the correct action.
    12011201    if (in == NULL) {
    12021202        return(stats);
     
    12371237
    12381238    // ************************************************************************
    1239     // GUS: The Stdev calculation requires the mean.  Should we assume the
     1239    // NOTE: The Stdev calculation requires the mean.  Should we assume the
    12401240    // mean has already been calculated?  Or should we always calculate it?
    12411241    if (stats->options & PS_STAT_SAMPLE_STDEV) {
  • trunk/psLib/src/sys/psLogMsg.c

    r1013 r1022  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-06-12 05:50:01 $
     13 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-06-14 19:40:15 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    105105
    106106    default:
    107         // GUS: Should you log this error properly?
     107        // NOTE: Should you log this error properly?
    108108        fprintf(stderr,"Unknown p_psGlobalLogDest: %d (ignored)\n", dest);
    109109        break;
  • trunk/psLib/src/sysUtils/psLogMsg.c

    r1013 r1022  
    1111 *  @author George Gusciora, MHPCC
    1212 *
    13  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-06-12 05:50:01 $
     13 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-06-14 19:40:15 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    105105
    106106    default:
    107         // GUS: Should you log this error properly?
     107        // NOTE: Should you log this error properly?
    108108        fprintf(stderr,"Unknown p_psGlobalLogDest: %d (ignored)\n", dest);
    109109        break;
  • trunk/psLib/test/image/tst_psImageStats02.c

    r887 r1022  
    44    thouroughly tested elsewhere, we will only test psImageStats() with
    55    the PS_STAT_SAMPLE_MEAN here.
     6 
     7    NOTE: After you debug, set CHEBY_X_DIM != CHEBY_Y_DIM.
     8    Also, uses non-square images.
    69 *****************************************************************************/
    710#include <stdio.h>
     
    1114#include "psImage.h"
    1215#include "psImageStats.h"
    13 #define NUM_BINS 20
    14 #define IMAGE_SIZE 10
    15 #define CHEBY_X_DIM 5
     16#define IMAGE_SIZE 3
     17#define CHEBY_X_DIM 3
    1618#define CHEBY_Y_DIM 3
    1719
     
    3840        for (j=0;j<IMAGE_SIZE;j++) {
    3941            tmpImage->data.F32[i][j] = (float) (i + j);
     42            tmpImage->data.F32[i][j] = 4.0;
    4043            outImage->data.F32[i][j] = 0.0;
    41         }
    42     }
    43     for (i=0;i<IMAGE_SIZE;i++) {
    44         for (j=0;j<IMAGE_SIZE;j++) {
    45             printf("(%f, %f)\n", tmpImage->data.F32[i][j],
    46                    outImage->data.F32[i][j]);
    4744        }
    4845    }
     
    7269    for (i=0;i<IMAGE_SIZE;i++) {
    7370        for (j=0;j<IMAGE_SIZE;j++) {
    74             printf("(%f, %f)\n", tmpImage->data.F32[i][j],
     71            printf("pixel[%d][%d] is (%f, %f)\n", i, j,
     72                   tmpImage->data.F32[i][j],
    7573                   outImage->data.F32[i][j]);
    7674        }
  • trunk/psLib/test/sysUtils/tst_psHash02.c

    r892 r1022  
    33    and retrieved correctly.
    44 
    5     GUS: Add code to test whether duplicates are handled correctly (use a
     5    NOTE: Add code to test whether duplicates are handled correctly (use a
    66    small hash table and lots of keys).
    77 *****************************************************************************/
  • trunk/psLib/test/sysUtils/tst_psHash03.c

    r892 r1022  
    22    This code will test whether hash tables entries can be removed correctly.
    33 
    4     GUS: Add code to test whether duplicates are handled correctly.
     4    NOTE: Add code to test whether duplicates are handled correctly.
    55 *****************************************************************************/
    66#include <stdio.h>
     
    102102    while (myKeys[i] != NULL) {
    103103        id = psHashRemove(myHashTable, myKeys[i], (void (*)(void *))IdFree);
    104         // GUS: The psHashRemove() procedure removes the entry from the hash
     104        // The psHashRemove() procedure removes the entry from the hash
    105105        // table, but does not delete the data.  The following is necessary
    106106        // to delete the data as well (which is returned from the call).
  • trunk/psLib/test/sysUtils/tst_psLogMsg02.c

    r963 r1022  
    6767                testStatus);
    6868
     69
     70
     71
     72    printPositiveTestHeader(stdout,
     73                            "psLogMsg functions",
     74                            "Output Format");
     75
     76    psLogMsg("Under 15 chars", 0, "Hello World!\n");
     77    psLogMsg("This string is more than 15 chars", 0, "Hello World!\n");
     78    psLogMsg(__func__, 0, "Line #1\n");
     79    psLogMsg(__func__, 0, "Line #2\n");
     80    psLogMsg(__func__, 0, "Line #3");
     81    psLogMsg(__func__, 0, "Line #4");
     82
     83    printFooter(stdout,
     84                "psLogMsg functions",
     85                "Output Format",
     86                testStatus);
     87
     88
    6989    if (psMemCheckLeaks(currentId,NULL,NULL) != 0) {
    7090        psAbort(__func__,"Memory Leaks!");
Note: See TracChangeset for help on using the changeset viewer.