IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24620 for trunk/psModules


Ignore:
Timestamp:
Jun 26, 2009, 6:57:14 PM (17 years ago)
Author:
eugene
Message:

added some test code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/imcombine/pmSubtractionEquation.c

    r24297 r24620  
    1515#include "pmSubtractionVisual.h"
    1616
    17 //#define TESTING                         // TESTING output for debugging; may not work with threads!
     17// #define TESTING                         // TESTING output for debugging; may not work with threads!
    1818
    1919#define USE_VARIANCE                    // Include variance in equation?
     
    789789        for (int i = 0; i < stamps->num; i++) {
    790790            pmSubtractionStamp *stamp = stamps->stamps->data[i]; // Stamp of interest
     791
    791792            if (stamp->status == PM_SUBTRACTION_STAMP_USED) {
     793
     794#ifdef TESTING
     795              // XXX double-check for NAN in data:
     796                for (int iy = 0; iy < stamp->matrix1->numRows; iy++) {
     797                    for (int ix = 0; ix < stamp->matrix1->numCols; ix++) {
     798                        if (!isfinite(stamp->matrix1->data.F64[iy][ix])) {
     799                            fprintf (stderr, "WARNING: NAN in matrix1\n");
     800                        }
     801                    }
     802                }
     803                for (int ix = 0; ix < stamp->vector1->n; ix++) {
     804                    if (!isfinite(stamp->vector1->data.F64[ix])) {
     805                        fprintf (stderr, "WARNING: NAN in vector1\n");
     806                    }
     807                }
     808#endif
     809
    792810                (void)psBinaryOp(sumMatrix, sumMatrix, "+", stamp->matrix1);
    793811                (void)psBinaryOp(sumVector, sumVector, "+", stamp->vector1);
     
    798816            }
    799817        }
     818
     819#ifdef TESTING
     820        for (int ix = 0; ix < sumVector->n; ix++) {
     821            if (!isfinite(sumVector->data.F64[ix])) {
     822                fprintf (stderr, "WARNING: NAN in vector1\n");
     823            }
     824        }
     825#endif
     826
    800827        calculatePenalty(sumVector, kernels);
    801828
    802829#ifdef TESTING
     830        for (int ix = 0; ix < sumVector->n; ix++) {
     831            if (!isfinite(sumVector->data.F64[ix])) {
     832                fprintf (stderr, "WARNING: NAN in vector1\n");
     833            }
     834        }
    803835        {
    804836            psImage *inverse = psMatrixInvert(NULL, sumMatrix, NULL);
     
    832864        }
    833865        kernels->solution1 = psMatrixLUSolution(kernels->solution1, luMatrix, sumVector, permutation);
     866
     867        // XXX double-check for NAN in data:
     868        for (int ix = 0; ix < kernels->solution1->n; ix++) {
     869            if (!isfinite(kernels->solution1->data.F64[ix])) {
     870                fprintf (stderr, "WARNING: NAN in vector1\n");
     871            }
     872        }
     873
    834874
    835875        psFree(sumVector);
Note: See TracChangeset for help on using the changeset viewer.