Changeset 4493
- Timestamp:
- Jul 6, 2005, 4:17:54 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 12 edited
-
pslib.kdevses (modified) (1 diff)
-
src/collections/psScalar.h (modified) (2 diffs)
-
src/collections/psVector.c (modified) (7 diffs)
-
src/collections/psVector.h (modified) (5 diffs)
-
src/image/psImage.c (modified) (2 diffs)
-
src/image/psImage.h (modified) (5 diffs)
-
src/image/psImageStructManip.c (modified) (2 diffs)
-
src/sysUtils/psType.h (modified) (3 diffs)
-
test/collections/tst_psVector.c (modified) (10 diffs)
-
test/dataManip/tst_psHist00.c (modified) (1 diff)
-
test/dataManip/tst_psHist01.c (modified) (1 diff)
-
test/dataManip/tst_psHist03.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevses
r4457 r4493 2 2 <!DOCTYPE KDevPrjSession> 3 3 <KDevPrjSession> 4 <DocsAndViews NumberOfDocuments=" 4" >5 <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ dataManip/psFunctions.h" >6 <View0 line="2 63" Type="Source" />4 <DocsAndViews NumberOfDocuments="5" > 5 <Doc0 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/sysUtils/psType.h" > 6 <View0 line="296" Type="Source" /> 7 7 </Doc0> 8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/ dataManip/psFunctions.c" >9 <View0 line="1 597" Type="Source" />8 <Doc1 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/collections/psVector.h" > 9 <View0 line="102" Type="Source" /> 10 10 </Doc1> 11 <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/collections/psVector. h" >12 <View0 line=" 53" Type="Source" />11 <Doc2 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/collections/psVector.c" > 12 <View0 line="130" Type="Source" /> 13 13 </Doc2> 14 14 <Doc3 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage.h" > 15 <View0 line=" 79" Type="Source" />15 <View0 line="149" Type="Source" /> 16 16 </Doc3> 17 <Doc4 NumberOfViews="1" URL="file:/home/drobbin/panstarrs/psLib/src/image/psImage.c" > 18 <View0 line="151" Type="Source" /> 19 </Doc4> 17 20 </DocsAndViews> 18 21 <pluginList> -
trunk/psLib/src/collections/psScalar.h
r4409 r4493 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-28 20:17:52$13 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-07 02:17:53 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 typedef struct 33 33 { 34 ps Type type;///< Type of data.34 psMathType type; ///< Type of data. 35 35 36 36 union { -
trunk/psLib/src/collections/psVector.c
r4409 r4493 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-28 20:17:52$11 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-07 02:17:53 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 48 48 // FUNCTION IMPLEMENTATION - PUBLIC 49 49 50 psVector* psVectorAlloc( unsignedlong nalloc, psElemType type)50 psVector* psVectorAlloc( long nalloc, psElemType type) 51 51 { 52 52 psVector* psVec = NULL; … … 67 67 psVec->type.dimen = PS_DIMEN_VECTOR; 68 68 psVec->type.type = type; 69 *( int*)&psVec->nalloc = nalloc;69 *(long*)&psVec->nalloc = nalloc; 70 70 psVec->n = nalloc; 71 71 … … 76 76 } 77 77 78 psVector* psVectorRealloc(psVector* vector, unsignedlong nalloc)78 psVector* psVectorRealloc(psVector* vector, long nalloc) 79 79 { 80 80 psS32 elementSize = 0; … … 93 93 // Realloc after decrementation to avoid accessing freed array elements 94 94 vector->data.U8 = psRealloc(vector->data.U8, nalloc * elementSize); 95 *( int*)&vector->nalloc = nalloc;95 *(long*)&vector->nalloc = nalloc; 96 96 } 97 97 … … 99 99 } 100 100 101 psVector* psVectorRecycle(psVector* vector, unsignedlong nalloc, psElemType type)101 psVector* psVectorRecycle(psVector* vector, long nalloc, psElemType type) 102 102 { 103 103 psS32 byteSize; … … 120 120 if (byteSize > vector->nalloc*PSELEMTYPE_SIZEOF(vector->type.type)) { 121 121 vector->data.U8 = psRealloc(vector->data.U8, byteSize); 122 *( int*)&vector->nalloc = nalloc;122 *(long*)&vector->nalloc = nalloc; 123 123 } 124 124 -
trunk/psLib/src/collections/psVector.h
r4409 r4493 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-28 20:17:52$13 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-07 02:17:53 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 typedef struct 52 52 { 53 ps Type type; ///< Type of data.54 int n;///< Number of elements in use.55 const int nalloc;///< Total number of elements available.53 psMathType type; ///< Type of data. 54 long n; ///< Number of elements in use. 55 const long nalloc; ///< Total number of elements available. 56 56 p_psVectorData data; ///< Union for data types. 57 void *lock; ///< Optional lock for thread safety. 57 58 } 58 59 psVector; … … 73 74 */ 74 75 psVector* psVectorAlloc( 75 unsigned long nalloc,///< Total number of elements to make available.76 long nalloc, ///< Total number of elements to make available. 76 77 psElemType type ///< Type of data to be held by vector. 77 ); 78 ) 79 ; 78 80 79 81 /** Reallocate a vector. … … 88 90 psVector* psVectorRealloc( 89 91 psVector* vector, ///< Vector to reallocate. 90 unsigned long nalloc///< Total number of elements to make available.92 long nalloc ///< Total number of elements to make available. 91 93 ); 92 94 … … 120 122 ///< taken to preserve the values. 121 123 122 unsigned long nalloc,///< Total number of elements to make available.124 long nalloc, ///< Total number of elements to make available. 123 125 psElemType type ///< the datatype of the returned vector 124 126 ); -
trunk/psLib/src/image/psImage.c
r4409 r4493 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.7 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 6-28 20:17:52$11 * @version $Revision: 1.73 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-07-07 02:17:53 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 91 91 } 92 92 93 psRegion psRegionSet( psF32x0,94 psF32x1,95 psF32y0,96 psF32y1)93 psRegion psRegionSet(float x0, 94 float x1, 95 float y0, 96 float y1) 97 97 { 98 98 psRegion out; -
trunk/psLib/src/image/psImage.h
r4409 r4493 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 59$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-0 6-28 20:17:52$13 * @version $Revision: 1.60 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-07-07 02:17:53 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 51 51 typedef struct psImage 52 52 { 53 const ps Type type; ///< Image data type and dimension.53 const psMathType type; ///< Image data type and dimension. 54 54 const psU32 numCols; ///< Number of columns in image 55 55 const psU32 numRows; ///< Number of rows in image. … … 87 87 typedef struct 88 88 { 89 psF32x0; ///< the first column of the region.90 psF32x1; ///< the last column of the region.91 psF32y0; ///< the first row of the region.92 psF32y1; ///< the last row of the region.89 float x0; ///< the first column of the region. 90 float x1; ///< the last column of the region. 91 float y0; ///< the first row of the region. 92 float y1; ///< the last row of the region. 93 93 } 94 94 psRegion; … … 113 113 */ 114 114 psRegion psRegionSet( 115 psF32x0, ///< the first column of the region.116 psF32x1, ///< the last column of the region + 1.117 psF32y0, ///< the first row of the region.118 psF32y1 ///< the last row of the region + 1.115 float x0, ///< the first column of the region. 116 float x1, ///< the last column of the region + 1. 117 float y0, ///< the first row of the region. 118 float y1 ///< the last row of the region + 1. 119 119 ); 120 120 … … 152 152 153 153 /** Copy an image to a new buffer 154 * 154 * 155 155 * @return True if image copied or false if error 156 156 */ -
trunk/psLib/src/image/psImageStructManip.c
r3977 r4493 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 5-19 05:18:20$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-07-07 02:17:53 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 94 94 95 95 out->data.V = psRealloc(out->data.V,sizeof(psPtr)*numRows); // resize row pointer array 96 *(ps Type*)&out->type = image->type;96 *(psMathType*)&out->type = image->type; 97 97 *(psU32*)&out->numCols = numCols; 98 98 *(psU32*)&out->numRows = numRows; -
trunk/psLib/src/sysUtils/psType.h
r4444 r4493 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-07-0 1 03:57:39$12 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-07-07 02:17:53 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 278 278 typedef struct 279 279 { 280 psElemType type; ///< Primitive type.281 psDimen dimen; ///< Dimensionality.280 psElemType type; ///< Primitive type. 281 psDimen dimen; ///< Dimensionality. 282 282 } 283 283 psType; 284 285 typedef struct 286 { 287 psElemType type; ///< The type 288 psDimen dimen; ///< The dimensionality. 289 // psElemType type; ///< The type 290 } 291 psMathType; 284 292 285 293 /** The type of a basic data type … … 291 299 typedef struct 292 300 { 293 ps Typetype; ///< Data type information301 psMathType type; ///< Data type information 294 302 } 295 303 psMath; -
trunk/psLib/test/collections/tst_psVector.c
r4212 r4493 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 6-10 21:46:46$16 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-07-07 02:17:53 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 54 54 } 55 55 if (psVec->nalloc != 5) { 56 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);56 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 57 57 return 1; 58 58 } 59 59 if (psVec->n != psVec->nalloc) { 60 fprintf(stderr,"Vector population = % d\n", psVec->n);60 fprintf(stderr,"Vector population = %ld\n", psVec->n); 61 61 return 2; 62 62 } … … 82 82 } 83 83 if (vecZero->nalloc != 0) { 84 fprintf(stderr,"Vector size = % d\n", vecZero->nalloc);84 fprintf(stderr,"Vector size = %ld\n", vecZero->nalloc); 85 85 return 6; 86 86 } 87 87 if (vecZero->n != vecZero->nalloc) { 88 fprintf(stderr,"Vector population = % d\n", vecZero->n);88 fprintf(stderr,"Vector population = %ld\n", vecZero->n); 89 89 return 7; 90 90 } … … 122 122 } 123 123 if (psVec->nalloc != 10) { 124 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);124 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 125 125 return 1; 126 126 } 127 127 if (psVec->n != 5) { 128 fprintf(stderr,"Vector population = % d\n", psVec->n);128 fprintf(stderr,"Vector population = %ld\n", psVec->n); 129 129 return 2; 130 130 } … … 158 158 } 159 159 if (psVec->nalloc != 3) { 160 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);160 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 161 161 return 10; 162 162 } 163 163 if (psVec->n != 3) { 164 fprintf(stderr,"Vector population = % d\n", psVec->n);164 fprintf(stderr,"Vector population = %ld\n", psVec->n); 165 165 return 11; 166 166 } … … 179 179 } 180 180 if (psVec->nalloc != 0) { 181 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);181 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 182 182 return 21; 183 183 } 184 184 if (psVec->n != 0) { 185 fprintf(stderr,"Vector population = % d\n", psVec->n);185 fprintf(stderr,"Vector population = %ld\n", psVec->n); 186 186 return 22; 187 187 } … … 216 216 } 217 217 if (psVec->nalloc != 5) { // no growth should occur 218 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);218 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 219 219 return 3; 220 220 } 221 221 if (psVec->n != 2) { 222 fprintf(stderr,"Vector population = % d\n", psVec->n);222 fprintf(stderr,"Vector population = %ld\n", psVec->n); 223 223 return 4; 224 224 } … … 230 230 } 231 231 if (psVec->nalloc != 15) { // growth should occur 232 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);232 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 233 233 return 11; 234 234 } 235 235 if (psVec->n != 4) { 236 fprintf(stderr,"Vector population = % d\n", psVec->n);236 fprintf(stderr,"Vector population = %ld\n", psVec->n); 237 237 return 12; 238 238 } … … 244 244 } 245 245 if (psVec->nalloc != 15) { // no growth 246 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);246 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 247 247 return 21; 248 248 } 249 249 if (psVec->n != 2) { 250 fprintf(stderr,"Vector population = % d\n", psVec->n);250 fprintf(stderr,"Vector population = %ld\n", psVec->n); 251 251 return 22; 252 252 } … … 258 258 } 259 259 if (psVec->nalloc != 15) { // no growth 260 fprintf(stderr,"Vector size = % d\n", psVec->nalloc);260 fprintf(stderr,"Vector size = %ld\n", psVec->nalloc); 261 261 return 31; 262 262 } 263 263 if (psVec->n != 0) { 264 fprintf(stderr,"Vector population = % d\n", psVec->n);264 fprintf(stderr,"Vector population = %ld\n", psVec->n); 265 265 return 32; 266 266 } -
trunk/psLib/test/dataManip/tst_psHist00.c
r3682 r4493 40 40 41 41 if (myHist->nums->n != numBins) { 42 printf("ERROR: myHist->nums->n is wrong size (% d)\n", myHist->nums->n);42 printf("ERROR: myHist->nums->n is wrong size (%ld)\n", myHist->nums->n); 43 43 testStatus = false; 44 44 } 45 45 46 46 if (myHist->bounds->n != numBins+1) { 47 printf("ERROR: myHist->bounds->n is wrong size (% d)\n", myHist->bounds->n);47 printf("ERROR: myHist->bounds->n is wrong size (%ld)\n", myHist->bounds->n); 48 48 testStatus = false; 49 49 } -
trunk/psLib/test/dataManip/tst_psHist01.c
r3682 r4493 46 46 47 47 if (myHist->nums->n != numBins) { 48 printf("ERROR: myHist->nums->n is wrong size (% d)\n", myHist->nums->n);48 printf("ERROR: myHist->nums->n is wrong size (%ld)\n", myHist->nums->n); 49 49 testStatus = false; 50 50 } 51 51 52 52 if (myHist->bounds->n != numBins+1) { 53 printf("ERROR: myHist->bounds->n is wrong size (% d)\n", myHist->bounds->n);53 printf("ERROR: myHist->bounds->n is wrong size (%ld)\n", myHist->bounds->n); 54 54 testStatus = false; 55 55 } -
trunk/psLib/test/dataManip/tst_psHist03.c
r3682 r4493 57 57 58 58 if (myHist->nums->n != numBins) { 59 printf("ERROR: myHist->nums->n is wrong size (% d)\n", myHist->nums->n);59 printf("ERROR: myHist->nums->n is wrong size (%ld)\n", myHist->nums->n); 60 60 testStatus = false; 61 61 } 62 62 63 63 if (myHist->bounds->n != numBins+1) { 64 printf("ERROR: myHist->bounds->n is wrong size (% d)\n", myHist->bounds->n);64 printf("ERROR: myHist->bounds->n is wrong size (%ld)\n", myHist->bounds->n); 65 65 testStatus = false; 66 66 }
Note:
See TracChangeset
for help on using the changeset viewer.
