Changeset 4160 for trunk/psLib/src/math/psMatrix.c
- Timestamp:
- Jun 8, 2005, 12:28:08 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psMatrix.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psMatrix.c
r4144 r4160 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-06-08 02:38:02$23 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-06-08 22:28:07 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 33 33 #include <gsl/gsl_matrix.h> 34 34 #include <gsl/gsl_linalg.h> 35 #include <gsl/gsl_blas.h> 35 36 #include <gsl/gsl_permutation.h> 36 37 #include <gsl/gsl_eigen.h> … … 138 139 numRows = inImage->numRows; 139 140 numCols = inImage->numCols; 140 for(i=0; i<numRows; i++) { 141 for(j=0; j<numCols; j++) { 142 if(inImage->type.type == PS_TYPE_F32) { 143 outGslMatrix->data[i*numCols+j] = (psF64)inImage->data.F32[i][j]; 144 } else { 141 if(inImage->type.type == PS_TYPE_F32) { 142 for(i=0; i<numRows; i++) { 143 for(j=0; j<numCols; j++) { 144 outGslMatrix->data[i*numCols+j] = inImage->data.F32[i][j]; 145 } 146 } 147 } else { 148 for(i=0; i<numRows; i++) { 149 for(j=0; j<numCols; j++) { 145 150 outGslMatrix->data[i*numCols+j] = inImage->data.F64[i][j]; 146 151 } … … 160 165 numRows = outImage->numRows; 161 166 numCols = outImage->numCols; 162 for(i=0; i<numRows; i++) { 163 for(j=0; j<numCols; j++) { 164 if(outImage->type.type == PS_TYPE_F32) { 165 outImage->data.F32[i][j] = (psF32)inGslMatrix->data[i*numCols+j]; 166 } else { 167 if(outImage->type.type == PS_TYPE_F32) { 168 for(i=0; i<numRows; i++) { 169 for(j=0; j<numCols; j++) { 170 outImage->data.F32[i][j] = inGslMatrix->data[i*numCols+j]; 171 } 172 } 173 } else { 174 for(i=0; i<numRows; i++) { 175 for(j=0; j<numCols; j++) { 167 176 outImage->data.F64[i][j] = inGslMatrix->data[i*numCols+j]; 168 177 } … … 401 410 } 402 411 403 outImage = psImageRecycle(outImage, inImage 1->numCols, inImage2->numRows, inImage2->type.type);412 outImage = psImageRecycle(outImage, inImage2->numCols, inImage1->numRows, inImage2->type.type); 404 413 405 414 // Initialize GSL data … … 411 420 412 421 // Perform multiplication 422 // gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, m1, m2, 0.0, m3); 413 423 gsl_linalg_matmult(m1, m2, m3); 414 // N.B., gsl_blas_sgemm/dgemm could have been used instead, e.g.,415 // gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, m1, m2, m3)416 424 417 425 // Copy GSL matrix data to psImage data
Note:
See TracChangeset
for help on using the changeset viewer.
