Changeset 4330 for trunk/psLib/src/mathtypes
- Timestamp:
- Jun 20, 2005, 5:01:37 PM (21 years ago)
- Location:
- trunk/psLib/src/mathtypes
- Files:
-
- 6 edited
-
psImage.c (modified) (2 diffs)
-
psImage.h (modified) (3 diffs)
-
psScalar.c (modified) (3 diffs)
-
psScalar.h (modified) (2 diffs)
-
psVector.c (modified) (6 diffs)
-
psVector.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psImage.c
r4316 r4330 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1. 69$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-06- 18 03:13:02$11 * @version $Revision: 1.70 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-21 03:01:37 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 106 106 } 107 107 108 psRegion psRegionFromString(c har* region)108 psRegion psRegionFromString(const char* region) 109 109 { 110 110 psS32 col0; -
trunk/psLib/src/mathtypes/psImage.h
r4316 r4330 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.5 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-06- 18 03:13:02$13 * @version $Revision: 1.58 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-21 03:01:37 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 127 127 */ 128 128 psRegion psRegionFromString( 129 c har* region///< image rectangular region in the form '[x0:x1,y0:y1]'129 const char* region ///< image rectangular region in the form '[x0:x1,y0:y1]' 130 130 ); 131 131 … … 163 163 /** Frees all children of a psImage. 164 164 * 165 * @return psS32Number of children freed.165 * @return int Number of children freed. 166 166 * 167 167 */ -
trunk/psLib/src/mathtypes/psScalar.c
r3264 r4330 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-0 2-17 19:26:23$10 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-06-21 03:01:37 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 80 80 } 81 81 82 psScalar* psScalarCopy( psScalar *scalar)82 psScalar* psScalarCopy(const psScalar *value) 83 83 { 84 84 psElemType dataType; 85 85 psScalar *newScalar = NULL; 86 86 87 if ( scalar== NULL) {87 if (value == NULL) { 88 88 psError(PS_ERR_BAD_PARAMETER_NULL, true, 89 89 PS_ERRORTEXT_psScalar_COPY_NULL); … … 91 91 } 92 92 93 dataType = scalar->type.type;93 dataType = value->type.type; 94 94 switch (dataType) { 95 95 case PS_TYPE_S8: 96 newScalar = psScalarAlloc( scalar->data.S8, dataType);96 newScalar = psScalarAlloc(value->data.S8, dataType); 97 97 break; 98 98 case PS_TYPE_U8: 99 newScalar = psScalarAlloc( scalar->data.U8, dataType);99 newScalar = psScalarAlloc(value->data.U8, dataType); 100 100 break; 101 101 case PS_TYPE_S16: 102 newScalar = psScalarAlloc( scalar->data.S16, dataType);102 newScalar = psScalarAlloc(value->data.S16, dataType); 103 103 break; 104 104 case PS_TYPE_U16: 105 newScalar = psScalarAlloc( scalar->data.U16, dataType);105 newScalar = psScalarAlloc(value->data.U16, dataType); 106 106 break; 107 107 case PS_TYPE_S32: 108 newScalar = psScalarAlloc( scalar->data.S32, dataType);108 newScalar = psScalarAlloc(value->data.S32, dataType); 109 109 break; 110 110 case PS_TYPE_U32: 111 newScalar = psScalarAlloc( scalar->data.U32, dataType);111 newScalar = psScalarAlloc(value->data.U32, dataType); 112 112 break; 113 113 case PS_TYPE_S64: 114 newScalar = psScalarAlloc( scalar->data.S64, dataType);114 newScalar = psScalarAlloc(value->data.S64, dataType); 115 115 break; 116 116 case PS_TYPE_U64: 117 newScalar = psScalarAlloc( scalar->data.U64, dataType);117 newScalar = psScalarAlloc(value->data.U64, dataType); 118 118 break; 119 119 case PS_TYPE_F32: 120 newScalar = psScalarAlloc( scalar->data.F32, dataType);120 newScalar = psScalarAlloc(value->data.F32, dataType); 121 121 break; 122 122 case PS_TYPE_F64: 123 newScalar = psScalarAlloc( scalar->data.F64, dataType);123 newScalar = psScalarAlloc(value->data.F64, dataType); 124 124 break; 125 125 case PS_TYPE_C32: 126 newScalar = psScalarAlloc( scalar->data.C32, dataType);126 newScalar = psScalarAlloc(value->data.C32, dataType); 127 127 break; 128 128 case PS_TYPE_C64: 129 newScalar = psScalarAlloc( scalar->data.C64, dataType);129 newScalar = psScalarAlloc(value->data.C64, dataType); 130 130 break; 131 131 default: -
trunk/psLib/src/mathtypes/psScalar.h
r4162 r4330 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-06- 08 23:40:45$13 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-21 03:01:37 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 77 77 */ 78 78 psScalar* psScalarCopy( 79 psScalar *scalar///< Scalar to copy.79 const psScalar *value ///< Scalar to copy. 80 80 ); 81 81 -
trunk/psLib/src/mathtypes/psVector.c
r4212 r4330 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-06- 10 21:46:46$11 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-06-21 03:01:37 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 129 129 } 130 130 131 psVector *psVectorExtend(psVector *vector, int delta, intnExtend)131 psVector *psVectorExtend(psVector *vector, long delta, long nExtend) 132 132 { 133 133 // can't handle a NULL vector (don't know the data type to allocate) … … 166 166 } 167 167 168 psVector* psVectorCopy(psVector* out , const psVector* in, psElemType type)169 { 170 if (in == NULL) {168 psVector* psVectorCopy(psVector* output, const psVector* input, psElemType type) 169 { 170 if (input == NULL) { 171 171 psError(PS_ERR_BAD_PARAMETER_NULL, true, 172 172 PS_ERRORTEXT_psVector_SORT_NULL); 173 psFree(out );174 return NULL; 175 } 176 177 psS32 nElements = in ->n;178 179 out = psVectorRecycle(out, nElements, type);173 psFree(output); 174 return NULL; 175 } 176 177 psS32 nElements = input->n; 178 179 output = psVectorRecycle(output, nElements, type); 180 180 181 181 #define PSVECTOR_COPY(INTYPE,OUTTYPE) { \ 182 ps##INTYPE *inVec = in ->data.INTYPE; \183 ps##OUTTYPE *outVec = out ->data.OUTTYPE; \182 ps##INTYPE *inVec = input->data.INTYPE; \ 183 ps##OUTTYPE *outVec = output->data.OUTTYPE; \ 184 184 for (psS32 col=0;col<nElements;col++) { \ 185 185 *(outVec++) = *(inVec++); \ … … 189 189 #define PSVECTOR_COPY_CASE(OUTTYPE) \ 190 190 case PS_TYPE_##OUTTYPE: { \ 191 switch (in ->type.type) { \191 switch (input->type.type) { \ 192 192 case PS_TYPE_S8: \ 193 193 PSVECTOR_COPY(S8,OUTTYPE); \ … … 232 232 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, \ 233 233 typeStr); \ 234 psFree(out ); \234 psFree(output); \ 235 235 } \ 236 236 } \ … … 257 257 PS_ERRORTEXT_psVector_UNSUPPORTED_TYPE, 258 258 typeStr); 259 psFree(out );259 psFree(output); 260 260 261 261 break; 262 262 } 263 263 } 264 return out ;264 return output; 265 265 266 266 -
trunk/psLib/src/mathtypes/psVector.h
r4212 r4330 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-06- 10 21:46:46$13 * @version $Revision: 1.36 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-06-21 03:01:37 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 101 101 psVector *psVectorExtend( 102 102 psVector *vector, ///< Vector to extend 103 int delta,///< Amount to expand allocation, if necessary104 int nExtend///< Number of elements to add to vector length103 long delta, ///< Amount to expand allocation, if necessary 104 long nExtend ///< Number of elements to add to vector length 105 105 ); 106 106 … … 132 132 */ 133 133 psVector* psVectorCopy( 134 psVector* out ,///< if non-NULL, a psVector to recycle135 const psVector* in ,///< the vector to copy.134 psVector* output, ///< if non-NULL, a psVector to recycle 135 const psVector* input, ///< the vector to copy. 136 136 psElemType type ///< the data type of the resulting psVector 137 137 );
Note:
See TracChangeset
for help on using the changeset viewer.
