Changeset 3476
- Timestamp:
- Mar 22, 2005, 11:52:49 AM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 36 edited
-
pslib.kdevelop (modified) (1 diff)
-
pslib.kdevelop.pcs (modified) ( previous)
-
pslib.kdevses (modified) (2 diffs)
-
src/collections/psVector.c (modified) (8 diffs)
-
src/collections/psVector.h (modified) (4 diffs)
-
src/dataIO/psFits.c (modified) (6 diffs)
-
src/dataIO/psFits.h (modified) (3 diffs)
-
src/dataManip/psConstants.h (modified) (9 diffs)
-
src/dataManip/psMatrix.c (modified) (5 diffs)
-
src/dataManip/psMinimize.c (modified) (2 diffs)
-
src/dataManip/psVectorFFT.c (modified) (5 diffs)
-
src/fft/psVectorFFT.c (modified) (5 diffs)
-
src/fileUtils/psFits.c (modified) (6 diffs)
-
src/fileUtils/psFits.h (modified) (3 diffs)
-
src/fits/psFits.c (modified) (6 diffs)
-
src/fits/psFits.h (modified) (3 diffs)
-
src/image/psImageErrors.dat (modified) (1 diff)
-
src/image/psImageErrors.h (modified) (2 diffs)
-
src/image/psImageExtraction.c (modified) (3 diffs)
-
src/image/psImageManip.c (modified) (4 diffs)
-
src/image/psImageManip.h (modified) (3 diffs)
-
src/image/psImageStats.c (modified) (9 diffs)
-
src/imageops/psImageStats.c (modified) (9 diffs)
-
src/math/psConstants.h (modified) (9 diffs)
-
src/math/psMatrix.c (modified) (5 diffs)
-
src/math/psMinimize.c (modified) (2 diffs)
-
src/mathtypes/psVector.c (modified) (8 diffs)
-
src/mathtypes/psVector.h (modified) (4 diffs)
-
src/sys/psError.c (modified) (2 diffs)
-
src/sys/psError.h (modified) (4 diffs)
-
src/sys/psLogMsg.c (modified) (2 diffs)
-
src/sys/psLogMsg.h (modified) (2 diffs)
-
src/sysUtils/psError.c (modified) (2 diffs)
-
src/sysUtils/psError.h (modified) (4 diffs)
-
src/sysUtils/psLogMsg.c (modified) (2 diffs)
-
src/sysUtils/psLogMsg.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevelop
r3341 r3476 113 113 <group pattern="*.h" name="Header files" /> 114 114 <group pattern="*.c" name="Source files" /> 115 <hidenonprojectfiles>false</hidenonprojectfiles> 116 <hidenonlocation>false</hidenonlocation> 115 117 </groups> 116 118 <tree> -
trunk/psLib/pslib.kdevses
r3443 r3476 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 3" >5 <Doc0 NumberOfViews="1" URL="file:/ home/desonia/panstarrs/psLib/src/astronomy/psMetadata.c" >6 <View0 line=" 92" Type="Source" />4 <DocsAndViews NumberOfDocuments="5" > 5 <Doc0 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/fileUtils/psFits.h" > 6 <View0 line="219" Type="Source" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:/ home/desonia/panstarrs/psLib/src/astronomy/psDB.c" >9 <View0 line="1 01" Type="Source" />8 <Doc1 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/fileUtils/psFits.c" > 9 <View0 line="1379" Type="Source" /> 10 10 </Doc1> 11 <Doc2 NumberOfViews="1" URL="file:/ usr/share/aclocal/pilot-link.m4" >12 <View0 line=" 0" Type="Source" />11 <Doc2 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/test/fileUtils/tst_psFits.c" > 12 <View0 line="917" Type="Source" /> 13 13 </Doc2> 14 <Doc3 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psVector.h" > 15 <View0 line="156" Type="Source" /> 16 </Doc3> 17 <Doc4 NumberOfViews="1" URL="file:///home/desonia/panstarrs/psLib/src/collections/psVector.c" > 18 <View0 line="537" Type="Source" /> 19 </Doc4> 14 20 </DocsAndViews> 15 21 <pluginList> 22 <kdevdebugger> 23 <breakpointList/> 24 </kdevdebugger> 16 25 <kdevbookmarks> 17 26 <bookmarks/> … … 23 32 <kcachegrind path="" /> 24 33 </kdevvalgrind> 25 <kdevdebugger>26 <breakpointList/>27 </kdevdebugger>28 34 </pluginList> 29 35 </KDevPrjSession> -
trunk/psLib/src/collections/psVector.c
r3407 r3476 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-03- 11 20:38:56$11 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 } 38 38 39 psFree(psVec->data. V);39 psFree(psVec->data.U8); 40 40 } 41 41 … … 59 59 60 60 // Create vector data array 61 psVec->data. V= psAlloc(nalloc * elementSize);61 psVec->data.U8 = psAlloc(nalloc * elementSize); 62 62 63 63 return psVec; … … 80 80 } 81 81 // Realloc after decrementation to avoid accessing freed array elements 82 in->data. V = psRealloc(in->data.V, nalloc * elementSize);82 in->data.U8 = psRealloc(in->data.U8, nalloc * elementSize); 83 83 in->nalloc = nalloc; 84 84 } … … 107 107 // need to increase data buffer? 108 108 if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) { 109 in->data. V = psRealloc(in->data.V, byteSize);109 in->data.U8 = psRealloc(in->data.U8, byteSize); 110 110 in->nalloc = n; 111 111 } … … 235 235 inType = inVector->type.type; 236 236 N = inVector->n; 237 inVec = inVector->data.V;237 inVec = (psPtr)inVector->data.U8; 238 238 elSize = PSELEMTYPE_SIZEOF(inType); 239 239 … … 249 249 } 250 250 outVector->n = N; 251 outVec = outVector->data. V;251 outVec = outVector->data.U8; 252 252 253 253 if (N == 0) { … … 496 496 } 497 497 498 psF64 p_psVectorGetElementF64(psVector* vector, 499 int position) 500 { 501 if (vector == NULL) { 502 return NAN; 503 } 504 if (position < 0 || position >= vector->n) { 505 return NAN; 506 } 507 508 switch (vector->type.type) { 509 case PS_TYPE_U8: 510 return vector->data.U8[position]; 511 break; 512 case PS_TYPE_U16: 513 return vector->data.U16[position]; 514 break; 515 case PS_TYPE_U32: 516 return vector->data.U32[position]; 517 break; 518 case PS_TYPE_U64: 519 return vector->data.U64[position]; 520 break; 521 case PS_TYPE_S8: 522 return vector->data.S8[position]; 523 break; 524 case PS_TYPE_S16: 525 return vector->data.S16[position]; 526 break; 527 case PS_TYPE_S32: 528 return vector->data.S32[position]; 529 break; 530 case PS_TYPE_S64: 531 return vector->data.S64[position]; 532 break; 533 case PS_TYPE_F32: 534 return vector->data.F32[position]; 535 break; 536 case PS_TYPE_F64: 537 return vector->data.F64[position]; 538 default: 539 return NAN; 540 } 541 } -
trunk/psLib/src/collections/psVector.h
r3407 r3476 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-03- 11 20:38:56$13 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 38 38 union { 39 psBool B; ///< Boolean data.40 39 psU8* U8; ///< Unsigned 8-bit integer data. 41 40 psU16* U16; ///< Unsigned 16-bit integer data. … … 50 49 psC32* C32; ///< Single-precision complex data. 51 50 psC64* C64; ///< Double-precision complex data. 52 psPtr V; ///< Pointer to data.53 51 } data; ///< Union for data types. 54 52 } … … 153 151 ); 154 152 153 /** Returns an element in the vector as a psF64 value 154 * 155 * @return psF64 the value at specified position, or NAN if position is invalid. 156 */ 157 psF64 p_psVectorGetElementF64( 158 psVector* vector, ///< vector to retrieve element 159 int position ///< the vector position to get 160 ); 161 162 155 163 /// @} 156 164 -
trunk/psLib/src/dataIO/psFits.c
r3407 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-03- 11 20:38:56$9 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 78 78 case TDBLCOMPLEX: 79 79 return PS_TYPE_C64; 80 case TLOGICAL: 81 return PS_TYPE_BOOL; 80 82 default: 83 psError(PS_ERR_IO, true, 84 "Unknown FITS datatype, %d.", 85 datatype); 81 86 return PS_TYPE_PTR; 82 87 } 83 88 } 84 85 89 86 90 static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType) … … 1295 1299 fits_get_num_rows(fits->p_fd, &numRows, &status); 1296 1300 1301 // get the column length. 1302 int width; 1303 if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) { 1304 char fitsErr[MAX_STRING_LENGTH]; 1305 (void)fits_get_errstatus(status, fitsErr); 1306 psError(PS_ERR_IO, true, 1307 PS_ERRORTEXT_psFits_GET_COLTYPE, 1308 fitsErr); 1309 return NULL; 1310 } 1311 1312 // allocate the buffers 1297 1313 psArray* result = psArrayAlloc(numRows); 1314 for (int row = 0; row < numRows; row++) { 1315 result->data[row] = psAlloc((width+1)*sizeof(char)); 1316 } 1317 result->n = numRows; 1298 1318 1299 1319 fits_read_col_str(fits->p_fd, … … 1322 1342 const char* colname) 1323 1343 { 1344 int status = 0; 1324 1345 int colnum = 0; 1325 int status = 0;1326 1346 1327 1347 if (fits == NULL) { … … 1359 1379 // get the number of rows 1360 1380 long numRows = 0; 1361 fits_get_num_rows(fits->p_fd, &numRows, &status); 1381 fits_get_num_rows(fits->p_fd, 1382 &numRows, 1383 &status); 1362 1384 1363 1385 // get the column datatype. … … 1376 1398 psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode)); 1377 1399 1378 fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */, 1379 1 /* firstelem */, numRows, NULL, result->data.V, 1380 NULL, &status); 1400 fits_read_col(fits->p_fd, 1401 typecode, 1402 colnum, 1403 1 /* firstrow */, 1404 1 /* firstelem */, 1405 numRows, 1406 NULL, 1407 (psPtr)(result->data.U8), 1408 NULL, 1409 &status); 1381 1410 1382 1411 if ( status != 0) { -
trunk/psLib/src/dataIO/psFits.h
r3407 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-03- 11 20:38:56$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 206 206 */ 207 207 psArray* psFitsReadTableColumn( 208 psFits* fits, 209 const char* colname 208 psFits* fits, ///< the psFits object 209 const char* colname ///< the column name 210 210 ); 211 211 … … 262 262 ///< Array of psMetadata items, which contains the output data items of each row. 263 263 int row ///< the row number to update. 264 265 264 ); 266 265 -
trunk/psLib/src/dataManip/psConstants.h
r3313 r3476 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.5 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 2-24 00:19:51$8 * @version $Revision: 1.57 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-03-22 21:52:49 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 191 191 #define PS_VECTOR_CHECK_NULL(NAME, RVAL) PS_VECTOR_CHECK_NULL_GENERAL(NAME, return RVAL) 192 192 #define PS_VECTOR_CHECK_NULL_GENERAL(NAME, CLEANUP) \ 193 if (NAME == NULL || NAME->data. V== NULL) { \193 if (NAME == NULL || NAME->data.U8 == NULL) { \ 194 194 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 195 195 "Unallowable operation: psVector %s or its data is NULL.", \ … … 272 272 NEW_STATIC32 = psVectorRecycle(NEW_STATIC32, OLD->n, PS_TYPE_F32); \ 273 273 p_psMemSetPersistent(NEW_STATIC32, true); \ 274 p_psMemSetPersistent(NEW_STATIC32->data. V, true); \274 p_psMemSetPersistent(NEW_STATIC32->data.U8, true); \ 275 275 for (i=0; i < OLD->n ; i++) { \ 276 276 NEW_STATIC32->data.F32[i] = (float) OLD->data.F64[i]; \ … … 285 285 NEW_STATIC64 = psVectorRecycle(NEW_STATIC64, OLD->n, PS_TYPE_F64); \ 286 286 p_psMemSetPersistent(NEW_STATIC64, true); \ 287 p_psMemSetPersistent(NEW_STATIC64->data. V, true); \287 p_psMemSetPersistent(NEW_STATIC64->data.U8, true); \ 288 288 for (i=0; i < OLD->n ; i++) { \ 289 289 NEW_STATIC64->data.F64[i] = (double) OLD->data.F32[i]; \ … … 295 295 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \ 296 296 p_psMemSetPersistent(VEC, true); \ 297 p_psMemSetPersistent(VEC->data. V, true); \297 p_psMemSetPersistent(VEC->data.U8, true); \ 298 298 for (int i=0;i<N;i++) { \ 299 299 VEC->data.F32[i] = 1.0; \ … … 303 303 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \ 304 304 p_psMemSetPersistent(VEC, true); \ 305 p_psMemSetPersistent(VEC->data. V, true); \305 p_psMemSetPersistent(VEC->data.U8, true); \ 306 306 for (int i=0;i<N;i++) { \ 307 307 VEC->data.F64[i] = 1.0; \ … … 311 311 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \ 312 312 p_psMemSetPersistent(VEC, true); \ 313 p_psMemSetPersistent(VEC->data. V, true); \313 p_psMemSetPersistent(VEC->data.U8, true); \ 314 314 for (int i=0;i<N;i++) { \ 315 315 VEC->data.F32[i] = (float) i; \ … … 319 319 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \ 320 320 p_psMemSetPersistent(VEC, true); \ 321 p_psMemSetPersistent(VEC->data. V, true); \321 p_psMemSetPersistent(VEC->data.U8, true); \ 322 322 for (int i=0;i<N;i++) { \ 323 323 VEC->data.F64[i] = (float) i; \ … … 328 328 NAME = psVectorRecycle(NAME, SIZE, TYPE); \ 329 329 p_psMemSetPersistent(NAME, true); \ 330 p_psMemSetPersistent(NAME->data. V, true); \330 p_psMemSetPersistent(NAME->data.U8, true); \ 331 331 332 332 #define PS_VECTOR_DECLARE_ALLOC_STATIC(NAME, SIZE, TYPE) \ -
trunk/psLib/src/dataManip/psMatrix.c
r3341 r3476 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-0 2-28 23:34:10$23 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-03-22 21:52:49 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 216 216 217 217 (*outPerm)->n = numCols; 218 perm.data = ( *outPerm)->data.V;218 perm.data = (psPtr)((*outPerm)->data.U8); 219 219 lu = gsl_matrix_alloc(numRows, numCols); 220 220 … … 273 273 outVector->n = numCols; 274 274 perm.size = inPerm->n; 275 perm.data = inPerm->data.V;275 perm.data = (psPtr)(inPerm->data.U8); 276 276 277 277 // Solve for {x} in equation: {b} = [A]{x} … … 580 580 } 581 581 582 memcpy(outVector->data. V, inImage->data.V[0], size);582 memcpy(outVector->data.U8, inImage->data.U8[0], size); 583 583 584 584 return outVector; … … 637 637 PS_CHECK_DIMEN_AND_TYPE(outImage, PS_DIMEN_IMAGE, VECTORTOMATRIX_CLEANUP); 638 638 639 memcpy(outImage->data. V[0], inVector->data.V, size);639 memcpy(outImage->data.U8[0], inVector->data.U8, size); 640 640 641 641 return outImage; -
trunk/psLib/src/dataManip/psMinimize.c
r3264 r3476 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 2-17 19:26:23$11 * @version $Revision: 1.107 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1608 1608 myParamMask = psVectorRecycle(myParamMask, params->n, PS_TYPE_U8); 1609 1609 p_psMemSetPersistent(myParamMask, true); 1610 p_psMemSetPersistent(myParamMask->data. V, true);1610 p_psMemSetPersistent(myParamMask->data.U8, true); 1611 1611 for (i=0;i<myParamMask->n;i++) { 1612 1612 myParamMask->data.U8[i] = 0; -
trunk/psLib/src/dataManip/psVectorFFT.c
r3264 r3476 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 2-17 19:26:23$7 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-03-22 21:52:49 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 87 87 } 88 88 out->type.type = PS_TYPE_F32; 89 out->data. V = psRealloc(out->data.V,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);89 out->data.U8 = psRealloc(out->data.U8,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc); 90 90 } 91 91 … … 113 113 out = psVectorRecycle(out, numElements, type); 114 114 out->n = numElements; 115 memcpy(out->data. V, in->data.V, numElements * PSELEMTYPE_SIZEOF(type));115 memcpy(out->data.U8, in->data.U8, numElements * PSELEMTYPE_SIZEOF(type)); 116 116 return out; 117 117 } … … 172 172 out = psVectorRecycle(out, numElements, type); 173 173 out->n = numElements; 174 memset(out->data. V, 0, PSELEMTYPE_SIZEOF(type) * numElements);174 memset(out->data.U8, 0, PSELEMTYPE_SIZEOF(type) * numElements); 175 175 return out; 176 176 } … … 298 298 out = psVectorRecycle(out, numElements, type); 299 299 out->n = numElements; 300 memcpy(out->data. V, in->data.V, PSELEMTYPE_SIZEOF(type) * numElements);300 memcpy(out->data.U8, in->data.U8, PSELEMTYPE_SIZEOF(type) * numElements); 301 301 return out; 302 302 } -
trunk/psLib/src/fft/psVectorFFT.c
r3264 r3476 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.3 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 2-17 19:26:23$7 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-03-22 21:52:49 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 87 87 } 88 88 out->type.type = PS_TYPE_F32; 89 out->data. V = psRealloc(out->data.V,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc);89 out->data.U8 = psRealloc(out->data.U8,PSELEMTYPE_SIZEOF(PS_TYPE_F32)*out->nalloc); 90 90 } 91 91 … … 113 113 out = psVectorRecycle(out, numElements, type); 114 114 out->n = numElements; 115 memcpy(out->data. V, in->data.V, numElements * PSELEMTYPE_SIZEOF(type));115 memcpy(out->data.U8, in->data.U8, numElements * PSELEMTYPE_SIZEOF(type)); 116 116 return out; 117 117 } … … 172 172 out = psVectorRecycle(out, numElements, type); 173 173 out->n = numElements; 174 memset(out->data. V, 0, PSELEMTYPE_SIZEOF(type) * numElements);174 memset(out->data.U8, 0, PSELEMTYPE_SIZEOF(type) * numElements); 175 175 return out; 176 176 } … … 298 298 out = psVectorRecycle(out, numElements, type); 299 299 out->n = numElements; 300 memcpy(out->data. V, in->data.V, PSELEMTYPE_SIZEOF(type) * numElements);300 memcpy(out->data.U8, in->data.U8, PSELEMTYPE_SIZEOF(type) * numElements); 301 301 return out; 302 302 } -
trunk/psLib/src/fileUtils/psFits.c
r3407 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-03- 11 20:38:56$9 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 78 78 case TDBLCOMPLEX: 79 79 return PS_TYPE_C64; 80 case TLOGICAL: 81 return PS_TYPE_BOOL; 80 82 default: 83 psError(PS_ERR_IO, true, 84 "Unknown FITS datatype, %d.", 85 datatype); 81 86 return PS_TYPE_PTR; 82 87 } 83 88 } 84 85 89 86 90 static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType) … … 1295 1299 fits_get_num_rows(fits->p_fd, &numRows, &status); 1296 1300 1301 // get the column length. 1302 int width; 1303 if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) { 1304 char fitsErr[MAX_STRING_LENGTH]; 1305 (void)fits_get_errstatus(status, fitsErr); 1306 psError(PS_ERR_IO, true, 1307 PS_ERRORTEXT_psFits_GET_COLTYPE, 1308 fitsErr); 1309 return NULL; 1310 } 1311 1312 // allocate the buffers 1297 1313 psArray* result = psArrayAlloc(numRows); 1314 for (int row = 0; row < numRows; row++) { 1315 result->data[row] = psAlloc((width+1)*sizeof(char)); 1316 } 1317 result->n = numRows; 1298 1318 1299 1319 fits_read_col_str(fits->p_fd, … … 1322 1342 const char* colname) 1323 1343 { 1344 int status = 0; 1324 1345 int colnum = 0; 1325 int status = 0;1326 1346 1327 1347 if (fits == NULL) { … … 1359 1379 // get the number of rows 1360 1380 long numRows = 0; 1361 fits_get_num_rows(fits->p_fd, &numRows, &status); 1381 fits_get_num_rows(fits->p_fd, 1382 &numRows, 1383 &status); 1362 1384 1363 1385 // get the column datatype. … … 1376 1398 psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode)); 1377 1399 1378 fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */, 1379 1 /* firstelem */, numRows, NULL, result->data.V, 1380 NULL, &status); 1400 fits_read_col(fits->p_fd, 1401 typecode, 1402 colnum, 1403 1 /* firstrow */, 1404 1 /* firstelem */, 1405 numRows, 1406 NULL, 1407 (psPtr)(result->data.U8), 1408 NULL, 1409 &status); 1381 1410 1382 1411 if ( status != 0) { -
trunk/psLib/src/fileUtils/psFits.h
r3407 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-03- 11 20:38:56$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 206 206 */ 207 207 psArray* psFitsReadTableColumn( 208 psFits* fits, 209 const char* colname 208 psFits* fits, ///< the psFits object 209 const char* colname ///< the column name 210 210 ); 211 211 … … 262 262 ///< Array of psMetadata items, which contains the output data items of each row. 263 263 int row ///< the row number to update. 264 265 264 ); 266 265 -
trunk/psLib/src/fits/psFits.c
r3407 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-03- 11 20:38:56$9 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 78 78 case TDBLCOMPLEX: 79 79 return PS_TYPE_C64; 80 case TLOGICAL: 81 return PS_TYPE_BOOL; 80 82 default: 83 psError(PS_ERR_IO, true, 84 "Unknown FITS datatype, %d.", 85 datatype); 81 86 return PS_TYPE_PTR; 82 87 } 83 88 } 84 85 89 86 90 static bool convertPsTypeToFits(psElemType type, int* bitPix, double* bZero, int* dataType) … … 1295 1299 fits_get_num_rows(fits->p_fd, &numRows, &status); 1296 1300 1301 // get the column length. 1302 int width; 1303 if ( fits_get_col_display_width(fits->p_fd, colnum, &width, &status) != 0) { 1304 char fitsErr[MAX_STRING_LENGTH]; 1305 (void)fits_get_errstatus(status, fitsErr); 1306 psError(PS_ERR_IO, true, 1307 PS_ERRORTEXT_psFits_GET_COLTYPE, 1308 fitsErr); 1309 return NULL; 1310 } 1311 1312 // allocate the buffers 1297 1313 psArray* result = psArrayAlloc(numRows); 1314 for (int row = 0; row < numRows; row++) { 1315 result->data[row] = psAlloc((width+1)*sizeof(char)); 1316 } 1317 result->n = numRows; 1298 1318 1299 1319 fits_read_col_str(fits->p_fd, … … 1322 1342 const char* colname) 1323 1343 { 1344 int status = 0; 1324 1345 int colnum = 0; 1325 int status = 0;1326 1346 1327 1347 if (fits == NULL) { … … 1359 1379 // get the number of rows 1360 1380 long numRows = 0; 1361 fits_get_num_rows(fits->p_fd, &numRows, &status); 1381 fits_get_num_rows(fits->p_fd, 1382 &numRows, 1383 &status); 1362 1384 1363 1385 // get the column datatype. … … 1376 1398 psVector* result = psVectorAlloc(numRows, convertFitsToPsType(typecode)); 1377 1399 1378 fits_read_col(fits->p_fd, typecode, colnum, 1 /* firstrow */, 1379 1 /* firstelem */, numRows, NULL, result->data.V, 1380 NULL, &status); 1400 fits_read_col(fits->p_fd, 1401 typecode, 1402 colnum, 1403 1 /* firstrow */, 1404 1 /* firstelem */, 1405 numRows, 1406 NULL, 1407 (psPtr)(result->data.U8), 1408 NULL, 1409 &status); 1381 1410 1382 1411 if ( status != 0) { -
trunk/psLib/src/fits/psFits.h
r3407 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-03- 11 20:38:56$9 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 206 206 */ 207 207 psArray* psFitsReadTableColumn( 208 psFits* fits, 209 const char* colname 208 psFits* fits, ///< the psFits object 209 const char* colname ///< the column name 210 210 ); 211 211 … … 262 262 ///< Array of psMetadata items, which contains the output data items of each row. 263 263 int row ///< the row number to update. 264 265 264 ); 266 265 -
trunk/psLib/src/image/psImageErrors.dat
r2879 r3476 79 79 psImageConvolve_KERNEL_TOO_LARGE Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d. 80 80 psImage_COEFF_NULL Polynomial coefficients cannot be NULL. 81 psImageManip_TRANSFORM_NULL Specified input transform can not be NULL. -
trunk/psLib/src/image/psImageErrors.h
r3264 r3476 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-0 2-17 19:26:24$9 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-03-22 21:52:49 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 96 96 #define PS_ERRORTEXT_psImageConvolve_KERNEL_TOO_LARGE "Specified psKernel size, %dx%d, can not be larger than input psImage size, %dx%d." 97 97 #define PS_ERRORTEXT_psImage_COEFF_NULL "Polynomial coefficients cannot be NULL." 98 #define PS_ERRORTEXT_psImageManip_TRANSFORM_NULL "Specified input transform can not be NULL" 98 99 //~End 99 100 -
trunk/psLib/src/image/psImageExtraction.c
r3313 r3476 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 2-24 00:19:51$11 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 370 370 ps##TYPE *imgVecData = imgVec->data.TYPE; \ 371 371 if (maskVec != NULL) { \ 372 maskVecData = maskVec->data. V; \373 maskData = (psMaskType* )(mask->data. V[row0]) + c; \372 maskVecData = maskVec->data.U8; \ 373 maskData = (psMaskType* )(mask->data.U8[row0]) + c; \ 374 374 } \ 375 375 for (psS32 r=row0;r<row1;r++) { \ … … 453 453 // point the vector struct to the 454 454 // data to calculate the stats 455 imgVec->data. V= (psPtr )(in->data.U8[r] + col0 * elementSize);455 imgVec->data.U8 = (psPtr )(in->data.U8[r] + col0 * elementSize); 456 456 if (maskVec != NULL) { 457 maskVec->data. V= (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType));457 maskVec->data.U8 = (psPtr )(mask->data.U8[r] + col0 * sizeof(psMaskType)); 458 458 } 459 459 myStats = psVectorStats(myStats, imgVec, NULL, maskVec, maskVal); -
trunk/psLib/src/image/psImageManip.c
r3446 r3476 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-03- 18 02:35:14$12 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-03-22 21:52:49 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include "psConstants.h" 28 28 #include "psImageErrors.h" 29 #include "psCoord.h" 29 30 30 31 psS32 psImageClip(psImage* input, … … 1034 1035 break; 1035 1036 1036 1037 1037 switch (mode) { 1038 1038 PSIMAGE_SHIFT_ARBITRARY_CASE(FLAT); … … 1049 1049 return out; 1050 1050 } 1051 1052 1053 // XXX: implementation is awaiting working psPlaneTransform functions like 1054 // invert. Also, the next SDRS should have a different signature. 1055 psImage* psImageTransform(psImage *output, 1056 const psImage *input, 1057 const psImage *inputMask, 1058 int inputMaskVal, 1059 const psPlaneTransform *outToIn, 1060 const psImage *combineMask, 1061 int combineMaskVal) 1062 { 1063 if (input == NULL) { 1064 psError(PS_ERR_BAD_PARAMETER_NULL, true, 1065 PS_ERRORTEXT_psImage_IMAGE_NULL); 1066 return NULL; 1067 } 1068 1069 if (outToIn == NULL) { 1070 psError(PS_ERR_BAD_PARAMETER_NULL, true, 1071 PS_ERRORTEXT_psImageManip_TRANSFORM_NULL); 1072 return NULL; 1073 } 1074 1075 // find the input image domain in the output image 1076 1077 // loop through the output image using the domain above and transform 1078 // each output pixel to input coordinates and use psImagePixelInterpolate 1079 // to determine the pixel value. 1080 1081 1082 return NULL; 1083 } -
trunk/psLib/src/image/psImageManip.h
r3264 r3476 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 2-17 19:26:24$13 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 20 20 21 21 #include "psImage.h" 22 #include "psCoord.h" 22 23 23 24 /// @addtogroup Image … … 180 181 ); 181 182 183 /** Transform the input image according the supplied transformation. 184 * 185 * Transform the input image according the supplied transformation. In the 186 * event that the output is NULL, the smallest possible image capable of 187 * containing the entire transformed input image is to be returned; otherwise 188 * only the image size specified in the output image is to be used. If the 189 * inputMask is not NULL, those pixels in the inputMask matching inputMaskVal 190 * are to be ignored in the transformation. The inputMask must be of type 191 * psU8, and of the same size as the input, otherwise the function shall 192 * generate an error and return NULL. The transformation outToIn specifies 193 * the coordinates in the input image of a pixel in the output image - note 194 * that this is the reverse of what might be naively expected, but it is what 195 * is required in order to use psImagePixelInterpolate. If combineMask is not 196 * NULL, then those pixels that match combineMaskVal are not transformed. 197 * combineMask must be of type psU8 and of the same size as the output, 198 * otherwise the function shall generate an error and return NULL. This 199 * function must be capable of handling the following types for the input 200 * (with corresponding types for the output): psF32, psF64. 201 * 202 * @return psImage* The transformed image. 203 */ 204 psImage* psImageTransform( 205 psImage *output, ///< psImage to recycle, or NULL 206 const psImage *input, ///< psImage to apply transform to 207 const psImage *inputMask, ///< if not NULL, mask of input psImage 208 int inputMaskVal, ///< masking value for inputMask 209 const psPlaneTransform *outToIn, ///< the transform to apply 210 const psImage *combineMask, ///< if not NULL, mask of pixels not to be transformed 211 int combineMaskVal ///< masking value for combineMask 212 ); 213 182 214 #endif -
trunk/psLib/src/image/psImageStats.c
r3309 r3476 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 2-23 21:32:40$11 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 63 63 junkData->nalloc = in->numRows * in->numCols; 64 64 junkData->n = junkData->nalloc; 65 junkData->data. V= in->data.V[0]; // since psImage data is contiguous...65 junkData->data.U8 = in->data.V[0]; // since psImage data is contiguous... 66 66 } else { 67 67 // image not necessarily contiguous … … 73 73 junkData->n = junkData->nalloc; 74 74 75 psU8* data = junkData->data. V;75 psU8* data = junkData->data.U8; 76 76 for (int row = 0; row < numRows; row++) { 77 77 memcpy(data, in->data.V[row], rowSize); … … 87 87 junkMask->nalloc = mask->numRows * mask->numCols; 88 88 junkMask->n = junkMask->nalloc; 89 junkMask->data. V= mask->data.V[0];89 junkMask->data.U8 = mask->data.V[0]; 90 90 } else { 91 91 // image not necessarily contiguous … … 97 97 junkMask->n = junkMask->nalloc; 98 98 99 psU8* data = junkMask->data. V;99 psU8* data = junkMask->data.U8; 100 100 for (int row = 0; row < numRows; row++) { 101 101 memcpy(data, mask->data.V[row], rowSize); … … 136 136 junkData->nalloc = in->numRows * in->numCols; 137 137 junkData->n = junkData->nalloc; 138 junkData->data. V= in->data.V[0]; // since psImage data is contiguous...138 junkData->data.U8 = in->data.V[0]; // since psImage data is contiguous... 139 139 } else { 140 140 // image not necessarily contiguous … … 146 146 junkData->n = junkData->nalloc; 147 147 148 psU8* data = junkData->data. V;148 psU8* data = junkData->data.U8; 149 149 for (int row = 0; row < numRows; row++) { 150 150 memcpy(data, in->data.V[row], rowSize); … … 160 160 junkMask->nalloc = mask->numRows * mask->numCols; 161 161 junkMask->n = junkMask->nalloc; 162 junkMask->data. V= mask->data.V[0];162 junkMask->data.U8 = mask->data.V[0]; 163 163 } else { 164 164 // image not necessarily contiguous … … 170 170 junkMask->n = junkMask->nalloc; 171 171 172 psU8* data = junkMask->data. V;172 psU8* data = junkMask->data.U8; 173 173 for (int row = 0; row < numRows; row++) { 174 174 memcpy(data, mask->data.V[row], rowSize); -
trunk/psLib/src/imageops/psImageStats.c
r3309 r3476 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.6 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 2-23 21:32:40$11 * @version $Revision: 1.69 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 63 63 junkData->nalloc = in->numRows * in->numCols; 64 64 junkData->n = junkData->nalloc; 65 junkData->data. V= in->data.V[0]; // since psImage data is contiguous...65 junkData->data.U8 = in->data.V[0]; // since psImage data is contiguous... 66 66 } else { 67 67 // image not necessarily contiguous … … 73 73 junkData->n = junkData->nalloc; 74 74 75 psU8* data = junkData->data. V;75 psU8* data = junkData->data.U8; 76 76 for (int row = 0; row < numRows; row++) { 77 77 memcpy(data, in->data.V[row], rowSize); … … 87 87 junkMask->nalloc = mask->numRows * mask->numCols; 88 88 junkMask->n = junkMask->nalloc; 89 junkMask->data. V= mask->data.V[0];89 junkMask->data.U8 = mask->data.V[0]; 90 90 } else { 91 91 // image not necessarily contiguous … … 97 97 junkMask->n = junkMask->nalloc; 98 98 99 psU8* data = junkMask->data. V;99 psU8* data = junkMask->data.U8; 100 100 for (int row = 0; row < numRows; row++) { 101 101 memcpy(data, mask->data.V[row], rowSize); … … 136 136 junkData->nalloc = in->numRows * in->numCols; 137 137 junkData->n = junkData->nalloc; 138 junkData->data. V= in->data.V[0]; // since psImage data is contiguous...138 junkData->data.U8 = in->data.V[0]; // since psImage data is contiguous... 139 139 } else { 140 140 // image not necessarily contiguous … … 146 146 junkData->n = junkData->nalloc; 147 147 148 psU8* data = junkData->data. V;148 psU8* data = junkData->data.U8; 149 149 for (int row = 0; row < numRows; row++) { 150 150 memcpy(data, in->data.V[row], rowSize); … … 160 160 junkMask->nalloc = mask->numRows * mask->numCols; 161 161 junkMask->n = junkMask->nalloc; 162 junkMask->data. V= mask->data.V[0];162 junkMask->data.U8 = mask->data.V[0]; 163 163 } else { 164 164 // image not necessarily contiguous … … 170 170 junkMask->n = junkMask->nalloc; 171 171 172 psU8* data = junkMask->data. V;172 psU8* data = junkMask->data.U8; 173 173 for (int row = 0; row < numRows; row++) { 174 174 memcpy(data, mask->data.V[row], rowSize); -
trunk/psLib/src/math/psConstants.h
r3313 r3476 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.5 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 2-24 00:19:51$8 * @version $Revision: 1.57 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-03-22 21:52:49 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 191 191 #define PS_VECTOR_CHECK_NULL(NAME, RVAL) PS_VECTOR_CHECK_NULL_GENERAL(NAME, return RVAL) 192 192 #define PS_VECTOR_CHECK_NULL_GENERAL(NAME, CLEANUP) \ 193 if (NAME == NULL || NAME->data. V== NULL) { \193 if (NAME == NULL || NAME->data.U8 == NULL) { \ 194 194 psError(PS_ERR_BAD_PARAMETER_NULL, true, \ 195 195 "Unallowable operation: psVector %s or its data is NULL.", \ … … 272 272 NEW_STATIC32 = psVectorRecycle(NEW_STATIC32, OLD->n, PS_TYPE_F32); \ 273 273 p_psMemSetPersistent(NEW_STATIC32, true); \ 274 p_psMemSetPersistent(NEW_STATIC32->data. V, true); \274 p_psMemSetPersistent(NEW_STATIC32->data.U8, true); \ 275 275 for (i=0; i < OLD->n ; i++) { \ 276 276 NEW_STATIC32->data.F32[i] = (float) OLD->data.F64[i]; \ … … 285 285 NEW_STATIC64 = psVectorRecycle(NEW_STATIC64, OLD->n, PS_TYPE_F64); \ 286 286 p_psMemSetPersistent(NEW_STATIC64, true); \ 287 p_psMemSetPersistent(NEW_STATIC64->data. V, true); \287 p_psMemSetPersistent(NEW_STATIC64->data.U8, true); \ 288 288 for (i=0; i < OLD->n ; i++) { \ 289 289 NEW_STATIC64->data.F64[i] = (double) OLD->data.F32[i]; \ … … 295 295 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \ 296 296 p_psMemSetPersistent(VEC, true); \ 297 p_psMemSetPersistent(VEC->data. V, true); \297 p_psMemSetPersistent(VEC->data.U8, true); \ 298 298 for (int i=0;i<N;i++) { \ 299 299 VEC->data.F32[i] = 1.0; \ … … 303 303 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \ 304 304 p_psMemSetPersistent(VEC, true); \ 305 p_psMemSetPersistent(VEC->data. V, true); \305 p_psMemSetPersistent(VEC->data.U8, true); \ 306 306 for (int i=0;i<N;i++) { \ 307 307 VEC->data.F64[i] = 1.0; \ … … 311 311 VEC = psVectorRecycle(VEC, N, PS_TYPE_F32); \ 312 312 p_psMemSetPersistent(VEC, true); \ 313 p_psMemSetPersistent(VEC->data. V, true); \313 p_psMemSetPersistent(VEC->data.U8, true); \ 314 314 for (int i=0;i<N;i++) { \ 315 315 VEC->data.F32[i] = (float) i; \ … … 319 319 VEC = psVectorRecycle(VEC, N, PS_TYPE_F64); \ 320 320 p_psMemSetPersistent(VEC, true); \ 321 p_psMemSetPersistent(VEC->data. V, true); \321 p_psMemSetPersistent(VEC->data.U8, true); \ 322 322 for (int i=0;i<N;i++) { \ 323 323 VEC->data.F64[i] = (float) i; \ … … 328 328 NAME = psVectorRecycle(NAME, SIZE, TYPE); \ 329 329 p_psMemSetPersistent(NAME, true); \ 330 p_psMemSetPersistent(NAME->data. V, true); \330 p_psMemSetPersistent(NAME->data.U8, true); \ 331 331 332 332 #define PS_VECTOR_DECLARE_ALLOC_STATIC(NAME, SIZE, TYPE) \ -
trunk/psLib/src/math/psMatrix.c
r3341 r3476 21 21 * @author Robert DeSonia, MHPCC 22 22 * 23 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $24 * @date $Date: 2005-0 2-28 23:34:10$23 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2005-03-22 21:52:49 $ 25 25 * 26 26 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 216 216 217 217 (*outPerm)->n = numCols; 218 perm.data = ( *outPerm)->data.V;218 perm.data = (psPtr)((*outPerm)->data.U8); 219 219 lu = gsl_matrix_alloc(numRows, numCols); 220 220 … … 273 273 outVector->n = numCols; 274 274 perm.size = inPerm->n; 275 perm.data = inPerm->data.V;275 perm.data = (psPtr)(inPerm->data.U8); 276 276 277 277 // Solve for {x} in equation: {b} = [A]{x} … … 580 580 } 581 581 582 memcpy(outVector->data. V, inImage->data.V[0], size);582 memcpy(outVector->data.U8, inImage->data.U8[0], size); 583 583 584 584 return outVector; … … 637 637 PS_CHECK_DIMEN_AND_TYPE(outImage, PS_DIMEN_IMAGE, VECTORTOMATRIX_CLEANUP); 638 638 639 memcpy(outImage->data. V[0], inVector->data.V, size);639 memcpy(outImage->data.U8[0], inVector->data.U8, size); 640 640 641 641 return outImage; -
trunk/psLib/src/math/psMinimize.c
r3264 r3476 9 9 * @author GLG, MHPCC 10 10 * 11 * @version $Revision: 1.10 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 2-17 19:26:23$11 * @version $Revision: 1.107 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1608 1608 myParamMask = psVectorRecycle(myParamMask, params->n, PS_TYPE_U8); 1609 1609 p_psMemSetPersistent(myParamMask, true); 1610 p_psMemSetPersistent(myParamMask->data. V, true);1610 p_psMemSetPersistent(myParamMask->data.U8, true); 1611 1611 for (i=0;i<myParamMask->n;i++) { 1612 1612 myParamMask->data.U8[i] = 0; -
trunk/psLib/src/mathtypes/psVector.c
r3407 r3476 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-03- 11 20:38:56$11 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-03-22 21:52:49 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 } 38 38 39 psFree(psVec->data. V);39 psFree(psVec->data.U8); 40 40 } 41 41 … … 59 59 60 60 // Create vector data array 61 psVec->data. V= psAlloc(nalloc * elementSize);61 psVec->data.U8 = psAlloc(nalloc * elementSize); 62 62 63 63 return psVec; … … 80 80 } 81 81 // Realloc after decrementation to avoid accessing freed array elements 82 in->data. V = psRealloc(in->data.V, nalloc * elementSize);82 in->data.U8 = psRealloc(in->data.U8, nalloc * elementSize); 83 83 in->nalloc = nalloc; 84 84 } … … 107 107 // need to increase data buffer? 108 108 if (byteSize > in->nalloc*PSELEMTYPE_SIZEOF(in->type.type)) { 109 in->data. V = psRealloc(in->data.V, byteSize);109 in->data.U8 = psRealloc(in->data.U8, byteSize); 110 110 in->nalloc = n; 111 111 } … … 235 235 inType = inVector->type.type; 236 236 N = inVector->n; 237 inVec = inVector->data.V;237 inVec = (psPtr)inVector->data.U8; 238 238 elSize = PSELEMTYPE_SIZEOF(inType); 239 239 … … 249 249 } 250 250 outVector->n = N; 251 outVec = outVector->data. V;251 outVec = outVector->data.U8; 252 252 253 253 if (N == 0) { … … 496 496 } 497 497 498 psF64 p_psVectorGetElementF64(psVector* vector, 499 int position) 500 { 501 if (vector == NULL) { 502 return NAN; 503 } 504 if (position < 0 || position >= vector->n) { 505 return NAN; 506 } 507 508 switch (vector->type.type) { 509 case PS_TYPE_U8: 510 return vector->data.U8[position]; 511 break; 512 case PS_TYPE_U16: 513 return vector->data.U16[position]; 514 break; 515 case PS_TYPE_U32: 516 return vector->data.U32[position]; 517 break; 518 case PS_TYPE_U64: 519 return vector->data.U64[position]; 520 break; 521 case PS_TYPE_S8: 522 return vector->data.S8[position]; 523 break; 524 case PS_TYPE_S16: 525 return vector->data.S16[position]; 526 break; 527 case PS_TYPE_S32: 528 return vector->data.S32[position]; 529 break; 530 case PS_TYPE_S64: 531 return vector->data.S64[position]; 532 break; 533 case PS_TYPE_F32: 534 return vector->data.F32[position]; 535 break; 536 case PS_TYPE_F64: 537 return vector->data.F64[position]; 538 default: 539 return NAN; 540 } 541 } -
trunk/psLib/src/mathtypes/psVector.h
r3407 r3476 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-03- 11 20:38:56$13 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 37 37 38 38 union { 39 psBool B; ///< Boolean data.40 39 psU8* U8; ///< Unsigned 8-bit integer data. 41 40 psU16* U16; ///< Unsigned 16-bit integer data. … … 50 49 psC32* C32; ///< Single-precision complex data. 51 50 psC64* C64; ///< Double-precision complex data. 52 psPtr V; ///< Pointer to data.53 51 } data; ///< Union for data types. 54 52 } … … 153 151 ); 154 152 153 /** Returns an element in the vector as a psF64 value 154 * 155 * @return psF64 the value at specified position, or NAN if position is invalid. 156 */ 157 psF64 p_psVectorGetElementF64( 158 psVector* vector, ///< vector to retrieve element 159 int position ///< the vector position to get 160 ); 161 162 155 163 /// @} 156 164 -
trunk/psLib/src/sys/psError.c
r3264 r3476 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 2-17 19:26:24$12 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-03-22 21:52:49 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 103 103 104 104 return code; 105 } 106 107 void p_psWarning(const char* file, 108 int lineno, 109 const char* func, 110 const char* fmt, 111 ...) 112 { 113 char msgName[1024]; 114 115 snprintf(msgName,1024,"%s (%s:%d)",func,file,lineno); 116 117 va_list argPtr; // variable list argument pointer 118 119 // Get the variable list parameters to pass to logging function 120 va_start(argPtr, fmt); 121 122 psLogMsgV(msgName, PS_LOG_WARN, fmt, argPtr); 123 124 // Clean up stack after variable argument has been used 125 va_end(argPtr); 126 127 return; 105 128 } 106 129 -
trunk/psLib/src/sys/psError.h
r3264 r3476 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 2-17 19:26:24$14 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-03-22 21:52:49 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 106 106 #endif 107 107 108 #ifdef DOXYGEN 108 109 /** Reports an error message to the logging facility 109 110 * … … 116 117 * @return psErrorCode the given error code 117 118 */ 118 #ifdef DOXYGEN119 119 psErrorCode psError( 120 120 psErrorCode code, ///< Error class code 121 121 psBool new, ///< true if error originates at this location 122 const char* fmt, 123 ... 124 ); 125 126 /** Logs a warning message. 127 * 128 * This procedure logs a message to the destination set by a prior 129 * call to psLogSetDestination(), This is equivalent to calling 130 * psLogMsg with a level of PS_LOG_WARN. 131 * 132 */ 133 void psWarning( 122 134 const char* fmt, 123 135 ... … … 133 145 ... 134 146 ); 147 void p_psWarning( 148 const char* file, 149 int lineno, 150 const char* func, 151 const char* fmt, 152 ... 153 ); 154 135 155 136 156 #ifndef SWIG 137 157 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__) 158 #define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__) 138 159 #endif 139 160 -
trunk/psLib/src/sys/psLogMsg.c
r3264 r3476 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 2-17 19:26:24$13 * @version $Revision: 1.39 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 383 383 va_end(ap); 384 384 } 385 void psWarning(const char* name, const char* fmt, ...)386 {387 va_list ap;388 389 va_start(ap, fmt);390 psLogMsgV(name, PS_LOG_WARN, fmt, ap);391 va_end(ap);392 } -
trunk/psLib/src/sys/psLogMsg.h
r3264 r3476 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 2-17 19:26:24$13 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 102 102 }; 103 103 104 /** Logs a warning message.105 *106 * This procedure logs a message to the destination set by a prior107 * call to psLogSetDestination(), This is equivalent to calling108 * psLogMsg with a level of PS_LOG_WARN.109 *110 */111 void psWarning(112 const char* name,113 const char* fmt,114 ...115 );116 117 104 /// @} 118 105 -
trunk/psLib/src/sysUtils/psError.c
r3264 r3476 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 2-17 19:26:24$12 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-03-22 21:52:49 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 103 103 104 104 return code; 105 } 106 107 void p_psWarning(const char* file, 108 int lineno, 109 const char* func, 110 const char* fmt, 111 ...) 112 { 113 char msgName[1024]; 114 115 snprintf(msgName,1024,"%s (%s:%d)",func,file,lineno); 116 117 va_list argPtr; // variable list argument pointer 118 119 // Get the variable list parameters to pass to logging function 120 va_start(argPtr, fmt); 121 122 psLogMsgV(msgName, PS_LOG_WARN, fmt, argPtr); 123 124 // Clean up stack after variable argument has been used 125 va_end(argPtr); 126 127 return; 105 128 } 106 129 -
trunk/psLib/src/sysUtils/psError.h
r3264 r3476 12 12 * @author Eric Van Alst, MHPCC 13 13 * 14 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 2-17 19:26:24$14 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-03-22 21:52:49 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 106 106 #endif 107 107 108 #ifdef DOXYGEN 108 109 /** Reports an error message to the logging facility 109 110 * … … 116 117 * @return psErrorCode the given error code 117 118 */ 118 #ifdef DOXYGEN119 119 psErrorCode psError( 120 120 psErrorCode code, ///< Error class code 121 121 psBool new, ///< true if error originates at this location 122 const char* fmt, 123 ... 124 ); 125 126 /** Logs a warning message. 127 * 128 * This procedure logs a message to the destination set by a prior 129 * call to psLogSetDestination(), This is equivalent to calling 130 * psLogMsg with a level of PS_LOG_WARN. 131 * 132 */ 133 void psWarning( 122 134 const char* fmt, 123 135 ... … … 133 145 ... 134 146 ); 147 void p_psWarning( 148 const char* file, 149 int lineno, 150 const char* func, 151 const char* fmt, 152 ... 153 ); 154 135 155 136 156 #ifndef SWIG 137 157 #define psError(code,new,...) p_psError(__FILE__,__LINE__,__func__,code,new,__VA_ARGS__) 158 #define psWarning(...) p_psWarning(__FILE__,__LINE__,__func__,__VA_ARGS__) 138 159 #endif 139 160 -
trunk/psLib/src/sysUtils/psLogMsg.c
r3264 r3476 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.3 8$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 2-17 19:26:24$13 * @version $Revision: 1.39 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 383 383 va_end(ap); 384 384 } 385 void psWarning(const char* name, const char* fmt, ...)386 {387 va_list ap;388 389 va_start(ap, fmt);390 psLogMsgV(name, PS_LOG_WARN, fmt, ap);391 va_end(ap);392 } -
trunk/psLib/src/sysUtils/psLogMsg.h
r3264 r3476 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 2-17 19:26:24$13 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-03-22 21:52:49 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 102 102 }; 103 103 104 /** Logs a warning message.105 *106 * This procedure logs a message to the destination set by a prior107 * call to psLogSetDestination(), This is equivalent to calling108 * psLogMsg with a level of PS_LOG_WARN.109 *110 */111 void psWarning(112 const char* name,113 const char* fmt,114 ...115 );116 117 104 /// @} 118 105
Note:
See TracChangeset
for help on using the changeset viewer.
