IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19843


Ignore:
Timestamp:
Oct 2, 2008, 10:48:12 AM (18 years ago)
Author:
eugene
Message:

remove error call for matrix with non-finite elements

File:
1 edited

Legend:

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

    r17564 r19843  
    2222 *  @author Andy Becker, University of Washington (SVD).
    2323 *
    24  *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
    25  *  @date $Date: 2008-05-07 23:10:46 $
     24 *  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
     25 *  @date $Date: 2008-10-02 20:48:12 $
    2626 *
    2727 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    329329    PS_ASSERT_VECTOR_SIZE(b, (long int)a->numCols, false);
    330330
     331# if (0)
     332    // XXX expand this out explicitly below
    331333    // Check for non-finite entries
    332334#define MATRIX_CHECK_NONFINITE_CASE(TYPE,MATRIX) \
     
    337339          for (int j = 0; j < numCols; j++) { \
    338340              if (!isfinite(values[i][j])) { \
    339                   psError(PS_ERR_BAD_PARAMETER_VALUE, 3, \
    340                           "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n", \
    341                           i, j, values[i][j]); \
     341                  // psError(PS_ERR_BAD_PARAMETER_VALUE, 3,             
     342                  // "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n",
     343                  // i, j, values[i][j]);                               
    342344                  return false; \
    343345              } \
     
    346348      break; \
    347349  }
     350# endif
    348351
    349352    // Check for non-finite entries in matrix
    350353    switch (a->type.type) {
    351         MATRIX_CHECK_NONFINITE_CASE(F32, a);
    352         MATRIX_CHECK_NONFINITE_CASE(F64, a);
     354      case PS_TYPE_F32: {
     355          psF32 **values = a->data.F32; /* Dereference */
     356          int numCols = a->numCols, numRows = a->numRows; /* Size of matrix */
     357          for (int i = 0; i < numRows; i++) {
     358              for (int j = 0; j < numCols; j++) {
     359                  if (!isfinite(values[i][j])) {
     360                      // psError(PS_ERR_BAD_PARAMETER_VALUE, 3,
     361                      // "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n",
     362                      // i, j, values[i][j]);
     363                      return false;
     364                  }
     365              }
     366          }
     367          break;
     368      }
     369      case PS_TYPE_F64: {
     370          psF64 **values = a->data.F64; /* Dereference */
     371          int numCols = a->numCols, numRows = a->numRows; /* Size of matrix */
     372          for (int i = 0; i < numRows; i++) {
     373              for (int j = 0; j < numCols; j++) {
     374                  if (!isfinite(values[i][j])) {
     375                      // psError(PS_ERR_BAD_PARAMETER_VALUE, 3,
     376                      // "Input matrix contains non-finite elements: matrix[%d][%d] is %.2f\n",
     377                      // i, j, values[i][j]);
     378                      return false;
     379                  }
     380              }
     381          }
     382          break;
     383      }
     384        // MATRIX_CHECK_NONFINITE_CASE(F32, a);
     385        // MATRIX_CHECK_NONFINITE_CASE(F64, a);
    353386      default:
    354         psAbort("Should never get here.");
     387        psAbort("Should never get here.");
    355388    }
    356389
Note: See TracChangeset for help on using the changeset viewer.