Changeset 3880 for trunk/psLib/src/dataManip/psMatrix.c
- Timestamp:
- May 10, 2005, 4:29:39 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/dataManip/psMatrix.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/dataManip/psMatrix.c
r3476 r3880 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-0 3-22 21:52:49 $23 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-05-11 02:29:39 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 376 376 psImage* psMatrixMultiply(psImage* outImage, psImage* inImage1, psImage* inImage2) 377 377 { 378 psS32 numRows = 0;379 psS32 numCols = 0;380 378 gsl_matrix *m1 = NULL; 381 379 gsl_matrix *m2 = NULL; … … 394 392 PS_CHECK_POINTERS(inImage1, inImage2, MULTIPLY_CLEANUP); 395 393 396 outImage = psImageRecycle(outImage, inImage2->numCols, inImage2->numRows, inImage2->type.type); 397 398 PS_CHECK_SQUARE(inImage1, MULTIPLY_CLEANUP); 399 PS_CHECK_SQUARE(inImage2, MULTIPLY_CLEANUP); 400 PS_CHECK_SQUARE(outImage, MULTIPLY_CLEANUP); 401 402 // Initialize data 403 numRows = inImage1->numRows; 404 numCols = inImage1->numCols; 394 if (inImage1->numRows != inImage2->numCols) { 395 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: number of rows of inImage1 != number of cols of inImage2."); 396 MULTIPLY_CLEANUP; 397 } 398 if (inImage1->type.type != inImage2->type.type) { 399 psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Invalid operation: data types of inImage1 and inImage2 must match."); 400 MULTIPLY_CLEANUP; 401 } 402 403 outImage = psImageRecycle(outImage, inImage1->numCols, inImage2->numRows, inImage2->type.type); 405 404 406 405 // Initialize GSL data 407 m1 = gsl_matrix_alloc( numRows,numCols);406 m1 = gsl_matrix_alloc(inImage1->numRows, inImage1->numCols); 408 407 psImageToGslMatrix(m1, inImage1); 409 m2 = gsl_matrix_alloc( numRows,numCols);408 m2 = gsl_matrix_alloc(inImage2->numRows, inImage2->numCols); 410 409 psImageToGslMatrix(m2, inImage2); 411 m3 = gsl_matrix_alloc(numRows, numCols); 412 psImageToGslMatrix(m3, outImage); 410 m3 = gsl_matrix_alloc(outImage->numRows, outImage->numCols); 413 411 414 412 // Perform multiplication
Note:
See TracChangeset
for help on using the changeset viewer.
