Changeset 19843
- Timestamp:
- Oct 2, 2008, 10:48:12 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMatrix.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMatrix.c
r17564 r19843 22 22 * @author Andy Becker, University of Washington (SVD). 23 23 * 24 * @version $Revision: 1.5 7$ $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 $ 26 26 * 27 27 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 329 329 PS_ASSERT_VECTOR_SIZE(b, (long int)a->numCols, false); 330 330 331 # if (0) 332 // XXX expand this out explicitly below 331 333 // Check for non-finite entries 332 334 #define MATRIX_CHECK_NONFINITE_CASE(TYPE,MATRIX) \ … … 337 339 for (int j = 0; j < numCols; j++) { \ 338 340 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]); 342 344 return false; \ 343 345 } \ … … 346 348 break; \ 347 349 } 350 # endif 348 351 349 352 // Check for non-finite entries in matrix 350 353 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); 353 386 default: 354 psAbort("Should never get here.");387 psAbort("Should never get here."); 355 388 } 356 389
Note:
See TracChangeset
for help on using the changeset viewer.
