Changeset 7131 for trunk/psLib/test/math/tst_psStats00.c
- Timestamp:
- May 17, 2006, 3:20:10 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/math/tst_psStats00.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tst_psStats00.c
r6317 r7131 3 3 * @brief Contains tests for psVectorStats with sample mean calculations 4 4 * 5 * We extensively test the code with data type PS_TYPE_F32. If these pass, we 5 * We extensively test the code with data type PS_TYPE_F32. If these pass, we 6 6 * do a much simpler test with data type PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_F64. 7 7 * … … 10 10 * 11 11 * @author GLG, MHPCC 12 * 13 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 2-03 01:34:11$12 * 13 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-05-18 01:20:10 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 85 85 psS32 testStatsSampleMeanF32(void) 86 86 { 87 psStats* myStats = NULL;88 psVector* myVector = NULL;89 psVector* maskVector = NULL;90 psVector* myErrors = NULL;91 psF64 mean = 0.0;92 93 87 /*************************************************************************/ 94 88 /* Allocate and initialize data structures */ 95 89 /*************************************************************************/ 96 myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN);97 myVector = psVectorAlloc(N, PS_TYPE_F32);90 psStats *myStats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 91 psVector *myVector = psVectorAlloc(N, PS_TYPE_F32); 98 92 myVector->n = N; 99 myErrors = psVectorAlloc(N, PS_TYPE_F32);93 psVector *myErrors = psVectorAlloc(N, PS_TYPE_F32); 100 94 myErrors->n = N; 101 maskVector = psVectorAlloc(N, PS_TYPE_U8);95 psVector *maskVector = psVectorAlloc(N, PS_TYPE_U8); 102 96 maskVector->n = N; 103 97 104 mean = 0.0;98 psF64 mean = 0.0; 105 99 // Set the appropriate values for the vector data. 106 for ( psS32i = 0; i < N; i++) {100 for (long i = 0; i < N; i++) { 107 101 myVector->data.F32[i] = samplesF32[i]; 108 102 myErrors->data.F32[i] = errorsF32[i];
Note:
See TracChangeset
for help on using the changeset viewer.
