Changeset 831 for trunk/psLib/test/collections/tst_psSort_02.c
- Timestamp:
- Jun 2, 2004, 1:29:39 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/collections/tst_psSort_02.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.
