Changeset 831
- Timestamp:
- Jun 2, 2004, 1:29:39 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 31 edited
-
src/collections/psSort.c (modified) (4 diffs)
-
src/collections/psVector.c (modified) (9 diffs)
-
src/collections/psVector.h (modified) (4 diffs)
-
src/dataManip/psFFT.c (modified) (11 diffs)
-
src/dataManip/psFunctions.c (modified) (3 diffs)
-
src/dataManip/psMatrix.c (modified) (7 diffs)
-
src/dataManip/psStats.c (modified) (41 diffs)
-
src/dataManip/psVectorFFT.c (modified) (11 diffs)
-
src/fft/psVectorFFT.c (modified) (11 diffs)
-
src/image/psImage.h (modified) (2 diffs)
-
src/image/psImageStats.c (modified) (2 diffs)
-
src/imageops/psImageStats.c (modified) (2 diffs)
-
src/math/psMatrix.c (modified) (7 diffs)
-
src/math/psPolynomial.c (modified) (3 diffs)
-
src/math/psSpline.c (modified) (3 diffs)
-
src/math/psStats.c (modified) (41 diffs)
-
src/mathtypes/psImage.h (modified) (2 diffs)
-
src/mathtypes/psVector.c (modified) (9 diffs)
-
src/mathtypes/psVector.h (modified) (4 diffs)
-
src/sys/psType.h (modified) (3 diffs)
-
src/sysUtils/psType.h (modified) (3 diffs)
-
test/collections/tst_psSort_01.c (modified) (3 diffs)
-
test/collections/tst_psSort_02.c (modified) (3 diffs)
-
test/collections/tst_psSort_03.c (modified) (2 diffs)
-
test/collections/tst_psSort_04.c (modified) (2 diffs)
-
test/collections/tst_psVector_01.c (modified) (3 diffs)
-
test/collections/tst_psVector_02.c (modified) (7 diffs)
-
test/collections/tst_psVector_03.c (modified) (7 diffs)
-
test/dataManip/tst_psMatrix03.c (modified) (4 diffs)
-
test/dataManip/tst_psMatrix07.c (modified) (3 diffs)
-
test/image/tst_psImage.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psSort.c
r670 r831 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-0 5-13 22:47:52$16 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-06-02 23:29:14 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 129 129 inN = inVector->n; 130 130 outN = outVector->n; 131 inVec = inVector-> vec.f;132 outVec = outVector-> vec.f;131 inVec = inVector->data.F32; 132 outVec = outVector->data.F32; 133 133 elSize = sizeof(float); 134 134 … … 188 188 inN = inVector->n; 189 189 outN = outVector->n; 190 inVec = inVector-> vec.f;191 outVec = outVector-> vec.i32;190 inVec = inVector->data.F32; 191 outVec = outVector->data.S32; 192 192 193 193 if(inN != outN) { … … 197 197 } 198 198 199 tmpFloatVector = psVectorAlloc( PS_TYPE_FLOAT, inN);199 tmpFloatVector = psVectorAlloc(inN, PS_TYPE_F32); 200 200 tmpFloatVector->n = inN; 201 201 tmpFloatVector = psSort(tmpFloatVector, inVector); 202 202 203 203 for(i=0; i<inN; i++) { 204 tempVal = tmpFloatVector-> vec.f[i];204 tempVal = tmpFloatVector->data.F32[i]; 205 205 for(j=0; j<inN; j++) { 206 206 diff = fabsf(tempVal - inVec[j]); -
trunk/psLib/src/collections/psVector.c
r811 r831 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-0 5-29 01:08:46$21 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-06-02 23:29:14 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 64 64 /* FUNCTION IMPLEMENTATION - PUBLIC */ 65 65 /*****************************************************************************/ 66 psVector* psVectorAlloc( psElemType elemType, unsigned int nalloc)66 psVector* psVectorAlloc(unsigned int nalloc, psElemType elemType) 67 67 { 68 68 psVector *psVec = NULL; … … 86 86 87 87 // Create vector data array 88 psVec-> vec.v= psAlloc(nalloc*elementSize);88 psVec->data.V = psAlloc(nalloc*elementSize); 89 89 90 90 return psVec; 91 91 } 92 92 93 psVector *psVectorRealloc( psVector *restrict in, unsigned int nalloc)93 psVector *psVectorRealloc(unsigned int nalloc, psVector *restrict in) 94 94 { 95 95 int elementSize = 0; … … 110 110 if (elemType == PS_TYPE_PTR) { 111 111 for (int i = nalloc; i < in->n; i++) { // For reduction in vector size 112 psMemDecrRefCounter(in-> vec.vp[i]);112 psMemDecrRefCounter(in->data.PTR[i]); 113 113 } 114 114 } … … 117 117 118 118 // Realloc after decrementation to avoid accessing freed array elements 119 in-> vec.v = psRealloc(in->vec.v,nalloc*elementSize);119 in->data.V = psRealloc(in->data.V,nalloc*elementSize); 120 120 in->nalloc = nalloc; 121 121 } … … 129 129 130 130 if (in == NULL) { 131 return psVectorAlloc( type,nalloc);131 return psVectorAlloc(nalloc, type); 132 132 } 133 133 … … 150 150 if (elemType == PS_TYPE_PTR) { 151 151 for (int i = 0; i < in->n; i++) { // For reduction in vector size 152 psMemDecrRefCounter(in-> vec.vp[i]);153 in-> vec.vp[i] = NULL;152 psMemDecrRefCounter(in->data.PTR[i]); 153 in->data.PTR[i] = NULL; 154 154 } 155 155 } 156 156 157 in-> vec.v = psRealloc(in->vec.v,nalloc*PSELEMTYPE_SIZEOF(elemType));157 in->data.V = psRealloc(in->data.V,nalloc*PSELEMTYPE_SIZEOF(elemType)); 158 158 159 159 in->n = 0; … … 170 170 } 171 171 172 psFree(psVec-> vec.v);172 psFree(psVec->data.V); 173 173 psFree(psVec); 174 174 } … … 188 188 for(int i = 0; i < psVec->nalloc; i++) { 189 189 if(elemFree == NULL) { 190 psMemDecrRefCounter(psVec-> vec.vp[i]);190 psMemDecrRefCounter(psVec->data.PTR[i]); 191 191 } else { 192 elemFree(psMemDecrRefCounter(psVec-> vec.vp[i]));192 elemFree(psMemDecrRefCounter(psVec->data.PTR[i])); 193 193 } 194 psVec-> vec.vp[i] = NULL;194 psVec->data.PTR[i] = NULL; 195 195 } 196 196 } -
trunk/psLib/src/collections/psVector.h
r811 r831 1 1 /** @file psVector.h 2 2 * 3 * @brief Contains support for basic vector types3 * @brief Contains basic vector definitions and operations 4 4 * 5 * This file defines types and functions for one dimensional vectors which include: 6 * char 7 * short 8 * int 9 * long 10 * unsigned char 11 * unsigned short 12 * unsigned int 13 * unsigned long 14 * float 15 * double 16 * complex float 17 * void ** 5 * This file defines the basic type for a vector struct and functions useful 6 * in manupulating vectors. 18 7 * 8 * @author Robert DeSonia, MHPCC 19 9 * @author Ross Harman, MHPCC 20 10 * 21 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-0 5-29 01:08:46$11 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-06-02 23:29:14 $ 23 13 * 24 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 32 43 33 union { 44 int8_t *i8; ///< Pointers to char integer data. 45 int16_t *i16; ///< Pointers to short integer data. 46 int32_t *i32; ///< Pointers to integer data. 47 int64_t *i64; ///< Pointers to long integer data. 48 uint8_t *ui8; ///< Pointers to unsigned char integer data. 49 uint16_t*ui16; ///< Pointers to unsigned short integer data. 50 uint32_t *ui32; ///< Pointers to unsigned integer data. 51 uint64_t *ui64; ///< Pointers to unsigned long integer data. 52 float *f; ///< Pointers to floating point data. 53 double *d; ///< Pointers to double precision data. 54 complex float *cf; ///< Pointers to complex floating point data. 55 void *v; ///< Pointers to generic void data 56 void **vp; ///< Void pointer vector. 57 }vec; ///< Union for data types. 34 psU8 *U8; ///< Unsigned 8-bit integer data. 35 psU16 *U16; ///< Unsigned 16-bit integer data. 36 psU32 *U32; ///< Unsigned 32-bit integer data. 37 psU64 *U64; ///< Unsigned 64-bit integer data. 38 psS8 *S8; ///< Signed 8-bit integer data. 39 psS16 *S16; ///< Signed 16-bit integer data. 40 psS32 *S32; ///< Signed 32-bit integer data. 41 psS64 *S64; ///< Signed 64-bit integer data. 42 psF32 *F32; ///< Single-precision float data. 43 psF64 *F64; ///< Double-precision float data. 44 psC32 *C32; ///< Single-precision complex data. 45 psC64 *C64; ///< Double-precision complex data. 46 psPTR *PTR; ///< Void pointers 47 psPTR V; ///< Pointer to data 48 } data; ///< Union for data types. 58 49 } 59 50 psVector; … … 71 62 */ 72 63 psVector *psVectorAlloc( 73 psElemType dataType, ///< Type of data to be held by vector.74 unsigned int nalloc ///< Total number of elements to make available.64 unsigned int nalloc, ///< Total number of elements to make available. 65 psElemType dataType ///< Type of data to be held by vector. 75 66 ); 76 67 … … 84 75 */ 85 76 psVector *psVectorRealloc( 86 psVector *restrict psVec, ///< Vector to reallocate.87 unsigned int nalloc ///< Total number of elements to make available.77 unsigned int nalloc, ///< Total number of elements to make available. 78 psVector *restrict psVec ///< Vector to reallocate. 88 79 ); 89 80 -
trunk/psLib/src/dataManip/psFFT.c
r827 r831 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-06-02 03:02:48$7 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-06-02 23:29:21 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 448 448 numElements = in->n; 449 449 450 out = psVectorRecycle(out, PS_TYPE_C32,numElements);450 out = psVectorRecycle(out, numElements, PS_TYPE_C32); 451 451 452 452 if (type == PS_TYPE_F32) { 453 453 // need to convert to complex 454 psC32* outVec = out-> vec.cf;455 psF32* inVec = in-> vec.f;454 psC32* outVec = out->data.C32; 455 psF32* inVec = in->data.F32; 456 456 for (unsigned int i=0;i<numElements;i++) { 457 457 outVec[i] = inVec[i]; 458 458 } 459 459 } else { 460 psC32* outVec = out-> vec.cf;461 psC32* inVec = in-> vec.cf;460 psC32* outVec = out->data.C32; 461 psC32* inVec = in->data.C32; 462 462 for (unsigned int i=0;i<numElements;i++) { 463 463 outVec[i] = inVec[i]; … … 466 466 467 467 plan = fftwf_plan_dft_1d(numElements, 468 (fftwf_complex*)out-> vec.cf,469 (fftwf_complex*)out-> vec.cf,468 (fftwf_complex*)out->data.C32, 469 (fftwf_complex*)out->data.C32, 470 470 direction, 471 471 P_FFTW_PLAN_RIGOR); … … 504 504 psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. " 505 505 "Just a vector copy was performed."); 506 out = psVectorRecycle(out, type,numElements);507 memcpy(out-> vec.v,in->vec.v,numElements*PSELEMTYPE_SIZEOF(type));506 out = psVectorRecycle(out,numElements,type); 507 memcpy(out->data.V,in->data.V,numElements*PSELEMTYPE_SIZEOF(type)); 508 508 return out; 509 509 } … … 511 511 if (type == PS_TYPE_C32) { 512 512 psF32* outVec; 513 psC32* inVec = in-> vec.cf;514 515 out = psVectorRecycle(out, PS_TYPE_F32,numElements);516 outVec = out-> vec.f;513 psC32* inVec = in->data.C32; 514 515 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 516 outVec = out->data.F32; 517 517 518 518 for (unsigned int i=0;i<numElements;i++) { … … 548 548 "A zeroed vector was returned."); 549 549 out = psVectorRecycle(out,numElements,type); 550 memset(out-> vec.v,0,PSELEMTYPE_SIZEOF(type)*numElements);550 memset(out->data.V,0,PSELEMTYPE_SIZEOF(type)*numElements); 551 551 return out; 552 552 } … … 554 554 if (type == PS_TYPE_C32) { 555 555 psF32* outVec; 556 psC32* inVec = in-> vec.cf;557 558 out = psVectorRecycle(out, PS_TYPE_F32,numElements);559 outVec = out-> vec.f;556 psC32* inVec = in->data.C32; 557 558 out = psVectorRecycle(out,numElements, PS_TYPE_F32); 559 outVec = out->data.F32; 560 560 561 561 for (unsigned int i=0;i<numElements;i++) { … … 601 601 if (type == PS_TYPE_F32) { 602 602 psC32* outVec; 603 psF32* realVec = real-> vec.f;604 psF32* imagVec = imag-> vec.f;605 606 out = psVectorRecycle(out, PS_TYPE_C32,numElements);607 outVec = out-> vec.cf;603 psF32* realVec = real->data.F32; 604 psF32* imagVec = imag->data.F32; 605 606 out = psVectorRecycle(out,numElements, PS_TYPE_C32); 607 outVec = out->data.C32; 608 608 609 609 for (unsigned int i=0;i<numElements;i++) { … … 639 639 "Vector copy was performed instead."); 640 640 641 out = psVectorRecycle(out, type,numElements);642 memcpy(out-> vec.v,in->vec.v,PSELEMTYPE_SIZEOF(type)*numElements);641 out = psVectorRecycle(out,numElements,type); 642 memcpy(out->data.V,in->data.V,PSELEMTYPE_SIZEOF(type)*numElements); 643 643 return out; 644 644 } … … 646 646 if (type == PS_TYPE_C32) { 647 647 psC32* outVec; 648 psC32* inVec = in-> vec.cf;649 650 out = psVectorRecycle(out, PS_TYPE_C32,numElements);651 outVec = out-> vec.cf;648 psC32* inVec = in->data.C32; 649 650 out = psVectorRecycle(out,numElements,PS_TYPE_C32); 651 outVec = out->data.C32; 652 652 653 653 for (unsigned int i=0;i<numElements;i++) { … … 686 686 if (type == PS_TYPE_C32) { 687 687 psF32* outVec; 688 psC32* inVec = in-> vec.cf;688 psC32* inVec = in->data.C32; 689 689 psF32 real; 690 690 psF32 imag; 691 691 692 692 693 out = psVectorRecycle(out, PS_TYPE_F32,numElements);694 outVec = out-> vec.f;693 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 694 outVec = out->data.F32; 695 695 696 696 for (unsigned int i=0;i<numElements;i++) { -
trunk/psLib/src/dataManip/psFunctions.c
r822 r831 6 6 * @author George Gusciora, MHPCC 7 7 * 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-0 1 22:24:55$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-02 23:29:21 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 75 75 int i = 0; 76 76 77 gauss = psVectorAlloc(Npts, PS_TYPE_F LOAT);77 gauss = psVectorAlloc(Npts, PS_TYPE_F32); 78 78 gsl_rng_env_setup(); 79 79 T = gsl_rng_default; … … 81 81 82 82 for (i = 0; i < Npts; i++) { 83 gauss-> vec.f[i] = mean + gsl_ran_gaussian(r, sigma);83 gauss->data.F32[i] = mean + gsl_ran_gaussian(r, sigma); 84 84 } 85 85 -
trunk/psLib/src/dataManip/psMatrix.c
r824 r831 20 20 * @author Ross Harman, MHPCC 21 21 * 22 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $23 * @date $Date: 2004-06-0 1 22:42:57$22 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2004-06-02 23:29:21 $ 24 24 * 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 70 70 /** Preprocessor macro to generate error a NULL image */ 71 71 #define PS_CHECK_NULL_VECTOR(NAME, RETURN) \ 72 if (NAME == NULL || NAME-> vec.v== NULL) { \72 if (NAME == NULL || NAME->data.V == NULL) { \ 73 73 psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME); \ 74 74 return RETURN; \ … … 78 78 #define PS_CHECK_ALLOC_VECTOR(NAME, SIZE, PS_TYPE) \ 79 79 if(NAME == NULL) { \ 80 NAME = psVectorAlloc( PS_TYPE, SIZE); \80 NAME = psVectorAlloc(SIZE, PS_TYPE); \ 81 81 } 82 82 … … 173 173 perm.size = numCols; 174 174 outPerm->n = numCols; 175 perm.data = outPerm-> vec.v;175 perm.data = outPerm->data.V; 176 176 PS_GSL_MATRIX_INITIALIZE(lu, outImage->data.V[0]); 177 177 … … 226 226 227 227 perm.size = inPerm->n; 228 perm.data = inPerm-> vec.v;228 perm.data = inPerm->data.V; 229 229 230 230 b.size = inVector->n; 231 231 b.stride = 1; 232 b.data = inVector-> vec.v;232 b.data = inVector->data.V; 233 233 234 234 x.size = numCols; 235 235 x.stride = 1; 236 x.data = outVector-> vec.v;236 x.data = outVector->data.V; 237 237 238 238 // Solve for {x} in equation: {b} = [A]{x} … … 483 483 484 484 colSize = PSELEMTYPE_SIZEOF(inImage->type.type)*inImage->numRows; 485 memcpy(outVector-> vec.v, inImage->data.V[0], colSize);485 memcpy(outVector->data.V, inImage->data.V[0], colSize); 486 486 487 487 return outVector; … … 510 510 511 511 colSize = PSELEMTYPE_SIZEOF(outImage->type.type)*outImage->numRows; 512 memcpy(outImage->data.V[0], inVector-> vec.v, colSize);512 memcpy(outImage->data.V[0], inVector->data.V, colSize); 513 513 514 514 return outImage; -
trunk/psLib/src/dataManip/psStats.c
r797 r831 86 86 87 87 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 88 newHist->bounds = psVectorAlloc( PS_TYPE_FLOAT, n+1);88 newHist->bounds = psVectorAlloc(n+1, PS_TYPE_F32); 89 89 binSize = (upper - lower) / (float) n; 90 90 for (i=0;i<n+1;i++) { 91 newHist->bounds-> vec.f[i] = lower + (binSize * (float) i);92 } 93 newHist->nums = psVectorAlloc( PS_TYPE_INT32, n);91 newHist->bounds->data.F32[i] = lower + (binSize * (float) i); 92 } 93 newHist->nums = psVectorAlloc(n, PS_TYPE_S32); 94 94 newHist->minNum = 0; 95 95 newHist->maxNum = 0; … … 106 106 107 107 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 108 newHist->bounds = psVectorAlloc( PS_TYPE_FLOAT, bounds->n);108 newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 109 109 for (i=0;i<bounds->n;i++) { 110 newHist->bounds-> vec.f[i] = bounds->vec.f[i];111 } 112 newHist->nums = psVectorAlloc( PS_TYPE_INT32, (bounds->n)-1);110 newHist->bounds->data.F32[i] = bounds->data.F32[i]; 111 } 112 newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_S32); 113 113 114 114 newHist->minNum = 0; … … 152 152 for (i=0;i<in->n;i++) { 153 153 // Check if this pixel is masked, and if so, skip it. 154 if (!(mask-> vec.i32[i] & maskVal)) {154 if (!(mask->data.S32[i] & maskVal)) { 155 155 // Check if this pixel is below the minimum value, and if so 156 156 // count it, then skip it. 157 if (in-> vec.f[i] < out->bounds->vec.f[0]) {157 if (in->data.F32[i] < out->bounds->data.F32[0]) { 158 158 out->minNum++; 159 159 160 160 // Check if this pixel is above the maximum value, and if so 161 161 // count it, then skip it. 162 } else if (in-> vec.f[i] > out->bounds->vec.f[numBins]) {162 } else if (in->data.F32[i] > out->bounds->data.F32[numBins]) { 163 163 out->maxNum++; 164 164 } else { … … 166 166 // number is trivial. 167 167 if (out->uniform == true) { 168 binSize = out->bounds-> vec.f[1] - out->bounds->vec.f[0];169 170 binNum = (int) ((in-> vec.f[i] - out->bounds->vec.f[0]) /168 binSize = out->bounds->data.F32[1] - out->bounds->data.F32[0]; 169 170 binNum = (int) ((in->data.F32[i] - out->bounds->data.F32[0]) / 171 171 binSize); 172 (out->nums-> vec.i32[binNum])++;172 (out->nums->data.S32[binNum])++; 173 173 // If this is a non-uniform histogram, determining the correct 174 174 // bin number requires a bit more work. … … 177 177 // find the correct bin number (bin search, probably) 178 178 for (j=0;j<(out->bounds->n)-1;j++) { 179 if ((out->bounds-> vec.i32[j] <= in->vec.f[i]) &&180 (in-> vec.f[i] <= out->bounds->vec.i32[j+1])) {181 (out->nums-> vec.i32[j])++;179 if ((out->bounds->data.S32[j] <= in->data.F32[i]) && 180 (in->data.F32[i] <= out->bounds->data.S32[j+1])) { 181 (out->nums->data.S32[j])++; 182 182 } 183 183 } … … 198 198 for (i=0;i<myVector->n;i++) { 199 199 if (maskVector != NULL) 200 printf("Element %d is %f (mask is %d)\n", i, myVector-> vec.f[i], maskVector->vec.ui8[i]);200 printf("Element %d is %f (mask is %d)\n", i, myVector->data.F32[i], maskVector->data.U8[i]); 201 201 else 202 printf("Element %d is %f\n", i, myVector-> vec.f[i]);202 printf("Element %d is %f\n", i, myVector->data.F32[i]); 203 203 } 204 204 } … … 234 234 if (maskVector != NULL) { 235 235 for (i=0;i<myVector->n;i++) { 236 if (!(maskVal & maskVector-> vec.ui8[i]) &&237 (rangeMin <= myVector-> vec.f[i]) &&238 (myVector-> vec.f[i] <= rangeMax)) {239 mean+= myVector-> vec.f[i];236 if (!(maskVal & maskVector->data.U8[i]) && 237 (rangeMin <= myVector->data.F32[i]) && 238 (myVector->data.F32[i] <= rangeMax)) { 239 mean+= myVector->data.F32[i]; 240 240 count++; 241 241 } … … 244 244 } else { 245 245 for (i=0;i<myVector->n;i++) { 246 if ((rangeMin <= myVector-> vec.f[i]) &&247 (myVector-> vec.f[i] <= rangeMax)) {248 mean+= myVector-> vec.f[i];246 if ((rangeMin <= myVector->data.F32[i]) && 247 (myVector->data.F32[i] <= rangeMax)) { 248 mean+= myVector->data.F32[i]; 249 249 count++; 250 250 } … … 255 255 if (maskVector != NULL) { 256 256 for (i=0;i<myVector->n;i++) { 257 if (!(maskVal & maskVector-> vec.ui8[i])) {258 mean+= myVector-> vec.f[i];257 if (!(maskVal & maskVector->data.U8[i])) { 258 mean+= myVector->data.F32[i]; 259 259 count++; 260 260 } … … 263 263 } else { 264 264 for (i=0;i<myVector->n;i++) { 265 mean+= myVector-> vec.f[i];265 mean+= myVector->data.F32[i]; 266 266 } 267 267 mean/= (float) myVector->n; … … 287 287 if (maskVector != NULL) { 288 288 for (i=0;i<myVector->n;i++) { 289 if (!(maskVal & maskVector-> vec.ui8[i])) {290 if ((myVector-> vec.f[i] > max) &&291 (rangeMin <= myVector-> vec.f[i]) &&292 (myVector-> vec.f[i] <= rangeMax)) {293 max = myVector-> vec.f[i];289 if (!(maskVal & maskVector->data.U8[i])) { 290 if ((myVector->data.F32[i] > max) && 291 (rangeMin <= myVector->data.F32[i]) && 292 (myVector->data.F32[i] <= rangeMax)) { 293 max = myVector->data.F32[i]; 294 294 } 295 295 } … … 297 297 } else { 298 298 for (i=0;i<myVector->n;i++) { 299 if ((myVector-> vec.f[i] > max) &&300 (rangeMin <= myVector-> vec.f[i]) &&301 (myVector-> vec.f[i] <= rangeMax)) {302 max = myVector-> vec.f[i];299 if ((myVector->data.F32[i] > max) && 300 (rangeMin <= myVector->data.F32[i]) && 301 (myVector->data.F32[i] <= rangeMax)) { 302 max = myVector->data.F32[i]; 303 303 } 304 304 } … … 307 307 if (maskVector != NULL) { 308 308 for (i=0;i<myVector->n;i++) { 309 if (!(maskVal & maskVector-> vec.ui8[i])) {310 if (myVector-> vec.f[i] > max) {311 max = myVector-> vec.f[i];309 if (!(maskVal & maskVector->data.U8[i])) { 310 if (myVector->data.F32[i] > max) { 311 max = myVector->data.F32[i]; 312 312 } 313 313 } … … 315 315 } else { 316 316 for (i=0;i<myVector->n;i++) { 317 if (myVector-> vec.f[i] > max) {318 max = myVector-> vec.f[i];317 if (myVector->data.F32[i] > max) { 318 max = myVector->data.F32[i]; 319 319 } 320 320 } … … 340 340 if (maskVector != NULL) { 341 341 for (i=0;i<myVector->n;i++) { 342 if (!(maskVal & maskVector-> vec.ui8[i])) {343 if ((myVector-> vec.f[i] < min) &&344 (rangeMin <= myVector-> vec.f[i]) &&345 (myVector-> vec.f[i] <= rangeMax)) {346 min = myVector-> vec.f[i];342 if (!(maskVal & maskVector->data.U8[i])) { 343 if ((myVector->data.F32[i] < min) && 344 (rangeMin <= myVector->data.F32[i]) && 345 (myVector->data.F32[i] <= rangeMax)) { 346 min = myVector->data.F32[i]; 347 347 } 348 348 } … … 350 350 } else { 351 351 for (i=0;i<myVector->n;i++) { 352 if ((myVector-> vec.f[i] < min) &&353 (rangeMin <= myVector-> vec.f[i]) &&354 (myVector-> vec.f[i] <= rangeMax)) {355 min = myVector-> vec.f[i];352 if ((myVector->data.F32[i] < min) && 353 (rangeMin <= myVector->data.F32[i]) && 354 (myVector->data.F32[i] <= rangeMax)) { 355 min = myVector->data.F32[i]; 356 356 } 357 357 } … … 360 360 if (maskVector != NULL) { 361 361 for (i=0;i<myVector->n;i++) { 362 if (!(maskVal & maskVector-> vec.ui8[i])) {363 if (myVector-> vec.f[i] < min) {364 min = myVector-> vec.f[i];362 if (!(maskVal & maskVector->data.U8[i])) { 363 if (myVector->data.F32[i] < min) { 364 min = myVector->data.F32[i]; 365 365 } 366 366 } … … 368 368 } else { 369 369 for (i=0;i<myVector->n;i++) { 370 if (myVector-> vec.f[i] < min) {371 min = myVector-> vec.f[i];370 if (myVector->data.F32[i] < min) { 371 min = myVector->data.F32[i]; 372 372 } 373 373 } … … 397 397 if (maskVector != NULL) { 398 398 for (i=0;i<myVector->n;i++) { 399 if (!(maskVal & maskVector-> vec.ui8[i]) &&400 (rangeMin <= myVector-> vec.f[i]) &&401 (myVector-> vec.f[i] <= rangeMax)) {399 if (!(maskVal & maskVector->data.U8[i]) && 400 (rangeMin <= myVector->data.F32[i]) && 401 (myVector->data.F32[i] <= rangeMax)) { 402 402 numData++; 403 403 } … … 405 405 } else { 406 406 for (i=0;i<myVector->n;i++) { 407 if ((rangeMin <= myVector-> vec.f[i]) &&408 (myVector-> vec.f[i] <= rangeMax)) {407 if ((rangeMin <= myVector->data.F32[i]) && 408 (myVector->data.F32[i] <= rangeMax)) { 409 409 numData++; 410 410 } … … 416 416 if (maskVector != NULL) { 417 417 for (i=0;i<myVector->n;i++) { 418 if (!(maskVal & maskVector-> vec.ui8[i])) {418 if (!(maskVal & maskVector->data.U8[i])) { 419 419 numData++; 420 420 } … … 469 469 470 470 // Allocate temporary vectors for the data. 471 unsortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);471 unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 472 472 unsortedVector->n = unsortedVector->nalloc; 473 sortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);473 sortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 474 474 sortedVector->n = sortedVector->nalloc; 475 475 … … 484 484 if (maskVector != NULL) { 485 485 for (i=0;i<myVector->n;i++) { 486 if (!(maskVal & maskVector-> vec.ui8[i]) &&487 (rangeMin <= myVector-> vec.f[i]) &&488 (myVector-> vec.f[i] <= rangeMax)) {489 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];490 } 491 } 492 } else { 493 for (i=0;i<myVector->n;i++) { 494 if ((rangeMin <= myVector-> vec.f[i]) &&495 (myVector-> vec.f[i] <= rangeMax)) {496 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];486 if (!(maskVal & maskVector->data.U8[i]) && 487 (rangeMin <= myVector->data.F32[i]) && 488 (myVector->data.F32[i] <= rangeMax)) { 489 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 490 } 491 } 492 } else { 493 for (i=0;i<myVector->n;i++) { 494 if ((rangeMin <= myVector->data.F32[i]) && 495 (myVector->data.F32[i] <= rangeMax)) { 496 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 497 497 } 498 498 } … … 503 503 if (maskVector != NULL) { 504 504 for (i=0;i<myVector->n;i++) { 505 if (!(maskVal & maskVector-> vec.ui8[i])) {506 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];507 } 508 } 509 } else { 510 for (i=0;i<myVector->n;i++) { 511 unsortedVector-> vec.f[i] = maskVector->vec.f[i];505 if (!(maskVal & maskVector->data.U8[i])) { 506 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 507 } 508 } 509 } else { 510 for (i=0;i<myVector->n;i++) { 511 unsortedVector->data.F32[i] = maskVector->data.F32[i]; 512 512 } 513 513 } … … 518 518 // Calculate the median exactly. 519 519 if (0 == (nValues % 2)) { 520 stats->sampleMedian = 0.5 * (sortedVector-> vec.f[(nValues/2)-1] +521 sortedVector-> vec.f[nValues/2]);520 stats->sampleMedian = 0.5 * (sortedVector->data.F32[(nValues/2)-1] + 521 sortedVector->data.F32[nValues/2]); 522 522 } else { 523 stats->sampleMedian = sortedVector-> vec.f[nValues/2];523 stats->sampleMedian = sortedVector->data.F32[nValues/2]; 524 524 } 525 525 … … 569 569 for (j=-GAUSS_WIDTH;j<=+GAUSS_WIDTH;j++) { 570 570 if (((j+i) >= 0) && ((j+i) < robustHistogram->nums->n)) { 571 robustHistogram->nums-> vec.i32[j+i]+=571 robustHistogram->nums->data.S32[j+i]+= 572 572 (gaussianCoefs[j+GAUSS_WIDTH] * 573 (float) robustHistogram->nums-> vec.i32[j+i]);573 (float) robustHistogram->nums->data.S32[j+i]); 574 574 } 575 575 } … … 623 623 624 624 // Allocate temporary vectors for the data. 625 unsortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);625 unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 626 626 unsortedVector->n = unsortedVector->nalloc; 627 sortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);627 sortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 628 628 sortedVector->n = sortedVector->nalloc; 629 629 … … 637 637 if (maskVector != NULL) { 638 638 for (i=0;i<myVector->n;i++) { 639 if (!(maskVal & maskVector-> vec.ui8[i]) &&640 (rangeMin <= myVector-> vec.f[i]) &&641 (myVector-> vec.f[i] <= rangeMax)) {642 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];643 } 644 } 645 } else { 646 for (i=0;i<myVector->n;i++) { 647 if ((rangeMin <= myVector-> vec.f[i]) &&648 (myVector-> vec.f[i] <= rangeMax)) {649 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];639 if (!(maskVal & maskVector->data.U8[i]) && 640 (rangeMin <= myVector->data.F32[i]) && 641 (myVector->data.F32[i] <= rangeMax)) { 642 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 643 } 644 } 645 } else { 646 for (i=0;i<myVector->n;i++) { 647 if ((rangeMin <= myVector->data.F32[i]) && 648 (myVector->data.F32[i] <= rangeMax)) { 649 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 650 650 } 651 651 } … … 656 656 if (maskVector != NULL) { 657 657 for (i=0;i<myVector->n;i++) { 658 if (!(maskVal & maskVector-> vec.ui8[i])) {659 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];660 } 661 } 662 } else { 663 for (i=0;i<myVector->n;i++) { 664 unsortedVector-> vec.f[i] = maskVector->vec.f[i];658 if (!(maskVal & maskVector->data.U8[i])) { 659 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 660 } 661 } 662 } else { 663 for (i=0;i<myVector->n;i++) { 664 unsortedVector->data.F32[i] = maskVector->data.F32[i]; 665 665 } 666 666 } … … 672 672 // Calculate the quartile points exactly. 673 673 ind = 3 * (nValues / 4); 674 stats->sampleUQ = sortedVector-> vec.f[ind];674 stats->sampleUQ = sortedVector->data.F32[ind]; 675 675 ind = (nValues / 4); 676 stats->sampleLQ = sortedVector-> vec.f[ind];676 stats->sampleLQ = sortedVector->data.F32[ind]; 677 677 678 678 // Free the temporary data structures. … … 765 765 UQBinNum = -1; 766 766 for (i=0;i<robustHistogram->nums->n;i++) { 767 if ((robustHistogram->nums-> vec.i32[i] <= stats->sampleLQ) &&768 (stats->sampleLQ <= robustHistogram->nums-> vec.i32[i])) {767 if ((robustHistogram->nums->data.S32[i] <= stats->sampleLQ) && 768 (stats->sampleLQ <= robustHistogram->nums->data.S32[i])) { 769 769 LQBinNum = i; 770 770 } 771 771 772 if ((robustHistogram->nums-> vec.i32[i] <= stats->sampleUQ) &&773 (stats->sampleUQ <= robustHistogram->nums-> vec.i32[i])) {772 if ((robustHistogram->nums->data.S32[i] <= stats->sampleUQ) && 773 (stats->sampleUQ <= robustHistogram->nums->data.S32[i])) { 774 774 UQBinNum = i; 775 775 } … … 778 778 // Determine the bin with the peak value in the range LQ to UQ. 779 779 maxBinNum = LQBinNum; 780 maxBinCount = robustHistogram->nums-> vec.i32[maxBinNum];780 maxBinCount = robustHistogram->nums->data.S32[maxBinNum]; 781 781 for (i=LQBinNum;i<=UQBinNum;i++) { 782 if (robustHistogram->nums-> vec.i32[i] > maxBinCount) {782 if (robustHistogram->nums->data.S32[i] > maxBinCount) { 783 783 maxBinNum = i; 784 maxBinCount = robustHistogram->nums-> vec.i32[i];784 maxBinCount = robustHistogram->nums->data.S32[i]; 785 785 } 786 786 } … … 843 843 if (maskVector != NULL) { 844 844 for (i=0;i<myVector->n;i++) { 845 if (!(maskVal & maskVector-> vec.ui8[i]) &&846 (rangeMin <= myVector-> vec.f[i]) &&847 (myVector-> vec.f[i] <= rangeMax)) {848 diff = myVector-> vec.f[i] - mean;845 if (!(maskVal & maskVector->data.U8[i]) && 846 (rangeMin <= myVector->data.F32[i]) && 847 (myVector->data.F32[i] <= rangeMax)) { 848 diff = myVector->data.F32[i] - mean; 849 849 sumSquares+= (diff * diff); 850 850 sumDiffs+= diff; … … 854 854 } else { 855 855 for (i=0;i<myVector->n;i++) { 856 if ((rangeMin <= myVector-> vec.f[i]) &&857 (myVector-> vec.f[i] <= rangeMax)) {858 diff = myVector-> vec.f[i] - mean;856 if ((rangeMin <= myVector->data.F32[i]) && 857 (myVector->data.F32[i] <= rangeMax)) { 858 diff = myVector->data.F32[i] - mean; 859 859 sumSquares+= (diff * diff); 860 860 sumDiffs+= diff; … … 867 867 if (maskVector != NULL) { 868 868 for (i=0;i<myVector->n;i++) { 869 if (!(maskVal & maskVector-> vec.ui8[i])) {870 diff = myVector-> vec.f[i] - mean;869 if (!(maskVal & maskVector->data.U8[i])) { 870 diff = myVector->data.F32[i] - mean; 871 871 sumSquares+= (diff * diff); 872 872 sumDiffs+= diff; … … 876 876 } else { 877 877 for (i=0;i<myVector->n;i++) { 878 diff = myVector-> vec.f[i] - mean;878 diff = myVector->data.F32[i] - mean; 879 879 sumSquares+= (diff * diff); 880 880 sumDiffs+= diff; … … 920 920 } 921 921 922 tmpMask = psVectorAlloc(m askVector->type.type, myVector->nalloc);922 tmpMask = psVectorAlloc(myVector->nalloc, maskVector->type.type); 923 923 924 924 tmpMask->n = maskVector->n; 925 925 for (i=0;i<tmpMask->n;i++) { 926 tmpMask-> vec.ui8[i] = maskVector->vec.ui8[i];926 tmpMask->data.U8[i] = maskVector->data.U8[i]; 927 927 } 928 928 … … 944 944 for (j=0;j<myVector->n;j++) { 945 945 // a) Exclude all values x_i for which |x_i - x| > K * stdev 946 if ( fabs(myVector-> vec.f[j] - clippedMean) >946 if ( fabs(myVector->data.F32[j] - clippedMean) > 947 947 (stats->clipSigma * clippedStdev)) { 948 tmpMask-> vec.ui8[i] = 0xff;948 tmpMask->data.U8[i] = 0xff; 949 949 } 950 950 // b) compute new mean and stdev … … 979 979 980 980 NOTE: The current strategy is to implement everything assuming that all 981 input data is of type PS_TYPE_F LOAT. Once the basic code is in place,982 we will macro-ize everything and add PS_TYPE_U INT16 and PS_TYPE_DOUBLE.981 input data is of type PS_TYPE_F32. Once the basic code is in place, 982 we will macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64. 983 983 984 984 *****************************************************************************/ … … 992 992 } 993 993 994 if (in->type.type != PS_TYPE_F LOAT) {994 if (in->type.type != PS_TYPE_F32) { 995 995 psAbort(__func__, 996 "Only data type PS_TYPE_F LOATis currently supported.");996 "Only data type PS_TYPE_F32 is currently supported."); 997 997 } 998 998 if (mask != NULL) { … … 1001 1001 "Vector data and vector mask are of different sizes."); 1002 1002 } 1003 if (mask->type.type != PS_TYPE_U INT8) {1003 if (mask->type.type != PS_TYPE_U8) { 1004 1004 psAbort(__func__, 1005 "Vector mask must be type PS_TYPE_U INT8");1005 "Vector mask must be type PS_TYPE_U8"); 1006 1006 } 1007 1007 } -
trunk/psLib/src/dataManip/psVectorFFT.c
r827 r831 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-06-02 03:02:48$7 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-06-02 23:29:21 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 448 448 numElements = in->n; 449 449 450 out = psVectorRecycle(out, PS_TYPE_C32,numElements);450 out = psVectorRecycle(out, numElements, PS_TYPE_C32); 451 451 452 452 if (type == PS_TYPE_F32) { 453 453 // need to convert to complex 454 psC32* outVec = out-> vec.cf;455 psF32* inVec = in-> vec.f;454 psC32* outVec = out->data.C32; 455 psF32* inVec = in->data.F32; 456 456 for (unsigned int i=0;i<numElements;i++) { 457 457 outVec[i] = inVec[i]; 458 458 } 459 459 } else { 460 psC32* outVec = out-> vec.cf;461 psC32* inVec = in-> vec.cf;460 psC32* outVec = out->data.C32; 461 psC32* inVec = in->data.C32; 462 462 for (unsigned int i=0;i<numElements;i++) { 463 463 outVec[i] = inVec[i]; … … 466 466 467 467 plan = fftwf_plan_dft_1d(numElements, 468 (fftwf_complex*)out-> vec.cf,469 (fftwf_complex*)out-> vec.cf,468 (fftwf_complex*)out->data.C32, 469 (fftwf_complex*)out->data.C32, 470 470 direction, 471 471 P_FFTW_PLAN_RIGOR); … … 504 504 psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. " 505 505 "Just a vector copy was performed."); 506 out = psVectorRecycle(out, type,numElements);507 memcpy(out-> vec.v,in->vec.v,numElements*PSELEMTYPE_SIZEOF(type));506 out = psVectorRecycle(out,numElements,type); 507 memcpy(out->data.V,in->data.V,numElements*PSELEMTYPE_SIZEOF(type)); 508 508 return out; 509 509 } … … 511 511 if (type == PS_TYPE_C32) { 512 512 psF32* outVec; 513 psC32* inVec = in-> vec.cf;514 515 out = psVectorRecycle(out, PS_TYPE_F32,numElements);516 outVec = out-> vec.f;513 psC32* inVec = in->data.C32; 514 515 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 516 outVec = out->data.F32; 517 517 518 518 for (unsigned int i=0;i<numElements;i++) { … … 548 548 "A zeroed vector was returned."); 549 549 out = psVectorRecycle(out,numElements,type); 550 memset(out-> vec.v,0,PSELEMTYPE_SIZEOF(type)*numElements);550 memset(out->data.V,0,PSELEMTYPE_SIZEOF(type)*numElements); 551 551 return out; 552 552 } … … 554 554 if (type == PS_TYPE_C32) { 555 555 psF32* outVec; 556 psC32* inVec = in-> vec.cf;557 558 out = psVectorRecycle(out, PS_TYPE_F32,numElements);559 outVec = out-> vec.f;556 psC32* inVec = in->data.C32; 557 558 out = psVectorRecycle(out,numElements, PS_TYPE_F32); 559 outVec = out->data.F32; 560 560 561 561 for (unsigned int i=0;i<numElements;i++) { … … 601 601 if (type == PS_TYPE_F32) { 602 602 psC32* outVec; 603 psF32* realVec = real-> vec.f;604 psF32* imagVec = imag-> vec.f;605 606 out = psVectorRecycle(out, PS_TYPE_C32,numElements);607 outVec = out-> vec.cf;603 psF32* realVec = real->data.F32; 604 psF32* imagVec = imag->data.F32; 605 606 out = psVectorRecycle(out,numElements, PS_TYPE_C32); 607 outVec = out->data.C32; 608 608 609 609 for (unsigned int i=0;i<numElements;i++) { … … 639 639 "Vector copy was performed instead."); 640 640 641 out = psVectorRecycle(out, type,numElements);642 memcpy(out-> vec.v,in->vec.v,PSELEMTYPE_SIZEOF(type)*numElements);641 out = psVectorRecycle(out,numElements,type); 642 memcpy(out->data.V,in->data.V,PSELEMTYPE_SIZEOF(type)*numElements); 643 643 return out; 644 644 } … … 646 646 if (type == PS_TYPE_C32) { 647 647 psC32* outVec; 648 psC32* inVec = in-> vec.cf;649 650 out = psVectorRecycle(out, PS_TYPE_C32,numElements);651 outVec = out-> vec.cf;648 psC32* inVec = in->data.C32; 649 650 out = psVectorRecycle(out,numElements,PS_TYPE_C32); 651 outVec = out->data.C32; 652 652 653 653 for (unsigned int i=0;i<numElements;i++) { … … 686 686 if (type == PS_TYPE_C32) { 687 687 psF32* outVec; 688 psC32* inVec = in-> vec.cf;688 psC32* inVec = in->data.C32; 689 689 psF32 real; 690 690 psF32 imag; 691 691 692 692 693 out = psVectorRecycle(out, PS_TYPE_F32,numElements);694 outVec = out-> vec.f;693 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 694 outVec = out->data.F32; 695 695 696 696 for (unsigned int i=0;i<numElements;i++) { -
trunk/psLib/src/fft/psVectorFFT.c
r827 r831 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-06-02 03:02:48$7 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-06-02 23:29:21 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 448 448 numElements = in->n; 449 449 450 out = psVectorRecycle(out, PS_TYPE_C32,numElements);450 out = psVectorRecycle(out, numElements, PS_TYPE_C32); 451 451 452 452 if (type == PS_TYPE_F32) { 453 453 // need to convert to complex 454 psC32* outVec = out-> vec.cf;455 psF32* inVec = in-> vec.f;454 psC32* outVec = out->data.C32; 455 psF32* inVec = in->data.F32; 456 456 for (unsigned int i=0;i<numElements;i++) { 457 457 outVec[i] = inVec[i]; 458 458 } 459 459 } else { 460 psC32* outVec = out-> vec.cf;461 psC32* inVec = in-> vec.cf;460 psC32* outVec = out->data.C32; 461 psC32* inVec = in->data.C32; 462 462 for (unsigned int i=0;i<numElements;i++) { 463 463 outVec[i] = inVec[i]; … … 466 466 467 467 plan = fftwf_plan_dft_1d(numElements, 468 (fftwf_complex*)out-> vec.cf,469 (fftwf_complex*)out-> vec.cf,468 (fftwf_complex*)out->data.C32, 469 (fftwf_complex*)out->data.C32, 470 470 direction, 471 471 P_FFTW_PLAN_RIGOR); … … 504 504 psLogMsg(__func__,PS_LOG_WARN,"Real portion of a non-Complex type called called for. " 505 505 "Just a vector copy was performed."); 506 out = psVectorRecycle(out, type,numElements);507 memcpy(out-> vec.v,in->vec.v,numElements*PSELEMTYPE_SIZEOF(type));506 out = psVectorRecycle(out,numElements,type); 507 memcpy(out->data.V,in->data.V,numElements*PSELEMTYPE_SIZEOF(type)); 508 508 return out; 509 509 } … … 511 511 if (type == PS_TYPE_C32) { 512 512 psF32* outVec; 513 psC32* inVec = in-> vec.cf;514 515 out = psVectorRecycle(out, PS_TYPE_F32,numElements);516 outVec = out-> vec.f;513 psC32* inVec = in->data.C32; 514 515 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 516 outVec = out->data.F32; 517 517 518 518 for (unsigned int i=0;i<numElements;i++) { … … 548 548 "A zeroed vector was returned."); 549 549 out = psVectorRecycle(out,numElements,type); 550 memset(out-> vec.v,0,PSELEMTYPE_SIZEOF(type)*numElements);550 memset(out->data.V,0,PSELEMTYPE_SIZEOF(type)*numElements); 551 551 return out; 552 552 } … … 554 554 if (type == PS_TYPE_C32) { 555 555 psF32* outVec; 556 psC32* inVec = in-> vec.cf;557 558 out = psVectorRecycle(out, PS_TYPE_F32,numElements);559 outVec = out-> vec.f;556 psC32* inVec = in->data.C32; 557 558 out = psVectorRecycle(out,numElements, PS_TYPE_F32); 559 outVec = out->data.F32; 560 560 561 561 for (unsigned int i=0;i<numElements;i++) { … … 601 601 if (type == PS_TYPE_F32) { 602 602 psC32* outVec; 603 psF32* realVec = real-> vec.f;604 psF32* imagVec = imag-> vec.f;605 606 out = psVectorRecycle(out, PS_TYPE_C32,numElements);607 outVec = out-> vec.cf;603 psF32* realVec = real->data.F32; 604 psF32* imagVec = imag->data.F32; 605 606 out = psVectorRecycle(out,numElements, PS_TYPE_C32); 607 outVec = out->data.C32; 608 608 609 609 for (unsigned int i=0;i<numElements;i++) { … … 639 639 "Vector copy was performed instead."); 640 640 641 out = psVectorRecycle(out, type,numElements);642 memcpy(out-> vec.v,in->vec.v,PSELEMTYPE_SIZEOF(type)*numElements);641 out = psVectorRecycle(out,numElements,type); 642 memcpy(out->data.V,in->data.V,PSELEMTYPE_SIZEOF(type)*numElements); 643 643 return out; 644 644 } … … 646 646 if (type == PS_TYPE_C32) { 647 647 psC32* outVec; 648 psC32* inVec = in-> vec.cf;649 650 out = psVectorRecycle(out, PS_TYPE_C32,numElements);651 outVec = out-> vec.cf;648 psC32* inVec = in->data.C32; 649 650 out = psVectorRecycle(out,numElements,PS_TYPE_C32); 651 outVec = out->data.C32; 652 652 653 653 for (unsigned int i=0;i<numElements;i++) { … … 686 686 if (type == PS_TYPE_C32) { 687 687 psF32* outVec; 688 psC32* inVec = in-> vec.cf;688 psC32* inVec = in->data.C32; 689 689 psF32 real; 690 690 psF32 imag; 691 691 692 692 693 out = psVectorRecycle(out, PS_TYPE_F32,numElements);694 outVec = out-> vec.f;693 out = psVectorRecycle(out,numElements,PS_TYPE_F32); 694 outVec = out->data.F32; 695 695 696 696 for (unsigned int i=0;i<numElements;i++) { -
trunk/psLib/src/image/psImage.h
r824 r831 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-06-0 1 22:42:57$11 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-06-02 23:29:14 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 46 46 47 47 union { 48 psU8 **U8; ///< unsigned 8-bit integer data.49 psU16 **U16; ///< unsigned 16-bit integer data.50 psU32 **U32; ///< unsigned 32-bit integer data.51 psU64 **U64; ///< unsigned 64-bit integer data.52 psS8 **S8; ///< signed 8-bit integer data.53 psS16 **S16; ///< signed 16-bit integer data.54 psS32 **S32; ///< signed 32-bit integer data.55 psS64 **S64; ///< signed 64-bit integer data.56 psF32 **F32; ///< single-precision float data.57 psF64 **F64; ///< double-precision float data.58 psC32 **C32; ///< single-precision complex data.59 psC64 **C64; ///< double-precision complex data.60 psPTR **PTR; ///< void pointers61 void **V; ///< pointer to data48 psU8 **U8; ///< Unsigned 8-bit integer data. 49 psU16 **U16; ///< Unsigned 16-bit integer data. 50 psU32 **U32; ///< Unsigned 32-bit integer data. 51 psU64 **U64; ///< Unsigned 64-bit integer data. 52 psS8 **S8; ///< Signed 8-bit integer data. 53 psS16 **S16; ///< Signed 16-bit integer data. 54 psS32 **S32; ///< Signed 32-bit integer data. 55 psS64 **S64; ///< Signed 64-bit integer data. 56 psF32 **F32; ///< Single-precision float data. 57 psF64 **F64; ///< Double-precision float data. 58 psC32 **C32; ///< Single-precision complex data. 59 psC64 **C64; ///< Double-precision complex data. 60 psPTR **PTR; ///< Void pointers. 61 psPTR *V; ///< Pointer to data. 62 62 } data; ///< Union for data types. 63 63 const struct psImage *parent; ///< Parent, if a subimage. -
trunk/psLib/src/image/psImageStats.c
r797 r831 31 31 32 32 // GUS: figure out mask types 33 junkData-> vec.f= (float *) in->data.F32;34 junkMask-> vec.f= (float *) mask->data.F32;33 junkData->data.F32 = (float *) in->data.F32; 34 junkMask->data.F32 = (float *) mask->data.F32; 35 35 stats = psVectorStats(stats, junkData, junkMask, maskVal); 36 36 … … 57 57 58 58 // GUS: figure out mask types 59 junkData-> vec.f= (float *) in->data.F32;60 junkMask-> vec.f= (float *) mask->data.F32;59 junkData->data.F32 = (float *) in->data.F32; 60 junkMask->data.F32 = (float *) mask->data.F32; 61 61 62 62 out = psHistogramVector(out, junkData, junkMask, maskVal); -
trunk/psLib/src/imageops/psImageStats.c
r797 r831 31 31 32 32 // GUS: figure out mask types 33 junkData-> vec.f= (float *) in->data.F32;34 junkMask-> vec.f= (float *) mask->data.F32;33 junkData->data.F32 = (float *) in->data.F32; 34 junkMask->data.F32 = (float *) mask->data.F32; 35 35 stats = psVectorStats(stats, junkData, junkMask, maskVal); 36 36 … … 57 57 58 58 // GUS: figure out mask types 59 junkData-> vec.f= (float *) in->data.F32;60 junkMask-> vec.f= (float *) mask->data.F32;59 junkData->data.F32 = (float *) in->data.F32; 60 junkMask->data.F32 = (float *) mask->data.F32; 61 61 62 62 out = psHistogramVector(out, junkData, junkMask, maskVal); -
trunk/psLib/src/math/psMatrix.c
r824 r831 20 20 * @author Ross Harman, MHPCC 21 21 * 22 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $23 * @date $Date: 2004-06-0 1 22:42:57$22 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2004-06-02 23:29:21 $ 24 24 * 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 70 70 /** Preprocessor macro to generate error a NULL image */ 71 71 #define PS_CHECK_NULL_VECTOR(NAME, RETURN) \ 72 if (NAME == NULL || NAME-> vec.v== NULL) { \72 if (NAME == NULL || NAME->data.V == NULL) { \ 73 73 psError(__func__,"Invalid operation: %s or its data is NULL.", #NAME); \ 74 74 return RETURN; \ … … 78 78 #define PS_CHECK_ALLOC_VECTOR(NAME, SIZE, PS_TYPE) \ 79 79 if(NAME == NULL) { \ 80 NAME = psVectorAlloc( PS_TYPE, SIZE); \80 NAME = psVectorAlloc(SIZE, PS_TYPE); \ 81 81 } 82 82 … … 173 173 perm.size = numCols; 174 174 outPerm->n = numCols; 175 perm.data = outPerm-> vec.v;175 perm.data = outPerm->data.V; 176 176 PS_GSL_MATRIX_INITIALIZE(lu, outImage->data.V[0]); 177 177 … … 226 226 227 227 perm.size = inPerm->n; 228 perm.data = inPerm-> vec.v;228 perm.data = inPerm->data.V; 229 229 230 230 b.size = inVector->n; 231 231 b.stride = 1; 232 b.data = inVector-> vec.v;232 b.data = inVector->data.V; 233 233 234 234 x.size = numCols; 235 235 x.stride = 1; 236 x.data = outVector-> vec.v;236 x.data = outVector->data.V; 237 237 238 238 // Solve for {x} in equation: {b} = [A]{x} … … 483 483 484 484 colSize = PSELEMTYPE_SIZEOF(inImage->type.type)*inImage->numRows; 485 memcpy(outVector-> vec.v, inImage->data.V[0], colSize);485 memcpy(outVector->data.V, inImage->data.V[0], colSize); 486 486 487 487 return outVector; … … 510 510 511 511 colSize = PSELEMTYPE_SIZEOF(outImage->type.type)*outImage->numRows; 512 memcpy(outImage->data.V[0], inVector-> vec.v, colSize);512 memcpy(outImage->data.V[0], inVector->data.V, colSize); 513 513 514 514 return outImage; -
trunk/psLib/src/math/psPolynomial.c
r822 r831 6 6 * @author George Gusciora, MHPCC 7 7 * 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-0 1 22:24:55$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-02 23:29:21 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 75 75 int i = 0; 76 76 77 gauss = psVectorAlloc(Npts, PS_TYPE_F LOAT);77 gauss = psVectorAlloc(Npts, PS_TYPE_F32); 78 78 gsl_rng_env_setup(); 79 79 T = gsl_rng_default; … … 81 81 82 82 for (i = 0; i < Npts; i++) { 83 gauss-> vec.f[i] = mean + gsl_ran_gaussian(r, sigma);83 gauss->data.F32[i] = mean + gsl_ran_gaussian(r, sigma); 84 84 } 85 85 -
trunk/psLib/src/math/psSpline.c
r822 r831 6 6 * @author George Gusciora, MHPCC 7 7 * 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-06-0 1 22:24:55$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-02 23:29:21 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 75 75 int i = 0; 76 76 77 gauss = psVectorAlloc(Npts, PS_TYPE_F LOAT);77 gauss = psVectorAlloc(Npts, PS_TYPE_F32); 78 78 gsl_rng_env_setup(); 79 79 T = gsl_rng_default; … … 81 81 82 82 for (i = 0; i < Npts; i++) { 83 gauss-> vec.f[i] = mean + gsl_ran_gaussian(r, sigma);83 gauss->data.F32[i] = mean + gsl_ran_gaussian(r, sigma); 84 84 } 85 85 -
trunk/psLib/src/math/psStats.c
r797 r831 86 86 87 87 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 88 newHist->bounds = psVectorAlloc( PS_TYPE_FLOAT, n+1);88 newHist->bounds = psVectorAlloc(n+1, PS_TYPE_F32); 89 89 binSize = (upper - lower) / (float) n; 90 90 for (i=0;i<n+1;i++) { 91 newHist->bounds-> vec.f[i] = lower + (binSize * (float) i);92 } 93 newHist->nums = psVectorAlloc( PS_TYPE_INT32, n);91 newHist->bounds->data.F32[i] = lower + (binSize * (float) i); 92 } 93 newHist->nums = psVectorAlloc(n, PS_TYPE_S32); 94 94 newHist->minNum = 0; 95 95 newHist->maxNum = 0; … … 106 106 107 107 newHist = (psHistogram *) psAlloc(sizeof(psHistogram)); 108 newHist->bounds = psVectorAlloc( PS_TYPE_FLOAT, bounds->n);108 newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32); 109 109 for (i=0;i<bounds->n;i++) { 110 newHist->bounds-> vec.f[i] = bounds->vec.f[i];111 } 112 newHist->nums = psVectorAlloc( PS_TYPE_INT32, (bounds->n)-1);110 newHist->bounds->data.F32[i] = bounds->data.F32[i]; 111 } 112 newHist->nums = psVectorAlloc((bounds->n)-1, PS_TYPE_S32); 113 113 114 114 newHist->minNum = 0; … … 152 152 for (i=0;i<in->n;i++) { 153 153 // Check if this pixel is masked, and if so, skip it. 154 if (!(mask-> vec.i32[i] & maskVal)) {154 if (!(mask->data.S32[i] & maskVal)) { 155 155 // Check if this pixel is below the minimum value, and if so 156 156 // count it, then skip it. 157 if (in-> vec.f[i] < out->bounds->vec.f[0]) {157 if (in->data.F32[i] < out->bounds->data.F32[0]) { 158 158 out->minNum++; 159 159 160 160 // Check if this pixel is above the maximum value, and if so 161 161 // count it, then skip it. 162 } else if (in-> vec.f[i] > out->bounds->vec.f[numBins]) {162 } else if (in->data.F32[i] > out->bounds->data.F32[numBins]) { 163 163 out->maxNum++; 164 164 } else { … … 166 166 // number is trivial. 167 167 if (out->uniform == true) { 168 binSize = out->bounds-> vec.f[1] - out->bounds->vec.f[0];169 170 binNum = (int) ((in-> vec.f[i] - out->bounds->vec.f[0]) /168 binSize = out->bounds->data.F32[1] - out->bounds->data.F32[0]; 169 170 binNum = (int) ((in->data.F32[i] - out->bounds->data.F32[0]) / 171 171 binSize); 172 (out->nums-> vec.i32[binNum])++;172 (out->nums->data.S32[binNum])++; 173 173 // If this is a non-uniform histogram, determining the correct 174 174 // bin number requires a bit more work. … … 177 177 // find the correct bin number (bin search, probably) 178 178 for (j=0;j<(out->bounds->n)-1;j++) { 179 if ((out->bounds-> vec.i32[j] <= in->vec.f[i]) &&180 (in-> vec.f[i] <= out->bounds->vec.i32[j+1])) {181 (out->nums-> vec.i32[j])++;179 if ((out->bounds->data.S32[j] <= in->data.F32[i]) && 180 (in->data.F32[i] <= out->bounds->data.S32[j+1])) { 181 (out->nums->data.S32[j])++; 182 182 } 183 183 } … … 198 198 for (i=0;i<myVector->n;i++) { 199 199 if (maskVector != NULL) 200 printf("Element %d is %f (mask is %d)\n", i, myVector-> vec.f[i], maskVector->vec.ui8[i]);200 printf("Element %d is %f (mask is %d)\n", i, myVector->data.F32[i], maskVector->data.U8[i]); 201 201 else 202 printf("Element %d is %f\n", i, myVector-> vec.f[i]);202 printf("Element %d is %f\n", i, myVector->data.F32[i]); 203 203 } 204 204 } … … 234 234 if (maskVector != NULL) { 235 235 for (i=0;i<myVector->n;i++) { 236 if (!(maskVal & maskVector-> vec.ui8[i]) &&237 (rangeMin <= myVector-> vec.f[i]) &&238 (myVector-> vec.f[i] <= rangeMax)) {239 mean+= myVector-> vec.f[i];236 if (!(maskVal & maskVector->data.U8[i]) && 237 (rangeMin <= myVector->data.F32[i]) && 238 (myVector->data.F32[i] <= rangeMax)) { 239 mean+= myVector->data.F32[i]; 240 240 count++; 241 241 } … … 244 244 } else { 245 245 for (i=0;i<myVector->n;i++) { 246 if ((rangeMin <= myVector-> vec.f[i]) &&247 (myVector-> vec.f[i] <= rangeMax)) {248 mean+= myVector-> vec.f[i];246 if ((rangeMin <= myVector->data.F32[i]) && 247 (myVector->data.F32[i] <= rangeMax)) { 248 mean+= myVector->data.F32[i]; 249 249 count++; 250 250 } … … 255 255 if (maskVector != NULL) { 256 256 for (i=0;i<myVector->n;i++) { 257 if (!(maskVal & maskVector-> vec.ui8[i])) {258 mean+= myVector-> vec.f[i];257 if (!(maskVal & maskVector->data.U8[i])) { 258 mean+= myVector->data.F32[i]; 259 259 count++; 260 260 } … … 263 263 } else { 264 264 for (i=0;i<myVector->n;i++) { 265 mean+= myVector-> vec.f[i];265 mean+= myVector->data.F32[i]; 266 266 } 267 267 mean/= (float) myVector->n; … … 287 287 if (maskVector != NULL) { 288 288 for (i=0;i<myVector->n;i++) { 289 if (!(maskVal & maskVector-> vec.ui8[i])) {290 if ((myVector-> vec.f[i] > max) &&291 (rangeMin <= myVector-> vec.f[i]) &&292 (myVector-> vec.f[i] <= rangeMax)) {293 max = myVector-> vec.f[i];289 if (!(maskVal & maskVector->data.U8[i])) { 290 if ((myVector->data.F32[i] > max) && 291 (rangeMin <= myVector->data.F32[i]) && 292 (myVector->data.F32[i] <= rangeMax)) { 293 max = myVector->data.F32[i]; 294 294 } 295 295 } … … 297 297 } else { 298 298 for (i=0;i<myVector->n;i++) { 299 if ((myVector-> vec.f[i] > max) &&300 (rangeMin <= myVector-> vec.f[i]) &&301 (myVector-> vec.f[i] <= rangeMax)) {302 max = myVector-> vec.f[i];299 if ((myVector->data.F32[i] > max) && 300 (rangeMin <= myVector->data.F32[i]) && 301 (myVector->data.F32[i] <= rangeMax)) { 302 max = myVector->data.F32[i]; 303 303 } 304 304 } … … 307 307 if (maskVector != NULL) { 308 308 for (i=0;i<myVector->n;i++) { 309 if (!(maskVal & maskVector-> vec.ui8[i])) {310 if (myVector-> vec.f[i] > max) {311 max = myVector-> vec.f[i];309 if (!(maskVal & maskVector->data.U8[i])) { 310 if (myVector->data.F32[i] > max) { 311 max = myVector->data.F32[i]; 312 312 } 313 313 } … … 315 315 } else { 316 316 for (i=0;i<myVector->n;i++) { 317 if (myVector-> vec.f[i] > max) {318 max = myVector-> vec.f[i];317 if (myVector->data.F32[i] > max) { 318 max = myVector->data.F32[i]; 319 319 } 320 320 } … … 340 340 if (maskVector != NULL) { 341 341 for (i=0;i<myVector->n;i++) { 342 if (!(maskVal & maskVector-> vec.ui8[i])) {343 if ((myVector-> vec.f[i] < min) &&344 (rangeMin <= myVector-> vec.f[i]) &&345 (myVector-> vec.f[i] <= rangeMax)) {346 min = myVector-> vec.f[i];342 if (!(maskVal & maskVector->data.U8[i])) { 343 if ((myVector->data.F32[i] < min) && 344 (rangeMin <= myVector->data.F32[i]) && 345 (myVector->data.F32[i] <= rangeMax)) { 346 min = myVector->data.F32[i]; 347 347 } 348 348 } … … 350 350 } else { 351 351 for (i=0;i<myVector->n;i++) { 352 if ((myVector-> vec.f[i] < min) &&353 (rangeMin <= myVector-> vec.f[i]) &&354 (myVector-> vec.f[i] <= rangeMax)) {355 min = myVector-> vec.f[i];352 if ((myVector->data.F32[i] < min) && 353 (rangeMin <= myVector->data.F32[i]) && 354 (myVector->data.F32[i] <= rangeMax)) { 355 min = myVector->data.F32[i]; 356 356 } 357 357 } … … 360 360 if (maskVector != NULL) { 361 361 for (i=0;i<myVector->n;i++) { 362 if (!(maskVal & maskVector-> vec.ui8[i])) {363 if (myVector-> vec.f[i] < min) {364 min = myVector-> vec.f[i];362 if (!(maskVal & maskVector->data.U8[i])) { 363 if (myVector->data.F32[i] < min) { 364 min = myVector->data.F32[i]; 365 365 } 366 366 } … … 368 368 } else { 369 369 for (i=0;i<myVector->n;i++) { 370 if (myVector-> vec.f[i] < min) {371 min = myVector-> vec.f[i];370 if (myVector->data.F32[i] < min) { 371 min = myVector->data.F32[i]; 372 372 } 373 373 } … … 397 397 if (maskVector != NULL) { 398 398 for (i=0;i<myVector->n;i++) { 399 if (!(maskVal & maskVector-> vec.ui8[i]) &&400 (rangeMin <= myVector-> vec.f[i]) &&401 (myVector-> vec.f[i] <= rangeMax)) {399 if (!(maskVal & maskVector->data.U8[i]) && 400 (rangeMin <= myVector->data.F32[i]) && 401 (myVector->data.F32[i] <= rangeMax)) { 402 402 numData++; 403 403 } … … 405 405 } else { 406 406 for (i=0;i<myVector->n;i++) { 407 if ((rangeMin <= myVector-> vec.f[i]) &&408 (myVector-> vec.f[i] <= rangeMax)) {407 if ((rangeMin <= myVector->data.F32[i]) && 408 (myVector->data.F32[i] <= rangeMax)) { 409 409 numData++; 410 410 } … … 416 416 if (maskVector != NULL) { 417 417 for (i=0;i<myVector->n;i++) { 418 if (!(maskVal & maskVector-> vec.ui8[i])) {418 if (!(maskVal & maskVector->data.U8[i])) { 419 419 numData++; 420 420 } … … 469 469 470 470 // Allocate temporary vectors for the data. 471 unsortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);471 unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 472 472 unsortedVector->n = unsortedVector->nalloc; 473 sortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);473 sortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 474 474 sortedVector->n = sortedVector->nalloc; 475 475 … … 484 484 if (maskVector != NULL) { 485 485 for (i=0;i<myVector->n;i++) { 486 if (!(maskVal & maskVector-> vec.ui8[i]) &&487 (rangeMin <= myVector-> vec.f[i]) &&488 (myVector-> vec.f[i] <= rangeMax)) {489 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];490 } 491 } 492 } else { 493 for (i=0;i<myVector->n;i++) { 494 if ((rangeMin <= myVector-> vec.f[i]) &&495 (myVector-> vec.f[i] <= rangeMax)) {496 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];486 if (!(maskVal & maskVector->data.U8[i]) && 487 (rangeMin <= myVector->data.F32[i]) && 488 (myVector->data.F32[i] <= rangeMax)) { 489 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 490 } 491 } 492 } else { 493 for (i=0;i<myVector->n;i++) { 494 if ((rangeMin <= myVector->data.F32[i]) && 495 (myVector->data.F32[i] <= rangeMax)) { 496 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 497 497 } 498 498 } … … 503 503 if (maskVector != NULL) { 504 504 for (i=0;i<myVector->n;i++) { 505 if (!(maskVal & maskVector-> vec.ui8[i])) {506 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];507 } 508 } 509 } else { 510 for (i=0;i<myVector->n;i++) { 511 unsortedVector-> vec.f[i] = maskVector->vec.f[i];505 if (!(maskVal & maskVector->data.U8[i])) { 506 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 507 } 508 } 509 } else { 510 for (i=0;i<myVector->n;i++) { 511 unsortedVector->data.F32[i] = maskVector->data.F32[i]; 512 512 } 513 513 } … … 518 518 // Calculate the median exactly. 519 519 if (0 == (nValues % 2)) { 520 stats->sampleMedian = 0.5 * (sortedVector-> vec.f[(nValues/2)-1] +521 sortedVector-> vec.f[nValues/2]);520 stats->sampleMedian = 0.5 * (sortedVector->data.F32[(nValues/2)-1] + 521 sortedVector->data.F32[nValues/2]); 522 522 } else { 523 stats->sampleMedian = sortedVector-> vec.f[nValues/2];523 stats->sampleMedian = sortedVector->data.F32[nValues/2]; 524 524 } 525 525 … … 569 569 for (j=-GAUSS_WIDTH;j<=+GAUSS_WIDTH;j++) { 570 570 if (((j+i) >= 0) && ((j+i) < robustHistogram->nums->n)) { 571 robustHistogram->nums-> vec.i32[j+i]+=571 robustHistogram->nums->data.S32[j+i]+= 572 572 (gaussianCoefs[j+GAUSS_WIDTH] * 573 (float) robustHistogram->nums-> vec.i32[j+i]);573 (float) robustHistogram->nums->data.S32[j+i]); 574 574 } 575 575 } … … 623 623 624 624 // Allocate temporary vectors for the data. 625 unsortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);625 unsortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 626 626 unsortedVector->n = unsortedVector->nalloc; 627 sortedVector = psVectorAlloc( PS_TYPE_FLOAT, nValues);627 sortedVector = psVectorAlloc(nValues, PS_TYPE_F32); 628 628 sortedVector->n = sortedVector->nalloc; 629 629 … … 637 637 if (maskVector != NULL) { 638 638 for (i=0;i<myVector->n;i++) { 639 if (!(maskVal & maskVector-> vec.ui8[i]) &&640 (rangeMin <= myVector-> vec.f[i]) &&641 (myVector-> vec.f[i] <= rangeMax)) {642 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];643 } 644 } 645 } else { 646 for (i=0;i<myVector->n;i++) { 647 if ((rangeMin <= myVector-> vec.f[i]) &&648 (myVector-> vec.f[i] <= rangeMax)) {649 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];639 if (!(maskVal & maskVector->data.U8[i]) && 640 (rangeMin <= myVector->data.F32[i]) && 641 (myVector->data.F32[i] <= rangeMax)) { 642 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 643 } 644 } 645 } else { 646 for (i=0;i<myVector->n;i++) { 647 if ((rangeMin <= myVector->data.F32[i]) && 648 (myVector->data.F32[i] <= rangeMax)) { 649 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 650 650 } 651 651 } … … 656 656 if (maskVector != NULL) { 657 657 for (i=0;i<myVector->n;i++) { 658 if (!(maskVal & maskVector-> vec.ui8[i])) {659 unsortedVector-> vec.f[count++] = maskVector->vec.f[i];660 } 661 } 662 } else { 663 for (i=0;i<myVector->n;i++) { 664 unsortedVector-> vec.f[i] = maskVector->vec.f[i];658 if (!(maskVal & maskVector->data.U8[i])) { 659 unsortedVector->data.F32[count++] = maskVector->data.F32[i]; 660 } 661 } 662 } else { 663 for (i=0;i<myVector->n;i++) { 664 unsortedVector->data.F32[i] = maskVector->data.F32[i]; 665 665 } 666 666 } … … 672 672 // Calculate the quartile points exactly. 673 673 ind = 3 * (nValues / 4); 674 stats->sampleUQ = sortedVector-> vec.f[ind];674 stats->sampleUQ = sortedVector->data.F32[ind]; 675 675 ind = (nValues / 4); 676 stats->sampleLQ = sortedVector-> vec.f[ind];676 stats->sampleLQ = sortedVector->data.F32[ind]; 677 677 678 678 // Free the temporary data structures. … … 765 765 UQBinNum = -1; 766 766 for (i=0;i<robustHistogram->nums->n;i++) { 767 if ((robustHistogram->nums-> vec.i32[i] <= stats->sampleLQ) &&768 (stats->sampleLQ <= robustHistogram->nums-> vec.i32[i])) {767 if ((robustHistogram->nums->data.S32[i] <= stats->sampleLQ) && 768 (stats->sampleLQ <= robustHistogram->nums->data.S32[i])) { 769 769 LQBinNum = i; 770 770 } 771 771 772 if ((robustHistogram->nums-> vec.i32[i] <= stats->sampleUQ) &&773 (stats->sampleUQ <= robustHistogram->nums-> vec.i32[i])) {772 if ((robustHistogram->nums->data.S32[i] <= stats->sampleUQ) && 773 (stats->sampleUQ <= robustHistogram->nums->data.S32[i])) { 774 774 UQBinNum = i; 775 775 } … … 778 778 // Determine the bin with the peak value in the range LQ to UQ. 779 779 maxBinNum = LQBinNum; 780 maxBinCount = robustHistogram->nums-> vec.i32[maxBinNum];780 maxBinCount = robustHistogram->nums->data.S32[maxBinNum]; 781 781 for (i=LQBinNum;i<=UQBinNum;i++) { 782 if (robustHistogram->nums-> vec.i32[i] > maxBinCount) {782 if (robustHistogram->nums->data.S32[i] > maxBinCount) { 783 783 maxBinNum = i; 784 maxBinCount = robustHistogram->nums-> vec.i32[i];784 maxBinCount = robustHistogram->nums->data.S32[i]; 785 785 } 786 786 } … … 843 843 if (maskVector != NULL) { 844 844 for (i=0;i<myVector->n;i++) { 845 if (!(maskVal & maskVector-> vec.ui8[i]) &&846 (rangeMin <= myVector-> vec.f[i]) &&847 (myVector-> vec.f[i] <= rangeMax)) {848 diff = myVector-> vec.f[i] - mean;845 if (!(maskVal & maskVector->data.U8[i]) && 846 (rangeMin <= myVector->data.F32[i]) && 847 (myVector->data.F32[i] <= rangeMax)) { 848 diff = myVector->data.F32[i] - mean; 849 849 sumSquares+= (diff * diff); 850 850 sumDiffs+= diff; … … 854 854 } else { 855 855 for (i=0;i<myVector->n;i++) { 856 if ((rangeMin <= myVector-> vec.f[i]) &&857 (myVector-> vec.f[i] <= rangeMax)) {858 diff = myVector-> vec.f[i] - mean;856 if ((rangeMin <= myVector->data.F32[i]) && 857 (myVector->data.F32[i] <= rangeMax)) { 858 diff = myVector->data.F32[i] - mean; 859 859 sumSquares+= (diff * diff); 860 860 sumDiffs+= diff; … … 867 867 if (maskVector != NULL) { 868 868 for (i=0;i<myVector->n;i++) { 869 if (!(maskVal & maskVector-> vec.ui8[i])) {870 diff = myVector-> vec.f[i] - mean;869 if (!(maskVal & maskVector->data.U8[i])) { 870 diff = myVector->data.F32[i] - mean; 871 871 sumSquares+= (diff * diff); 872 872 sumDiffs+= diff; … … 876 876 } else { 877 877 for (i=0;i<myVector->n;i++) { 878 diff = myVector-> vec.f[i] - mean;878 diff = myVector->data.F32[i] - mean; 879 879 sumSquares+= (diff * diff); 880 880 sumDiffs+= diff; … … 920 920 } 921 921 922 tmpMask = psVectorAlloc(m askVector->type.type, myVector->nalloc);922 tmpMask = psVectorAlloc(myVector->nalloc, maskVector->type.type); 923 923 924 924 tmpMask->n = maskVector->n; 925 925 for (i=0;i<tmpMask->n;i++) { 926 tmpMask-> vec.ui8[i] = maskVector->vec.ui8[i];926 tmpMask->data.U8[i] = maskVector->data.U8[i]; 927 927 } 928 928 … … 944 944 for (j=0;j<myVector->n;j++) { 945 945 // a) Exclude all values x_i for which |x_i - x| > K * stdev 946 if ( fabs(myVector-> vec.f[j] - clippedMean) >946 if ( fabs(myVector->data.F32[j] - clippedMean) > 947 947 (stats->clipSigma * clippedStdev)) { 948 tmpMask-> vec.ui8[i] = 0xff;948 tmpMask->data.U8[i] = 0xff; 949 949 } 950 950 // b) compute new mean and stdev … … 979 979 980 980 NOTE: The current strategy is to implement everything assuming that all 981 input data is of type PS_TYPE_F LOAT. Once the basic code is in place,982 we will macro-ize everything and add PS_TYPE_U INT16 and PS_TYPE_DOUBLE.981 input data is of type PS_TYPE_F32. Once the basic code is in place, 982 we will macro-ize everything and add PS_TYPE_U16 and PS_TYPE_F64. 983 983 984 984 *****************************************************************************/ … … 992 992 } 993 993 994 if (in->type.type != PS_TYPE_F LOAT) {994 if (in->type.type != PS_TYPE_F32) { 995 995 psAbort(__func__, 996 "Only data type PS_TYPE_F LOATis currently supported.");996 "Only data type PS_TYPE_F32 is currently supported."); 997 997 } 998 998 if (mask != NULL) { … … 1001 1001 "Vector data and vector mask are of different sizes."); 1002 1002 } 1003 if (mask->type.type != PS_TYPE_U INT8) {1003 if (mask->type.type != PS_TYPE_U8) { 1004 1004 psAbort(__func__, 1005 "Vector mask must be type PS_TYPE_U INT8");1005 "Vector mask must be type PS_TYPE_U8"); 1006 1006 } 1007 1007 } -
trunk/psLib/src/mathtypes/psImage.h
r824 r831 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-06-0 1 22:42:57$11 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-06-02 23:29:14 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 46 46 47 47 union { 48 psU8 **U8; ///< unsigned 8-bit integer data.49 psU16 **U16; ///< unsigned 16-bit integer data.50 psU32 **U32; ///< unsigned 32-bit integer data.51 psU64 **U64; ///< unsigned 64-bit integer data.52 psS8 **S8; ///< signed 8-bit integer data.53 psS16 **S16; ///< signed 16-bit integer data.54 psS32 **S32; ///< signed 32-bit integer data.55 psS64 **S64; ///< signed 64-bit integer data.56 psF32 **F32; ///< single-precision float data.57 psF64 **F64; ///< double-precision float data.58 psC32 **C32; ///< single-precision complex data.59 psC64 **C64; ///< double-precision complex data.60 psPTR **PTR; ///< void pointers61 void **V; ///< pointer to data48 psU8 **U8; ///< Unsigned 8-bit integer data. 49 psU16 **U16; ///< Unsigned 16-bit integer data. 50 psU32 **U32; ///< Unsigned 32-bit integer data. 51 psU64 **U64; ///< Unsigned 64-bit integer data. 52 psS8 **S8; ///< Signed 8-bit integer data. 53 psS16 **S16; ///< Signed 16-bit integer data. 54 psS32 **S32; ///< Signed 32-bit integer data. 55 psS64 **S64; ///< Signed 64-bit integer data. 56 psF32 **F32; ///< Single-precision float data. 57 psF64 **F64; ///< Double-precision float data. 58 psC32 **C32; ///< Single-precision complex data. 59 psC64 **C64; ///< Double-precision complex data. 60 psPTR **PTR; ///< Void pointers. 61 psPTR *V; ///< Pointer to data. 62 62 } data; ///< Union for data types. 63 63 const struct psImage *parent; ///< Parent, if a subimage. -
trunk/psLib/src/mathtypes/psVector.c
r811 r831 19 19 * @author Ross Harman, MHPCC 20 20 * 21 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-0 5-29 01:08:46$21 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 22 * @date $Date: 2004-06-02 23:29:14 $ 23 23 * 24 24 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 64 64 /* FUNCTION IMPLEMENTATION - PUBLIC */ 65 65 /*****************************************************************************/ 66 psVector* psVectorAlloc( psElemType elemType, unsigned int nalloc)66 psVector* psVectorAlloc(unsigned int nalloc, psElemType elemType) 67 67 { 68 68 psVector *psVec = NULL; … … 86 86 87 87 // Create vector data array 88 psVec-> vec.v= psAlloc(nalloc*elementSize);88 psVec->data.V = psAlloc(nalloc*elementSize); 89 89 90 90 return psVec; 91 91 } 92 92 93 psVector *psVectorRealloc( psVector *restrict in, unsigned int nalloc)93 psVector *psVectorRealloc(unsigned int nalloc, psVector *restrict in) 94 94 { 95 95 int elementSize = 0; … … 110 110 if (elemType == PS_TYPE_PTR) { 111 111 for (int i = nalloc; i < in->n; i++) { // For reduction in vector size 112 psMemDecrRefCounter(in-> vec.vp[i]);112 psMemDecrRefCounter(in->data.PTR[i]); 113 113 } 114 114 } … … 117 117 118 118 // Realloc after decrementation to avoid accessing freed array elements 119 in-> vec.v = psRealloc(in->vec.v,nalloc*elementSize);119 in->data.V = psRealloc(in->data.V,nalloc*elementSize); 120 120 in->nalloc = nalloc; 121 121 } … … 129 129 130 130 if (in == NULL) { 131 return psVectorAlloc( type,nalloc);131 return psVectorAlloc(nalloc, type); 132 132 } 133 133 … … 150 150 if (elemType == PS_TYPE_PTR) { 151 151 for (int i = 0; i < in->n; i++) { // For reduction in vector size 152 psMemDecrRefCounter(in-> vec.vp[i]);153 in-> vec.vp[i] = NULL;152 psMemDecrRefCounter(in->data.PTR[i]); 153 in->data.PTR[i] = NULL; 154 154 } 155 155 } 156 156 157 in-> vec.v = psRealloc(in->vec.v,nalloc*PSELEMTYPE_SIZEOF(elemType));157 in->data.V = psRealloc(in->data.V,nalloc*PSELEMTYPE_SIZEOF(elemType)); 158 158 159 159 in->n = 0; … … 170 170 } 171 171 172 psFree(psVec-> vec.v);172 psFree(psVec->data.V); 173 173 psFree(psVec); 174 174 } … … 188 188 for(int i = 0; i < psVec->nalloc; i++) { 189 189 if(elemFree == NULL) { 190 psMemDecrRefCounter(psVec-> vec.vp[i]);190 psMemDecrRefCounter(psVec->data.PTR[i]); 191 191 } else { 192 elemFree(psMemDecrRefCounter(psVec-> vec.vp[i]));192 elemFree(psMemDecrRefCounter(psVec->data.PTR[i])); 193 193 } 194 psVec-> vec.vp[i] = NULL;194 psVec->data.PTR[i] = NULL; 195 195 } 196 196 } -
trunk/psLib/src/mathtypes/psVector.h
r811 r831 1 1 /** @file psVector.h 2 2 * 3 * @brief Contains support for basic vector types3 * @brief Contains basic vector definitions and operations 4 4 * 5 * This file defines types and functions for one dimensional vectors which include: 6 * char 7 * short 8 * int 9 * long 10 * unsigned char 11 * unsigned short 12 * unsigned int 13 * unsigned long 14 * float 15 * double 16 * complex float 17 * void ** 5 * This file defines the basic type for a vector struct and functions useful 6 * in manupulating vectors. 18 7 * 8 * @author Robert DeSonia, MHPCC 19 9 * @author Ross Harman, MHPCC 20 10 * 21 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $22 * @date $Date: 2004-0 5-29 01:08:46$11 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-06-02 23:29:14 $ 23 13 * 24 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 32 43 33 union { 44 int8_t *i8; ///< Pointers to char integer data. 45 int16_t *i16; ///< Pointers to short integer data. 46 int32_t *i32; ///< Pointers to integer data. 47 int64_t *i64; ///< Pointers to long integer data. 48 uint8_t *ui8; ///< Pointers to unsigned char integer data. 49 uint16_t*ui16; ///< Pointers to unsigned short integer data. 50 uint32_t *ui32; ///< Pointers to unsigned integer data. 51 uint64_t *ui64; ///< Pointers to unsigned long integer data. 52 float *f; ///< Pointers to floating point data. 53 double *d; ///< Pointers to double precision data. 54 complex float *cf; ///< Pointers to complex floating point data. 55 void *v; ///< Pointers to generic void data 56 void **vp; ///< Void pointer vector. 57 }vec; ///< Union for data types. 34 psU8 *U8; ///< Unsigned 8-bit integer data. 35 psU16 *U16; ///< Unsigned 16-bit integer data. 36 psU32 *U32; ///< Unsigned 32-bit integer data. 37 psU64 *U64; ///< Unsigned 64-bit integer data. 38 psS8 *S8; ///< Signed 8-bit integer data. 39 psS16 *S16; ///< Signed 16-bit integer data. 40 psS32 *S32; ///< Signed 32-bit integer data. 41 psS64 *S64; ///< Signed 64-bit integer data. 42 psF32 *F32; ///< Single-precision float data. 43 psF64 *F64; ///< Double-precision float data. 44 psC32 *C32; ///< Single-precision complex data. 45 psC64 *C64; ///< Double-precision complex data. 46 psPTR *PTR; ///< Void pointers 47 psPTR V; ///< Pointer to data 48 } data; ///< Union for data types. 58 49 } 59 50 psVector; … … 71 62 */ 72 63 psVector *psVectorAlloc( 73 psElemType dataType, ///< Type of data to be held by vector.74 unsigned int nalloc ///< Total number of elements to make available.64 unsigned int nalloc, ///< Total number of elements to make available. 65 psElemType dataType ///< Type of data to be held by vector. 75 66 ); 76 67 … … 84 75 */ 85 76 psVector *psVectorRealloc( 86 psVector *restrict psVec, ///< Vector to reallocate.87 unsigned int nalloc ///< Total number of elements to make available.77 unsigned int nalloc, ///< Total number of elements to make available. 78 psVector *restrict psVec ///< Vector to reallocate. 88 79 ); 89 80 -
trunk/psLib/src/sys/psType.h
r813 r831 3 3 * @brief Contains support for basic types 4 4 * 5 * This file defines datatypes which include: 6 * char 7 * short 8 * int 9 * long 10 * unsigned char 11 * unsigned short 12 * unsigned int 13 * unsigned long 14 * float 15 * double 16 * complex float 17 * void ** 5 * This file defines common datatypes used throughout psLib. 18 6 * 19 7 * @author Robert DeSonia, MHPCC 20 8 * @author Ross Harman, MHPCC 21 9 * 22 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $23 * @date $Date: 2004-0 5-29 01:10:22$10 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-06-02 23:29:14 $ 24 12 * 25 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 59 47 60 48 typedef enum { 61 PS_TYPE_INT8 = 0x0101, ///< Character.62 PS_TYPE_INT16 = 0x0102, ///< Short integer.63 PS_TYPE_INT32 = 0x0104, ///< Integer.64 PS_TYPE_INT64 = 0x0108, ///< Long integer.65 PS_TYPE_UINT8 = 0x0301, ///< Unsigned character.66 PS_TYPE_UINT16 = 0x0302, ///< Unsigned short integer.67 PS_TYPE_UINT32 = 0x0304, ///< Unsigned integer.68 PS_TYPE_UINT64 = 0x0308, ///< Unsigned long integer.69 PS_TYPE_FLOAT = 0x0404, ///< Single-precision Floating point.70 PS_TYPE_DOUBLE = 0x0408, ///< Double-precision floating point.71 PS_TYPE_COMPLEX_FLOAT = 0x0808, ///< Complex numbers consisting of single-precision floating point.72 PS_TYPE_COMPLEX_DOUBLE = 0x0810, ///< Complex numbers consisting of double-precision floating point.73 PS_TYPE_OTHER = 0x0000, ///< Something else that's not supported for arithmetic.74 75 // Abbreviated versions of the above types76 49 PS_TYPE_S8 = 0x0101, ///< Character. 77 50 PS_TYPE_S16 = 0x0102, ///< Short integer. … … 87 60 PS_TYPE_C64 = 0x0810, ///< Complex numbers consisting of double-precision floating point. 88 61 PS_TYPE_PTR = 0x0000 ///< Something else that's not supported for arithmetic. 89 90 62 } psElemType; 91 63 -
trunk/psLib/src/sysUtils/psType.h
r813 r831 3 3 * @brief Contains support for basic types 4 4 * 5 * This file defines datatypes which include: 6 * char 7 * short 8 * int 9 * long 10 * unsigned char 11 * unsigned short 12 * unsigned int 13 * unsigned long 14 * float 15 * double 16 * complex float 17 * void ** 5 * This file defines common datatypes used throughout psLib. 18 6 * 19 7 * @author Robert DeSonia, MHPCC 20 8 * @author Ross Harman, MHPCC 21 9 * 22 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $23 * @date $Date: 2004-0 5-29 01:10:22$10 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-06-02 23:29:14 $ 24 12 * 25 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 59 47 60 48 typedef enum { 61 PS_TYPE_INT8 = 0x0101, ///< Character.62 PS_TYPE_INT16 = 0x0102, ///< Short integer.63 PS_TYPE_INT32 = 0x0104, ///< Integer.64 PS_TYPE_INT64 = 0x0108, ///< Long integer.65 PS_TYPE_UINT8 = 0x0301, ///< Unsigned character.66 PS_TYPE_UINT16 = 0x0302, ///< Unsigned short integer.67 PS_TYPE_UINT32 = 0x0304, ///< Unsigned integer.68 PS_TYPE_UINT64 = 0x0308, ///< Unsigned long integer.69 PS_TYPE_FLOAT = 0x0404, ///< Single-precision Floating point.70 PS_TYPE_DOUBLE = 0x0408, ///< Double-precision floating point.71 PS_TYPE_COMPLEX_FLOAT = 0x0808, ///< Complex numbers consisting of single-precision floating point.72 PS_TYPE_COMPLEX_DOUBLE = 0x0810, ///< Complex numbers consisting of double-precision floating point.73 PS_TYPE_OTHER = 0x0000, ///< Something else that's not supported for arithmetic.74 75 // Abbreviated versions of the above types76 49 PS_TYPE_S8 = 0x0101, ///< Character. 77 50 PS_TYPE_S16 = 0x0102, ///< Short integer. … … 87 60 PS_TYPE_C64 = 0x0810, ///< Complex numbers consisting of double-precision floating point. 88 61 PS_TYPE_PTR = 0x0000 ///< Something else that's not supported for arithmetic. 89 90 62 } psElemType; 91 63 -
trunk/psLib/test/collections/tst_psSort_01.c
r717 r831 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 5-18 19:22:34$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-06-02 23:29:29 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 // Test A - Create float vectors 30 30 printPositiveTestHeader(stdout,"psSort", "Create float vectors"); 31 in = psVectorAlloc( PS_TYPE_FLOAT, 5);31 in = psVectorAlloc(5, PS_TYPE_F32); 32 32 in->n = 5; 33 out = psVectorAlloc( PS_TYPE_FLOAT, 5);33 out = psVectorAlloc(5, PS_TYPE_F32); 34 34 out->n = 5; 35 in-> vec.f[0] = 7.0f;36 in-> vec.f[1] = 9.0f;37 in-> vec.f[2] = 3.0f;38 in-> vec.f[3] = 1.0f;39 in-> vec.f[4] = 5.0f;35 in->data.F32[0] = 7.0f; 36 in->data.F32[1] = 9.0f; 37 in->data.F32[2] = 3.0f; 38 in->data.F32[3] = 1.0f; 39 in->data.F32[4] = 5.0f; 40 40 for(int i=0; i<5; i++) { 41 printf("vec[%d] = %f\n", i, in-> vec.f[i]);41 printf("vec[%d] = %f\n", i, in->data.F32[i]); 42 42 } 43 43 printFooter(stdout, "psSort", "Create float vectors", true); … … 48 48 out = psSort(out, in); 49 49 for(int i=0; i<5; i++) { 50 printf("vec[%d] = %f\n", i, out-> vec.f[i]);50 printf("vec[%d] = %f\n", i, out->data.F32[i]); 51 51 } 52 52 printFooter(stdout, "psSort", "Sort float vector", true); -
trunk/psLib/test/collections/tst_psSort_02.c
r717 r831 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 5-18 19:22:34$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-06-02 23:29:29 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 // Test A - Create float vectors 30 30 printPositiveTestHeader(stdout,"psSort", "Create vectors"); 31 in = psVectorAlloc( PS_TYPE_FLOAT, 5);31 in = psVectorAlloc(5, PS_TYPE_F32); 32 32 in->n = 5; 33 out = psVectorAlloc( PS_TYPE_INT32, 5);33 out = psVectorAlloc(5, PS_TYPE_F32); 34 34 out->n = 5; 35 in-> vec.f[0] = 7.0f;36 in-> vec.f[1] = 9.0f;37 in-> vec.f[2] = 3.0f;38 in-> vec.f[3] = 1.0f;39 in-> vec.f[4] = 5.0f;35 in->data.F32[0] = 7.0f; 36 in->data.F32[1] = 9.0f; 37 in->data.F32[2] = 3.0f; 38 in->data.F32[3] = 1.0f; 39 in->data.F32[4] = 5.0f; 40 40 for(int i=0; i<5; i++) { 41 printf("arr[%d] = %f\n", i, in-> vec.f[i]);41 printf("arr[%d] = %f\n", i, in->data.F32[i]); 42 42 } 43 43 printFooter(stdout, "psSort", "Create vectors", true); … … 48 48 out = psSortIndex(out, in); 49 49 for(int i=0; i<5; i++) { 50 printf("arr[%d] = %d\n", i, out-> vec.i32[i]);50 printf("arr[%d] = %d\n", i, out->data.S32[i]); 51 51 } 52 52 printFooter(stdout, "psSort", "Create sorted index vector", true); -
trunk/psLib/test/collections/tst_psSort_03.c
r717 r831 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 5-18 19:22:34$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-06-02 23:29:29 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 // Test A - Create float vectors 30 30 printPositiveTestHeader(stdout,"psSort", "Create float vectors of different sizes"); 31 in = psVectorAlloc( PS_TYPE_FLOAT, 5);31 in = psVectorAlloc(5, PS_TYPE_F32); 32 32 in->n = 5; 33 out = psVectorAlloc( PS_TYPE_FLOAT, 6);33 out = psVectorAlloc(6, PS_TYPE_F32); 34 34 out->n = 6; 35 35 in->n = 5; 36 36 for(int i=0; i<5; i++) { 37 printf("arr[%d] = %f\n", i, in-> vec.f[i]);37 printf("arr[%d] = %f\n", i, in->data.F32[i]); 38 38 } 39 39 printFooter(stdout, "psSort", "Create float vectors of different sizes", true); -
trunk/psLib/test/collections/tst_psSort_04.c
r717 r831 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 5-18 19:22:34$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-06-02 23:29:29 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 psVector *badIn = NULL; 26 26 psVector *badOut = NULL; 27 psVector *goodIn = psVectorAlloc( PS_TYPE_FLOAT, 5);28 psVector *goodOut = psVectorAlloc( PS_TYPE_FLOAT, 5);27 psVector *goodIn = psVectorAlloc(5, PS_TYPE_F32); 28 psVector *goodOut = psVectorAlloc(5, PS_TYPE_F32); 29 29 30 30 // Test A - Attempt to sort with null input vector -
trunk/psLib/test/collections/tst_psVector_01.c
r717 r831 4 4 * 5 5 * This test driver contains the following tests for psVector test point 1: 6 * A) Create INT32 vector7 * B) Add data to INT32 vector8 * C) Reallocate INT32 vector bigger9 * D) Reallocate INT32 vector smaller10 * E) Free INT32 vector6 * A) Create S32 vector 7 * B) Add data to S32 vector 8 * C) Reallocate S32 vector bigger 9 * D) Reallocate S32 vector smaller 10 * E) Free S32 vector 11 11 * 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 5-18 19:22:34$14 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-06-02 23:29:29 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 28 28 29 // Test A - Create INT32 vector30 printPositiveTestHeader(stdout,"psVector", "Create INT32 vector");31 psVector *psVec = psVectorAlloc( PS_TYPE_INT32, 5);29 // Test A - Create S32 vector 30 printPositiveTestHeader(stdout,"psVector", "Create S32 vector"); 31 psVector *psVec = psVectorAlloc(5, PS_TYPE_S32); 32 32 printf("Vector size = %d\n", psVec->nalloc); 33 33 printf("Vector population = %d\n", psVec->n); 34 printFooter(stdout, "psVector", "Create INT32 vector", true);34 printFooter(stdout, "psVector", "Create S32 vector", true); 35 35 36 36 37 37 // Test B - Add data to integer vector 38 printPositiveTestHeader(stdout, "psVector", "Add data to INT32 vector");38 printPositiveTestHeader(stdout, "psVector", "Add data to S32 vector"); 39 39 for(int i = 0; i < 5; i++) { 40 psVec-> vec.i32[i] = i*10;40 psVec->data.S32[i] = i*10; 41 41 psVec->n++; 42 printf("Elem %d = %d\n", i, psVec-> vec.i32[i]);42 printf("Elem %d = %d\n", i, psVec->data.S32[i]); 43 43 } 44 44 printf("Vector size = %d\n", psVec->nalloc); 45 45 printf("Vector population = %d\n", psVec->n); 46 printFooter(stdout, "psVector", "Add data to INT32 vector", true);46 printFooter(stdout, "psVector", "Add data to S32 vector", true); 47 47 48 48 49 // Test C - Reallocate INT32 vector bigger50 printPositiveTestHeader(stdout,"psVector", "Reallocate INT32 vector bigger");51 psVec = psVectorRealloc( psVec, 10);52 printf("Adding more elements to INT32 vector...\n");49 // Test C - Reallocate S32 vector bigger 50 printPositiveTestHeader(stdout,"psVector", "Reallocate S32 vector bigger"); 51 psVec = psVectorRealloc(10, psVec); 52 printf("Adding more elements to S32 vector...\n"); 53 53 for(int i = 5; i < 10; i++) { 54 psVec-> vec.i32[i] = i*10;54 psVec->data.S32[i] = i*10; 55 55 psVec->n++; 56 printf("Elem %d = %d\n", i, psVec-> vec.i32[i]);56 printf("Elem %d = %d\n", i, psVec->data.S32[i]); 57 57 } 58 58 printf("Vector size = %d\n", psVec->nalloc); 59 59 printf("Vector population = %d\n", psVec->n); 60 printFooter(stdout, "psVector", "Reallocate INT32 vector bigger", true);60 printFooter(stdout, "psVector", "Reallocate S32 vector bigger", true); 61 61 62 62 63 // Test D - Reallocate INT32 vector smaller64 printPositiveTestHeader(stdout,"psVector","Reallocate INT32 vector smaller");65 psVec = psVectorRealloc( psVec, 3);63 // Test D - Reallocate S32 vector smaller 64 printPositiveTestHeader(stdout,"psVector","Reallocate S32 vector smaller"); 65 psVec = psVectorRealloc(3, psVec); 66 66 printf("Vector size = %d\n", psVec->nalloc); 67 67 for(int i = 0; i < 3; i++) { 68 printf("Elem %d = %d\n", i, psVec-> vec.i32[i]);68 printf("Elem %d = %d\n", i, psVec->data.S32[i]); 69 69 } 70 70 printf("Vector size = %d\n", psVec->nalloc); 71 71 printf("Vector population = %d\n", psVec->n); 72 printFooter(stdout, "psVector", "Reallocate integer INT32 smaller", true);72 printFooter(stdout, "psVector", "Reallocate integer S32 smaller", true); 73 73 74 74 75 // Test E - Free INT32 vector76 printPositiveTestHeader(stdout, "psVector", "Free INT32 vector");75 // Test E - Free S32 vector 76 printPositiveTestHeader(stdout, "psVector", "Free S32 vector"); 77 77 psVectorFree(psVec); 78 78 psMemCheckLeaks(0, NULL, stdout); … … 81 81 printf("ERROR: Found %d bad memory blocks\n", nBad); 82 82 } 83 printFooter(stdout, "psVector" ,"Free INT32 vector", true);83 printFooter(stdout, "psVector" ,"Free S32 vector", true); 84 84 85 85 return 0; -
trunk/psLib/test/collections/tst_psVector_02.c
r717 r831 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 5-18 19:22:34$14 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-06-02 23:29:29 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 39 39 // Test A - Create void pointer vector 40 40 printPositiveTestHeader(stdout,"psVector", "Create void pointer vector"); 41 psVector *psVec = psVectorAlloc( PS_TYPE_PTR, 5);41 psVector *psVec = psVectorAlloc(5, PS_TYPE_PTR); 42 42 printf("Vector size = %d\n", psVec->nalloc); 43 43 printf("Vector population = %d\n", psVec->n); … … 52 52 ts->y = 10.1*i; 53 53 mySt[i] = ts; 54 psVec-> vec.vp[i] = ts;54 psVec->data.PTR[i] = ts; 55 55 psVec->n++; 56 56 psMemIncrRefCounter(ts); … … 58 58 59 59 for(int i = 0; i < 5; i++) { 60 testStruct *ts = (testStruct*)psVec-> vec.vp[i];60 testStruct *ts = (testStruct*)psVec->data.PTR[i]; 61 61 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 62 62 } … … 68 68 // Test C - Reallocate void pointer vector bigger 69 69 printPositiveTestHeader(stdout,"psVector", "Reallocate void pointer vector bigger"); 70 psVec = psVectorRealloc( psVec, 10);70 psVec = psVectorRealloc(10, psVec); 71 71 printf("Adding more elements to void pointer vector...\n"); 72 72 for(int i = 5; i < 10; i++) { … … 75 75 ts->y = 10.1*i; 76 76 mySt[i] = ts; 77 psVec-> vec.vp[i] = ts;77 psVec->data.PTR[i] = ts; 78 78 psVec->n++; 79 79 psMemIncrRefCounter(ts); 80 80 } 81 81 for(int i = 0; i < 10; i++) { 82 testStruct *ts = (testStruct*)psVec-> vec.vp[i];82 testStruct *ts = (testStruct*)psVec->data.PTR[i]; 83 83 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 84 84 } … … 90 90 // Test D - Reallocate void pointer vector smaller 91 91 printPositiveTestHeader(stdout,"psVector","Reallocate void pointer vector smaller"); 92 psVec = psVectorRealloc( psVec, 3);92 psVec = psVectorRealloc(3, psVec); 93 93 for(int i = 0; i < 3; i++) { 94 testStruct *ts = (testStruct*)psVec-> vec.vp[i];94 testStruct *ts = (testStruct*)psVec->data.PTR[i]; 95 95 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 96 96 } -
trunk/psLib/test/collections/tst_psVector_03.c
r717 r831 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 5-18 19:22:34$14 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-06-02 23:29:29 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 // Test A - Create void pointer vector 45 45 printPositiveTestHeader(stdout,"psVector", "Create void pointer vector"); 46 psVector *psVec = psVectorAlloc( PS_TYPE_PTR, 5);46 psVector *psVec = psVectorAlloc(5, PS_TYPE_PTR); 47 47 printf("Vector size = %d\n", psVec->nalloc); 48 48 printf("Vector population = %d\n", psVec->n); … … 57 57 ts->y = 10.1*i; 58 58 mySt[i] = ts; 59 psVec-> vec.vp[i] = ts;59 psVec->data.PTR[i] = ts; 60 60 psVec->n++; 61 61 psMemIncrRefCounter(ts); … … 63 63 64 64 for(int i = 0; i < 5; i++) { 65 testStruct *ts = (testStruct*)psVec-> vec.vp[i];65 testStruct *ts = (testStruct*)psVec->data.PTR[i]; 66 66 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 67 67 } … … 73 73 // Test C - Reallocate void pointer vector bigger 74 74 printPositiveTestHeader(stdout,"psVector", "Reallocate void pointer vector bigger"); 75 psVec = psVectorRealloc( psVec, 10);75 psVec = psVectorRealloc(10, psVec); 76 76 printf("Adding more elements to void pointer vector...\n"); 77 77 for(int i = 5; i < 10; i++) { … … 80 80 ts->y = 10.1*i; 81 81 mySt[i] = ts; 82 psVec-> vec.vp[i] = ts;82 psVec->data.PTR[i] = ts; 83 83 psVec->n++; 84 84 psMemIncrRefCounter(ts); 85 85 } 86 86 for(int i = 0; i < 10; i++) { 87 testStruct *ts = (testStruct*)psVec-> vec.vp[i];87 testStruct *ts = (testStruct*)psVec->data.PTR[i]; 88 88 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 89 89 } … … 95 95 // Test D - Reallocate void pointer vector smaller 96 96 printPositiveTestHeader(stdout,"psVector","Reallocate void pointer vector smaller"); 97 psVec = psVectorRealloc( psVec, 3);97 psVec = psVectorRealloc(3, psVec); 98 98 for(int i = 0; i < 3; i++) { 99 testStruct *ts = (testStruct*)psVec-> vec.vp[i];99 testStruct *ts = (testStruct*)psVec->data.PTR[i]; 100 100 printf("ts[%d].x = %d ts[%d].y = %.2f\n", i, ts->x, i, ts->y); 101 101 } -
trunk/psLib/test/dataManip/tst_psMatrix03.c
r798 r831 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 5-28 02:52:23$13 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-06-02 23:29:39 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 #define PRINT_VECTOR(VECTOR) \ 32 32 for(int i=0; i<VECTOR->n; i++) { \ 33 printf("%f\n", VECTOR-> vec.d[i]); \33 printf("%f\n", VECTOR->data.F64[i]); \ 34 34 } 35 35 … … 48 48 printPositiveTestHeader(stdout, "psMatrix", "Create input and output images and vectors"); 49 49 luImage = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64); 50 perm = (psVector*)psVectorAlloc( PS_TYPE_F64, 3);51 outVector = (psVector*)psVectorAlloc( PS_TYPE_F64, 3);52 inVector = (psVector*)psVectorAlloc( PS_TYPE_F64, 3);50 perm = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 51 outVector = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 52 inVector = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 53 53 inImage = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64); 54 54 inImage->data.F64[0][0] = 2; … … 61 61 inImage->data.F64[2][1] = 1; 62 62 inImage->data.F64[2][2] = -2; 63 inVector-> vec.d[0] = 18.0;64 inVector-> vec.d[1] = 24.0;65 inVector-> vec.d[2] = 4.0;63 inVector->data.F64[0] = 18.0; 64 inVector->data.F64[1] = 24.0; 65 inVector->data.F64[2] = 4.0; 66 66 inVector->n = 3; 67 67 PRINT_MATRIX(inImage); -
trunk/psLib/test/dataManip/tst_psMatrix07.c
r798 r831 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 5-28 02:52:23$13 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-06-02 23:29:39 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 #define PRINT_VECTOR(VECTOR) \ 32 32 for(int i=0; i<VECTOR->n; i++) { \ 33 printf("%f\n", VECTOR-> vec.d[i]); \33 printf("%f\n", VECTOR->data.F64[i]); \ 34 34 } 35 35 … … 46 46 // Test A - Create input and output images 47 47 printPositiveTestHeader(stdout, "psMatrix", "Create input and output images and vectors"); 48 v1 = (psVector*)psVectorAlloc( PS_TYPE_F64, 3);48 v1 = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 49 49 m1 = (psImage*)psImageAlloc(1, 3, PS_TYPE_F64); 50 v2 = (psVector*)psVectorAlloc( PS_TYPE_F64, 3);50 v2 = (psVector*)psVectorAlloc(3, PS_TYPE_F64); 51 51 m2 = (psImage*)psImageAlloc(1, 3, PS_TYPE_F64); 52 52 m1->data.F64[0][0] = 0.0; 53 53 m1->data.F64[1][0] = 1.0; 54 54 m1->data.F64[2][0] = 2.0; 55 v2-> vec.d[0] = 0.0;56 v2-> vec.d[1] = 1.0;57 v2-> vec.d[2] = 2.0;55 v2->data.F64[0] = 0.0; 56 v2->data.F64[1] = 1.0; 57 v2->data.F64[2] = 2.0; 58 58 v2->n = 3; 59 59 PRINT_MATRIX(m1); -
trunk/psLib/test/image/tst_psImage.c
r782 r831 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 5-25 23:59:17$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-06-02 23:29:29 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 48 48 unsigned int numRows[] = {0,1,100,1,150,100}; 49 49 unsigned int types = 12; 50 psElemType type[] = { PS_TYPE_ INT8, PS_TYPE_INT16, PS_TYPE_INT32, PS_TYPE_INT64,51 PS_TYPE_U INT8, PS_TYPE_UINT16, PS_TYPE_UINT32, PS_TYPE_UINT64,52 PS_TYPE_F LOAT, PS_TYPE_DOUBLE, PS_TYPE_COMPLEX_FLOAT, PS_TYPE_COMPLEX_DOUBLE};50 psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64, 51 PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64, 52 PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64 }; 53 53 54 54 psLogMsg(__func__,PS_LOG_INFO,"#546 - psImageAlloc shall allocate memory for a psImage structure"); … … 111 111 112 112 switch (type[t]) { 113 case PS_TYPE_U INT16: {113 case PS_TYPE_U16: { 114 114 unsigned int rows = numRows[i]; 115 115 unsigned int cols = numCols[i]; … … 131 131 } 132 132 break; 133 case PS_TYPE_F LOAT: {133 case PS_TYPE_F32: { 134 134 unsigned int rows = numRows[i]; 135 135 unsigned int cols = numCols[i]; … … 151 151 } 152 152 break; 153 case PS_TYPE_ DOUBLE: {153 case PS_TYPE_F64: { 154 154 unsigned int rows = numRows[i]; 155 155 unsigned int cols = numCols[i]; … … 171 171 } 172 172 break; 173 case PS_TYPE_C OMPLEX_FLOAT: {173 case PS_TYPE_C32: { 174 174 unsigned int rows = numRows[i]; 175 175 unsigned int cols = numCols[i];
Note:
See TracChangeset
for help on using the changeset viewer.
