Changeset 1406
- Timestamp:
- Aug 6, 2004, 12:34:06 PM (22 years ago)
- Location:
- trunk/psLib
- Files:
-
- 130 edited
-
src/astro/psCoord.c (modified) (1 diff)
-
src/astro/psTime.c (modified) (1 diff)
-
src/astro/psTime.h (modified) (1 diff)
-
src/astronomy/psAstrometry.c (modified) (1 diff)
-
src/astronomy/psAstrometry.h (modified) (1 diff)
-
src/astronomy/psCoord.c (modified) (1 diff)
-
src/astronomy/psMetadata.c (modified) (3 diffs)
-
src/astronomy/psTime.c (modified) (1 diff)
-
src/astronomy/psTime.h (modified) (1 diff)
-
src/collections/psArray.c (modified) (1 diff)
-
src/collections/psBitSet.c (modified) (1 diff)
-
src/collections/psList.c (modified) (1 diff)
-
src/collections/psMetadata.c (modified) (3 diffs)
-
src/collections/psScalar.c (modified) (1 diff)
-
src/collections/psScalar.h (modified) (1 diff)
-
src/collections/psVector.c (modified) (1 diff)
-
src/collections/psVector.h (modified) (1 diff)
-
src/dataManip/psFFT.c (modified) (1 diff)
-
src/dataManip/psFFT.h (modified) (1 diff)
-
src/dataManip/psFunctions.c (modified) (1 diff)
-
src/dataManip/psFunctions.h (modified) (1 diff)
-
src/dataManip/psMatrix.c (modified) (1 diff)
-
src/dataManip/psMatrixVectorArithmetic.c (modified) (1 diff)
-
src/dataManip/psMinimize.c (modified) (1 diff)
-
src/dataManip/psStats.c (modified) (1 diff)
-
src/dataManip/psStats.h (modified) (1 diff)
-
src/dataManip/psVectorFFT.c (modified) (1 diff)
-
src/dataManip/psVectorFFT.h (modified) (1 diff)
-
src/fft/psVectorFFT.c (modified) (1 diff)
-
src/fft/psVectorFFT.h (modified) (1 diff)
-
src/image/psImage.c (modified) (1 diff)
-
src/image/psImage.h (modified) (1 diff)
-
src/image/psImageExtraction.c (modified) (5 diffs)
-
src/image/psImageIO.c (modified) (1 diff)
-
src/image/psImageManip.c (modified) (1 diff)
-
src/image/psImageStats.c (modified) (1 diff)
-
src/imageops/psImageStats.c (modified) (1 diff)
-
src/math/psMatrix.c (modified) (1 diff)
-
src/math/psMinimize.c (modified) (1 diff)
-
src/math/psPolynomial.c (modified) (1 diff)
-
src/math/psPolynomial.h (modified) (1 diff)
-
src/math/psSpline.c (modified) (1 diff)
-
src/math/psSpline.h (modified) (1 diff)
-
src/math/psStats.c (modified) (1 diff)
-
src/math/psStats.h (modified) (1 diff)
-
src/mathtypes/psImage.c (modified) (1 diff)
-
src/mathtypes/psImage.h (modified) (1 diff)
-
src/mathtypes/psScalar.c (modified) (1 diff)
-
src/mathtypes/psScalar.h (modified) (1 diff)
-
src/mathtypes/psVector.c (modified) (1 diff)
-
src/mathtypes/psVector.h (modified) (1 diff)
-
src/sys/psAbort.c (modified) (1 diff)
-
src/sys/psError.c (modified) (1 diff)
-
src/sys/psLogMsg.c (modified) (1 diff)
-
src/sys/psLogMsg.h (modified) (1 diff)
-
src/sys/psMemory.c (modified) (1 diff)
-
src/sys/psMemory.h (modified) (1 diff)
-
src/sys/psString.c (modified) (1 diff)
-
src/sys/psTrace.c (modified) (1 diff)
-
src/sysUtils/psAbort.c (modified) (1 diff)
-
src/sysUtils/psError.c (modified) (1 diff)
-
src/sysUtils/psHash.c (modified) (1 diff)
-
src/sysUtils/psHash.h (modified) (1 diff)
-
src/sysUtils/psLogMsg.c (modified) (1 diff)
-
src/sysUtils/psLogMsg.h (modified) (1 diff)
-
src/sysUtils/psMemory.c (modified) (1 diff)
-
src/sysUtils/psMemory.h (modified) (1 diff)
-
src/sysUtils/psString.c (modified) (1 diff)
-
src/sysUtils/psTrace.c (modified) (1 diff)
-
src/types/psArray.c (modified) (1 diff)
-
src/types/psBitSet.c (modified) (1 diff)
-
src/types/psList.c (modified) (1 diff)
-
src/types/psMetadata.c (modified) (3 diffs)
-
test/astronomy/tst_psMetadata_01.c (modified) (1 diff)
-
test/astronomy/tst_psMetadata_02.c (modified) (1 diff)
-
test/astronomy/tst_psTime_01.c (modified) (1 diff)
-
test/astronomy/tst_psTime_02.c (modified) (1 diff)
-
test/collections/tst_psArray.c (modified) (1 diff)
-
test/collections/tst_psBitSet_01.c (modified) (1 diff)
-
test/collections/tst_psBitSet_02.c (modified) (1 diff)
-
test/collections/tst_psBitSet_03.c (modified) (1 diff)
-
test/collections/tst_psBitSet_04.c (modified) (1 diff)
-
test/collections/tst_psBitSet_05.c (modified) (1 diff)
-
test/collections/tst_psBitSet_06.c (modified) (1 diff)
-
test/collections/tst_psBitSet_07.c (modified) (1 diff)
-
test/collections/tst_psBitSet_08.c (modified) (1 diff)
-
test/collections/tst_psList.c (modified) (2 diffs)
-
test/collections/tst_psMetadata_01.c (modified) (1 diff)
-
test/collections/tst_psMetadata_02.c (modified) (1 diff)
-
test/collections/tst_psVector.c (modified) (1 diff)
-
test/collections/tst_psVectorSort_01.c (modified) (1 diff)
-
test/collections/tst_psVectorSort_02.c (modified) (1 diff)
-
test/collections/tst_psVectorSort_03.c (modified) (1 diff)
-
test/collections/tst_psVectorSort_04.c (modified) (1 diff)
-
test/dataManip/tst_psHist02.c (modified) (5 diffs)
-
test/dataManip/tst_psMatrix01.c (modified) (6 diffs)
-
test/dataManip/tst_psMatrix02.c (modified) (1 diff)
-
test/dataManip/tst_psMatrix03.c (modified) (3 diffs)
-
test/dataManip/tst_psMatrix04.c (modified) (2 diffs)
-
test/dataManip/tst_psMatrix05.c (modified) (6 diffs)
-
test/dataManip/tst_psMatrix06.c (modified) (5 diffs)
-
test/dataManip/tst_psMatrix07.c (modified) (5 diffs)
-
test/dataManip/tst_psMatrixVectorArithmetic01.c (modified) (1 diff)
-
test/dataManip/tst_psMatrixVectorArithmetic02.c (modified) (10 diffs)
-
test/dataManip/tst_psMatrixVectorArithmetic03.c (modified) (1 diff)
-
test/dataManip/tst_psMinimize00.c (modified) (1 diff)
-
test/dataManip/tst_psMinimize01.c (modified) (1 diff)
-
test/dataManip/tst_psMinimize02.c (modified) (2 diffs)
-
test/dataManip/tst_psMinimize03.c (modified) (2 diffs)
-
test/dataManip/tst_psStats07.c (modified) (7 diffs)
-
test/dataManip/tst_psVectorFFT.c (modified) (1 diff)
-
test/image/tst_psImage.c (modified) (3 diffs)
-
test/image/tst_psImageExtraction.c (modified) (1 diff)
-
test/image/tst_psImageFFT.c (modified) (3 diffs)
-
test/image/tst_psImageIO.c (modified) (3 diffs)
-
test/image/tst_psImageManip.c (modified) (3 diffs)
-
test/image/tst_psImageStats00.c (modified) (3 diffs)
-
test/image/tst_psImageStats01.c (modified) (2 diffs)
-
test/image/tst_psImageStats02.c (modified) (7 diffs)
-
test/psTest.c (modified) (5 diffs)
-
test/sysUtils/atst_psAbort_01.c (modified) (1 diff)
-
test/sysUtils/atst_psAbort_02.c (modified) (1 diff)
-
test/sysUtils/atst_psAbort_03.c (modified) (1 diff)
-
test/sysUtils/tst_psError.c (modified) (1 diff)
-
test/sysUtils/tst_psHash02.c (modified) (1 diff)
-
test/sysUtils/tst_psHash03.c (modified) (1 diff)
-
test/sysUtils/tst_psHash04.c (modified) (1 diff)
-
test/sysUtils/tst_psMemory.c (modified) (13 diffs)
-
test/sysUtils/tst_psString.c (modified) (1 diff)
-
test/sysUtils/tst_psStringCopy.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r1393 r1406 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 5 19:38:51$12 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/astro/psTime.c
r1393 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 5 19:38:51$14 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/astro/psTime.h
r1393 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 5 19:38:51$14 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/astronomy/psAstrometry.c
r1393 r1406 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 5 19:38:51$10 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/astronomy/psAstrometry.h
r1385 r1406 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/astronomy/psCoord.c
r1393 r1406 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 5 19:38:51$12 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/astronomy/psMetadata.c
r1398 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 5 23:39:23$13 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 280 280 return false; 281 281 } 282 } else if(value != NULL) { 283 284 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 285 // it will wipe out existing node. 286 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 287 metadataItem->name ); 288 return false; 289 } else { 290 291 // Duplicate key not found. Add new metadata item to metadata collection's hash 292 if(!psHashAdd( mdTable, key, metadataItem )) { 293 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 282 } else 283 if(value != NULL) { 284 285 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 286 // it will wipe out existing node. 287 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 294 288 metadataItem->name ); 295 289 return false; 296 } 297 } 290 } else { 291 292 // Duplicate key not found. Add new metadata item to metadata collection's hash 293 if(!psHashAdd( mdTable, key, metadataItem )) { 294 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 295 metadataItem->name ); 296 return false; 297 } 298 } 298 299 299 300 // Add all items to metadata collection's list, even if they have the same metadata item names … … 612 613 psError( __func__, "Null extName and extNum = 0 not allowed" ); 613 614 return NULL; 614 } else if(extName && extNum) { 615 psError( __func__, "Both extName and extNum arguments should not have non zero values." ); 616 return NULL; 617 } 615 } else 616 if(extName && extNum) { 617 psError( __func__, "Both extName and extNum arguments should not have non zero values." ); 618 return NULL; 619 } 618 620 619 621 // Allocate metadata if user didn't -
trunk/psLib/src/astronomy/psTime.c
r1393 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 5 19:38:51$14 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/astronomy/psTime.h
r1393 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 5 19:38:51$14 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/collections/psArray.c
r1385 r1406 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/collections/psBitSet.c
r1385 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/collections/psList.c
r1385 r1406 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08-0 4 23:37:39$8 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/collections/psMetadata.c
r1398 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 5 23:39:23$13 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 280 280 return false; 281 281 } 282 } else if(value != NULL) { 283 284 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 285 // it will wipe out existing node. 286 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 287 metadataItem->name ); 288 return false; 289 } else { 290 291 // Duplicate key not found. Add new metadata item to metadata collection's hash 292 if(!psHashAdd( mdTable, key, metadataItem )) { 293 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 282 } else 283 if(value != NULL) { 284 285 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 286 // it will wipe out existing node. 287 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 294 288 metadataItem->name ); 295 289 return false; 296 } 297 } 290 } else { 291 292 // Duplicate key not found. Add new metadata item to metadata collection's hash 293 if(!psHashAdd( mdTable, key, metadataItem )) { 294 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 295 metadataItem->name ); 296 return false; 297 } 298 } 298 299 299 300 // Add all items to metadata collection's list, even if they have the same metadata item names … … 612 613 psError( __func__, "Null extName and extNum = 0 not allowed" ); 613 614 return NULL; 614 } else if(extName && extNum) { 615 psError( __func__, "Both extName and extNum arguments should not have non zero values." ); 616 return NULL; 617 } 615 } else 616 if(extName && extNum) { 617 psError( __func__, "Both extName and extNum arguments should not have non zero values." ); 618 return NULL; 619 } 618 620 619 621 // Allocate metadata if user didn't -
trunk/psLib/src/collections/psScalar.c
r1385 r1406 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/collections/psScalar.h
r1385 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/collections/psVector.c
r1404 r1406 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-06 2 1:50:13$10 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/collections/psVector.h
r1385 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 4 23:37:39$13 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psFFT.c
r1404 r1406 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-08-06 2 1:50:13$7 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-08-06 22:34:05 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psFFT.h
r1385 r1406 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-08-0 4 23:37:39$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-08-06 22:34:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psFunctions.c
r1385 r1406 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-08-0 4 23:37:39$9 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-08-06 22:34:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psFunctions.h
r1385 r1406 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 4 23:37:39$14 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psMatrix.c
r1385 r1406 20 20 * @author Ross Harman, MHPCC 21 21 * 22 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $23 * @date $Date: 2004-08-0 4 23:37:39$22 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2004-08-06 22:34:05 $ 24 24 * 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c
r1385 r1406 29 29 * @author Ross Harman, MHPCC 30 30 * 31 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $32 * @date $Date: 2004-08-0 4 23:37:39$31 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 32 * @date $Date: 2004-08-06 22:34:05 $ 33 33 * 34 34 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psMinimize.c
r1385 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psStats.c
r1393 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 5 19:38:52$11 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psStats.h
r1385 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psVectorFFT.c
r1404 r1406 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-08-06 2 1:50:13$7 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-08-06 22:34:05 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/dataManip/psVectorFFT.h
r1385 r1406 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-08-0 4 23:37:39$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-08-06 22:34:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/fft/psVectorFFT.c
r1404 r1406 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-08-06 2 1:50:13$7 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-08-06 22:34:05 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/fft/psVectorFFT.h
r1385 r1406 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-08-0 4 23:37:39$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-08-06 22:34:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/image/psImage.c
r1385 r1406 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/image/psImage.h
r1385 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 4 23:37:39$13 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/image/psImageExtraction.c
r1404 r1406 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-06 2 1:50:13$11 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 334 334 if ( delta < 0 ) { 335 335 outData += numCols - 1; 336 if (outPosition != NULL) { 337 outPosition += numCols - 1; 338 } 336 339 } 337 340 … … 362 365 *outData = statVal; \ 363 366 if (outPosition != NULL) { \ 364 *(outPosition++) = col+c; \ 367 *outPosition = col+c; \ 368 outPosition += delta; \ 365 369 } \ 366 370 outData += delta; \ … … 416 420 if ( delta < 0 ) { 417 421 outData += numRows - 1; 422 if (outPosition != NULL) { 423 outPosition += numRows - 1; 424 } 418 425 } 419 426 … … 428 435 *outData = statVal; 429 436 if (outPosition != NULL) { 430 *(outPosition++) = row+r; 437 *outPosition = row+r; 438 outPosition += delta; 439 \ 431 440 } 432 441 outData += delta; -
trunk/psLib/src/image/psImageIO.c
r1385 r1406 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-08-0 4 23:37:39$9 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-08-06 22:34:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/image/psImageManip.c
r1385 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/image/psImageStats.c
r1393 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 5 19:38:52$11 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/imageops/psImageStats.c
r1393 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 5 19:38:52$11 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psMatrix.c
r1385 r1406 20 20 * @author Ross Harman, MHPCC 21 21 * 22 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $23 * @date $Date: 2004-08-0 4 23:37:39$22 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2004-08-06 22:34:05 $ 24 24 * 25 25 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psMinimize.c
r1385 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psPolynomial.c
r1385 r1406 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-08-0 4 23:37:39$9 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-08-06 22:34:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psPolynomial.h
r1385 r1406 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 4 23:37:39$14 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psSpline.c
r1385 r1406 7 7 * polynomials. It also contains a Gaussian functions. 8 8 * 9 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $10 * @date $Date: 2004-08-0 4 23:37:39$9 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2004-08-06 22:34:05 $ 11 11 * 12 12 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psSpline.h
r1385 r1406 12 12 * @author George Gusciora, MHPCC 13 13 * 14 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 4 23:37:39$14 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psStats.c
r1393 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.5 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 5 19:38:52$11 * @version $Revision: 1.51 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/math/psStats.h
r1385 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/mathtypes/psImage.c
r1385 r1406 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.3 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.37 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/mathtypes/psImage.h
r1385 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 4 23:37:39$13 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/mathtypes/psScalar.c
r1385 r1406 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/mathtypes/psScalar.h
r1385 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/mathtypes/psVector.c
r1404 r1406 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-06 2 1:50:13$10 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/mathtypes/psVector.h
r1385 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 4 23:37:39$13 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psAbort.c
r1385 r1406 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psError.c
r1385 r1406 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psLogMsg.c
r1393 r1406 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 5 19:38:52$13 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psLogMsg.h
r1385 r1406 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 4 23:37:39$13 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psMemory.c
r1385 r1406 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psMemory.h
r1385 r1406 14 14 * @ingroup MemoryManagement 15 15 * 16 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-08-0 4 23:37:39$16 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-08-06 22:34:05 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psString.c
r1385 r1406 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sys/psTrace.c
r1393 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 5 19:38:52$11 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psAbort.c
r1385 r1406 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 4 23:37:39$11 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psError.c
r1385 r1406 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psHash.c
r1385 r1406 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psHash.h
r1385 r1406 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psLogMsg.c
r1393 r1406 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 5 19:38:52$13 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psLogMsg.h
r1385 r1406 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 4 23:37:39$13 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psMemory.c
r1385 r1406 8 8 * @author Robert Lupton, Princeton University 9 9 * 10 * @version $Revision: 1.3 1$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.32 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psMemory.h
r1385 r1406 14 14 * @ingroup MemoryManagement 15 15 * 16 * @version $Revision: 1.2 2$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-08-0 4 23:37:39$16 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-08-06 22:34:05 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psString.c
r1385 r1406 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/sysUtils/psTrace.c
r1393 r1406 9 9 * @author George Gusciora, MHPCC 10 10 * 11 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-08-0 5 19:38:52$11 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/types/psArray.c
r1385 r1406 8 8 * @author Ross Harman, MHPCC 9 9 * 10 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-08-0 4 23:37:39$10 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:05 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/types/psBitSet.c
r1385 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/types/psList.c
r1385 r1406 6 6 * @author Robert Daniel DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08-0 4 23:37:39$8 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/src/types/psMetadata.c
r1398 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-0 5 23:39:23$13 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 280 280 return false; 281 281 } 282 } else if(value != NULL) { 283 284 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 285 // it will wipe out existing node. 286 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 287 metadataItem->name ); 288 return false; 289 } else { 290 291 // Duplicate key not found. Add new metadata item to metadata collection's hash 292 if(!psHashAdd( mdTable, key, metadataItem )) { 293 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 282 } else 283 if(value != NULL) { 284 285 // The key was found and the new metadata item is a folder node. Don't add new metadata item, since 286 // it will wipe out existing node. 287 psError( __func__, "Metadata already exists in metadata collection. Item not added. Name: %s", 294 288 metadataItem->name ); 295 289 return false; 296 } 297 } 290 } else { 291 292 // Duplicate key not found. Add new metadata item to metadata collection's hash 293 if(!psHashAdd( mdTable, key, metadataItem )) { 294 psError( __func__, "Couldn't add metadata item to metadata collection table. Name: %s", 295 metadataItem->name ); 296 return false; 297 } 298 } 298 299 299 300 // Add all items to metadata collection's list, even if they have the same metadata item names … … 612 613 psError( __func__, "Null extName and extNum = 0 not allowed" ); 613 614 return NULL; 614 } else if(extName && extNum) { 615 psError( __func__, "Both extName and extNum arguments should not have non zero values." ); 616 return NULL; 617 } 615 } else 616 if(extName && extNum) { 617 psError( __func__, "Both extName and extNum arguments should not have non zero values." ); 618 return NULL; 619 } 618 620 619 621 // Allocate metadata if user didn't -
trunk/psLib/test/astronomy/tst_psMetadata_01.c
r1402 r1406 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-08-06 2 0:32:58$17 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-08-06 22:34:05 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/astronomy/tst_psMetadata_02.c
r1401 r1406 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-08-06 2 0:32:44$17 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-08-06 22:34:05 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/astronomy/tst_psTime_01.c
r1258 r1406 21 21 * @author Ross Harman, MHPCC 22 22 * 23 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $24 * @date $Date: 2004-0 7-22 19:45:58$23 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 24 * @date $Date: 2004-08-06 22:34:05 $ 25 25 * 26 26 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/astronomy/tst_psTime_02.c
r1273 r1406 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-0 7-22 21:26:59$15 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-08-06 22:34:05 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psArray.c
r1227 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 7-15 22:17:03$14 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_01.c
r1175 r1406 17 17 * @author Ross Harman, MHPCC 18 18 * 19 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-0 7-01 21:56:15 $19 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-08-06 22:34:05 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_02.c
r1179 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 7-01 23:09:53$13 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_03.c
r1175 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-01 21:56:15 $12 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_04.c
r1175 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-01 21:56:15 $12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_05.c
r1175 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-01 21:56:15 $12 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_06.c
r1175 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 7-01 21:56:15 $14 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_07.c
r1170 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 7-01 18:57:30$14 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psBitSet_08.c
r1173 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 7-01 21:46:14$13 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:05 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psList.c
r1227 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.1 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 7-15 22:17:03$8 * @version $Revision: 1.15 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:05 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 29 29 testDescription tests[] = { 30 {testListAlloc,487,"psListAlloc",0,false}, 31 {testListAdd,488,"psListAdd",0,false}, 32 {testListGet,489,"psListGet",0,false}, 33 {testListRemove,490,"psListRemove",0,false}, 34 {testListConvert,491,"psListConvert",0,false}, 35 {testListIterator,494,"psListIterator",0,false}, 36 {testListFree,627,"psListFree",0,false}, 37 {testListSort,624,"psListSort",0,false}, 38 {NULL} 30 { 31 testListAlloc,487,"psListAlloc",0,false 32 }, 33 { 34 testListAdd,488,"psListAdd",0,false 35 }, 36 { 37 testListGet,489,"psListGet",0,false 38 }, 39 { 40 testListRemove,490,"psListRemove",0,false 41 }, 42 { 43 testListConvert,491,"psListConvert",0,false 44 }, 45 { 46 testListIterator,494,"psListIterator",0,false 47 }, 48 { 49 testListFree,627,"psListFree",0,false 50 }, 51 { 52 testListSort,624,"psListSort",0,false 53 }, 54 { 55 NULL 56 } 39 57 }; 40 58 -
trunk/psLib/test/collections/tst_psMetadata_01.c
r1402 r1406 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-08-06 2 0:32:58$17 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-08-06 22:34:05 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psMetadata_02.c
r1401 r1406 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-08-06 2 0:32:44$17 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-08-06 22:34:05 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psVector.c
r1291 r1406 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-0 7-23 20:20:33$16 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-08-06 22:34:05 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psVectorSort_01.c
r1233 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-15 23:52:34$12 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psVectorSort_02.c
r1304 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-28 00:05:19$12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:05 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psVectorSort_03.c
r1303 r1406 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-0 7-27 23:28:56$14 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-06 22:34:05 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/collections/tst_psVectorSort_04.c
r1300 r1406 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-0 7-27 22:48:19$11 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-08-06 22:34:05 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/dataManip/tst_psHist02.c
r1365 r1406 2 2 This routine must ensure that the psHistogram structure is correctly 3 3 populated by the procedure psGetArrayHistogram(). 4 4 5 5 *****************************************************************************/ 6 6 #include <stdio.h> … … 26 26 int i = 0; 27 27 int currentId = 0; 28 28 29 29 currentId = psMemGetId(); 30 30 31 31 /*********************************************************************/ 32 32 /* Allocate and initialize data structures */ … … 35 35 myData->n = myData->nalloc; 36 36 for ( i = 0;i < NUM_DATA;i++ ) { 37 myData->data.F32[ i ] = LOWER + ( ( UPPER - LOWER ) / ( float ) NUM_DATA ) * ( float ) i;38 }39 37 myData->data.F32[ i ] = LOWER + ( ( UPPER - LOWER ) / ( float ) NUM_DATA ) * ( float ) i; 38 } 39 40 40 myMask = psVectorAlloc( NUM_DATA, PS_TYPE_U8 ); 41 41 myMask->n = myMask->nalloc; 42 42 for ( i = 0;i < NUM_DATA;i++ ) { 43 if ( i >= ( NUM_DATA / 2 ) ) { 44 myMask->data.U8[ i ] = 1; 45 } else { 46 myMask->data.U8[ i ] = 0; 47 } 43 if ( i >= ( NUM_DATA / 2 ) ) { 44 myMask->data.U8[ i ] = 1; 45 } else { 46 myMask->data.U8[ i ] = 0; 48 47 } 49 48 } 49 50 50 for ( nb = 0;nb < 4;nb++ ) { 51 if ( nb == 0 ) 52 numBins = 1; 53 if ( nb == 1 ) 54 numBins = 2; 55 if ( nb == 2 ) 56 numBins = 10; 57 if ( nb == 3 ) 58 numBins = 20; 59 60 /*********************************************************************/ 61 /* Allocate and Perform Histogram, no mask */ 62 /*********************************************************************/ 63 printPositiveTestHeader( stdout, 64 "psStats functions", 65 "Allocate and Perform Histogram, no mask" ); 66 67 myHist = psHistogramAlloc( LOWER, UPPER, numBins ); 68 myHist = psVectorHistogram( myHist, myData, NULL, 0 ); 69 70 for ( i = 0;i < numBins;i++ ) { 71 printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i, 72 myHist->bounds->data.F32[ i ], 73 myHist->bounds->data.F32[ i + 1 ], 74 myHist->nums->data.U32[ i ] ); 75 } 76 psMemCheckCorruption( 1 ); 77 psFree( myHist ); 78 psMemCheckCorruption( 1 ); 79 80 printFooter( stdout, 81 "psStats functions", 82 "Allocate and Perform Histogram, no mask", 83 testStatus ); 84 85 /*********************************************************************/ 86 /* Allocate and Perform Histogram with mask */ 87 /*********************************************************************/ 88 printPositiveTestHeader( stdout, 89 "psStats functions", 90 "Allocate and Perform Histogram with mask" ); 91 92 myHist = psHistogramAlloc( LOWER, UPPER, numBins ); 93 myHist = psVectorHistogram( myHist, myData, myMask, 1 ); 94 95 for ( i = 0;i < numBins;i++ ) { 96 printf( "Bin number %d bounds: (%6.3f - %6.3f) data (%d)\n", i, 97 myHist->bounds->data.F32[ i ], 98 myHist->bounds->data.F32[ i + 1 ], 99 myHist->nums->data.U32[ i ] ); 100 } 101 psMemCheckCorruption( 1 ); 102 psFree( myHist ); 103 psMemCheckCorruption( 1 ); 104 105 printFooter( stdout, 106 "psStats functions", 107 "Allocate and Perform Histogram with mask", 108 testStatus ); 51 if ( nb == 0 ) 52 numBins = 1; 53 if ( nb == 1 ) 54 numBins = 2; 55 if ( nb == 2 ) 56 numBins = 10; 57 if ( nb == 3 ) 58 numBins = 20; 59 60 /*********************************************************************/ 61 /* Allocate and Perform Histogram, no mask */ 62 /*********************************************************************/ 63 printPositiveTestHeader( stdout, 64 "psStats functions", 65 "Allocate and Perform Histogram, no mask" ); 66 67 myHist = psHistogramAlloc( LOWER, UPPER, numBins ); 68 myHist = psVectorHistogram( myHist, myData, NULL, 0 ); 69 70 for ( i = 0;i < numBins;i++ ) { 71 printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i, 72 myHist->bounds->data.F32[ i ], 73 myHist->bounds->data.F32[ i + 1 ], 74 myHist->nums->data.U32[ i ] ); 109 75 } 76 psMemCheckCorruption( 1 ); 77 psFree( myHist ); 78 psMemCheckCorruption( 1 ); 79 80 printFooter( stdout, 81 "psStats functions", 82 "Allocate and Perform Histogram, no mask", 83 testStatus ); 84 85 /*********************************************************************/ 86 /* Allocate and Perform Histogram with mask */ 87 /*********************************************************************/ 88 printPositiveTestHeader( stdout, 89 "psStats functions", 90 "Allocate and Perform Histogram with mask" ); 91 92 myHist = psHistogramAlloc( LOWER, UPPER, numBins ); 93 myHist = psVectorHistogram( myHist, myData, myMask, 1 ); 94 95 for ( i = 0;i < numBins;i++ ) { 96 printf( "Bin number %d bounds: (%6.3f - %6.3f) data (%d)\n", i, 97 myHist->bounds->data.F32[ i ], 98 myHist->bounds->data.F32[ i + 1 ], 99 myHist->nums->data.U32[ i ] ); 100 } 101 psMemCheckCorruption( 1 ); 102 psFree( myHist ); 103 psMemCheckCorruption( 1 ); 104 105 printFooter( stdout, 106 "psStats functions", 107 "Allocate and Perform Histogram with mask", 108 testStatus ); 109 } 110 110 psFree( myMask ); 111 111 112 112 printPositiveTestHeader( stdout, 113 113 "psStats functions", 114 114 "Calling psVectorHistogram() with various NULL inputs." ); 115 115 116 116 // Verify the return value is null and program execution doesn't stop, 117 117 // if input parameter myHist is null. 118 118 119 119 myHist2 = psVectorHistogram( NULL, myData, NULL, 0 ); 120 120 if ( myHist2 != NULL ) { 121 printf( "ERROR: myHist2!=NULL\n" );122 testStatus = false;123 }121 printf( "ERROR: myHist2!=NULL\n" ); 122 testStatus = false; 123 } 124 124 psFree( myData ); 125 126 125 126 127 127 // Verify the retrun value is the same as the input parameter myHist and 128 128 // program execution doesn't stop, if the input parameter myArray is 129 129 // null. 130 130 131 131 myHist = psHistogramAlloc( LOWER, UPPER, numBins ); 132 132 myHist = psVectorHistogram( myHist, NULL, NULL, 0 ); 133 133 if ( myHist == NULL ) { 134 printf( "ERROR: myHist==NULL\n" );135 testStatus = false;136 }134 printf( "ERROR: myHist==NULL\n" ); 135 testStatus = false; 136 } 137 137 psFree( myHist ); 138 139 138 139 140 140 // Verify the return value is the same as the input parameter myHist and 141 141 // program execution doesn't stop, if the input parameter myArray has no … … 159 159 "Calling psVectorHistogram() with various NULL inputs.", 160 160 testStatus ); 161 161 162 162 /*************************************************************************/ 163 163 /* Deallocate data structures */ … … 166 166 "psStats functions", 167 167 "Deallocate the psHistogram structure." ); 168 168 169 169 psMemCheckCorruption( 1 ); 170 170 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 171 171 if ( 0 != memLeaks ) { 172 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );173 }172 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 173 } 174 174 psMemCheckCorruption( 1 ); 175 175 176 176 printFooter( stdout, 177 177 "psStats functions", 178 178 "Deallocate the psHistogram structure.", 179 179 testStatus ); 180 180 181 181 return ( !testStatus ); 182 182 } -
trunk/psLib/test/dataManip/tst_psMatrix01.c
r1346 r1406 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-0 7-30 02:55:47$13 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-06 22:34:06 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 #define PRINT_MATRIX(IMAGE) \ 24 24 for(int i=IMAGE->numRows-1; i>-1; i--) { \ 25 for(int j=0; j<IMAGE->numCols; j++) { \26 printf("%f ", IMAGE->data.F64[i][j]); \27 } \28 printf("\n"); \29 }30 25 for(int j=0; j<IMAGE->numCols; j++) { \ 26 printf("%f ", IMAGE->data.F64[i][j]); \ 27 } \ 28 printf("\n"); \ 29 } 30 31 31 int main( int argc, 32 32 char* argv[] ) 33 33 { 34 34 psImage * tempImage = NULL; 35 36 35 36 37 37 // Test A - Create input and output images 38 38 printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" ); … … 50 50 PRINT_MATRIX( inImage ); 51 51 printFooter( stdout, "psMatrix", "Create input and output images", true ); 52 53 52 53 54 54 // Test B - Transpose input image into output image 55 55 printPositiveTestHeader( stdout, "psMatrix", "Transpose input image into output image" ); … … 58 58 PRINT_MATRIX( outImage ); 59 59 if ( outImage->type.dimen != PS_DIMEN_IMAGE ) { 60 printf( "Error: Resulting image is not PS_DIMEN_IMAGE\n" ); 61 } else if ( outImage != tempImage ) { 60 printf( "Error: Resulting image is not PS_DIMEN_IMAGE\n" ); 61 } else 62 if ( outImage != tempImage ) { 62 63 printf( "Error: Return pointer not equal to output argument pointer\n" ); 63 64 } 64 65 printFooter( stdout, "psMatrix", "Transpose input image into output image", true ); 65 66 66 67 67 68 // Test C - Transpose input image into auto allocated NULL output image 68 69 printPositiveTestHeader( stdout, "psMatrix", "ranspose input image into auto allocated NULL output image" ); … … 71 72 PRINT_MATRIX( outImageNull ); 72 73 printFooter( stdout, "psMatrix", "ranspose input image into auto allocated NULL output image", true ); 73 74 74 75 75 76 // Test D - Free images and check for leaks 76 77 printPositiveTestHeader( stdout, "psMatrix", "Free images and check for leaks" ); … … 80 81 int nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 81 82 if ( nLeaks != 0 ) { 82 printf( "ERROR: Found %d memory leaks\n", nLeaks );83 }83 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 84 } 84 85 int nBad = psMemCheckCorruption( 0 ); 85 86 if ( nBad ) { 86 printf( "ERROR: Found %d bad memory blocks\n", nBad );87 }87 printf( "ERROR: Found %d bad memory blocks\n", nBad ); 88 } 88 89 printFooter( stdout, "psMatrix" , "Free images and check for leaks", true ); 89 90 90 91 return 0; 91 92 } -
trunk/psLib/test/dataManip/tst_psMatrix02.c
r798 r1406 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-0 5-28 02:52:23$15 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-08-06 22:34:06 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/dataManip/tst_psMatrix03.c
r1181 r1406 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-0 7-01 23:29:34$16 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-08-06 22:34:06 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 83 83 if(luImage->type.dimen != PS_DIMEN_IMAGE) { 84 84 printf("Error: Resulting image is not PS_DIMEN_IMAGE\n"); 85 } else if(luImage != tempImage) { 86 printf("Error: Return pointer not equal to output argument pointer\n"); 87 } 85 } else 86 if(luImage != tempImage) { 87 printf("Error: Return pointer not equal to output argument pointer\n"); 88 } 88 89 printFooter(stdout, "psMatrix", "Calculate LU matrix", true); 89 90 … … 96 97 if(outVector->type.dimen != PS_DIMEN_VECTOR) { 97 98 printf("Error: Resulting image is not PS_DIMEN_VECTOR\n"); 98 } else if(outVector != tempVector) { 99 printf("Error: Return pointer not equal to output argument pointer\n"); 100 } 99 } else 100 if(outVector != tempVector) { 101 printf("Error: Return pointer not equal to output argument pointer\n"); 102 } 101 103 printFooter(stdout, "psMatrix", "Determine solution to matrix equation", true); 102 104 -
trunk/psLib/test/dataManip/tst_psMatrix04.c
r1073 r1406 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2004-0 6-23 23:00:17$15 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-08-06 22:34:06 $ 17 17 * 18 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 67 67 if(outImage->type.dimen != PS_DIMEN_IMAGE) { 68 68 printf("Error: Resulting image is not PS_DIMEN_IMAGE\n"); 69 } else if(outImage != tempImage) { 70 printf("Error: Return pointer not equal to output argument pointer\n"); 71 } 69 } else 70 if(outImage != tempImage) { 71 printf("Error: Return pointer not equal to output argument pointer\n"); 72 } 72 73 printFooter(stdout, "psMatrix", "Invert matrix and calculate determinant", true); 73 74 -
trunk/psLib/test/dataManip/tst_psMatrix05.c
r1347 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-30 03:13:08$12 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #define PRINT_MATRIX(IMAGE) \ 23 23 for(int i=0; i<IMAGE->numRows; i++) { \ 24 for(int j=0; j<IMAGE->numCols; j++) { \25 printf("%f ", IMAGE->data.F64[i][j]); \26 } \27 printf("\n"); \28 }29 30 24 for(int j=0; j<IMAGE->numCols; j++) { \ 25 printf("%f ", IMAGE->data.F64[i][j]); \ 26 } \ 27 printf("\n"); \ 28 } 29 30 31 31 int main( int argc, 32 32 char* argv[] ) … … 35 35 psImage *inImage1 = NULL; 36 36 psImage *inImage2 = NULL; 37 38 37 38 39 39 // Test A - Create input and output images 40 40 printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" ); … … 54 54 PRINT_MATRIX( inImage2 ); 55 55 printFooter( stdout, "psMatrix", "Create input and output images", true ); 56 57 56 57 58 58 // Test B - Multiply images 59 59 printPositiveTestHeader( stdout, "psMatrix", "Multiply images" ); … … 61 61 PRINT_MATRIX( outImage ); 62 62 printFooter( stdout, "psMatrix", "Multiply images", true ); 63 64 63 64 65 65 // Test C - Free input and output images 66 66 printPositiveTestHeader( stdout, "psMatrix", "Free input and output images" ); … … 70 70 int nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 71 71 if ( nLeaks != 0 ) { 72 printf( "ERROR: Found %d memory leaks\n", nLeaks );73 }72 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 73 } 74 74 int nBad = psMemCheckCorruption( 0 ); 75 75 if ( nBad ) { 76 printf( "ERROR: Found %d bad memory blocks\n", nBad );77 }76 printf( "ERROR: Found %d bad memory blocks\n", nBad ); 77 } 78 78 printFooter( stdout, "psMatrix" , "Free input and output images", true ); 79 79 80 80 return 0; 81 81 } -
trunk/psLib/test/dataManip/tst_psMatrix06.c
r1348 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 7-30 03:48:15$12 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 22 22 #define PRINT_MATRIX(IMAGE) \ 23 23 for(int i=0; i<IMAGE->numRows; i++) { \ 24 for(int j=0; j<IMAGE->numCols; j++) { \25 printf("%f ", IMAGE->data.F64[i][j]); \26 } \27 printf("\n"); \28 }29 30 24 for(int j=0; j<IMAGE->numCols; j++) { \ 25 printf("%f ", IMAGE->data.F64[i][j]); \ 26 } \ 27 printf("\n"); \ 28 } 29 30 31 31 int main( int argc, 32 32 char* argv[] ) … … 34 34 psImage * outImage = NULL; 35 35 psImage *inImage = NULL; 36 37 36 37 38 38 // Test A - Create input and output images 39 39 printPositiveTestHeader( stdout, "psMatrix", "Create input and output images" ); 40 40 outImage = ( psImage* ) psImageAlloc( 4, 4, PS_TYPE_F64 ); 41 41 inImage = ( psImage* ) psImageAlloc( 4, 4, PS_TYPE_F64 ); 42 42 43 43 inImage->data.F64[ 0 ][ 0 ] = 1. / 1.; 44 44 inImage->data.F64[ 0 ][ 1 ] = 1. / 2.; 45 45 inImage->data.F64[ 0 ][ 2 ] = 1. / 3.; 46 46 inImage->data.F64[ 0 ][ 3 ] = 1. / 4.; 47 47 48 48 inImage->data.F64[ 1 ][ 0 ] = 1. / 2.; 49 49 inImage->data.F64[ 1 ][ 1 ] = 1. / 3.; 50 50 inImage->data.F64[ 1 ][ 2 ] = 1. / 4.; 51 51 inImage->data.F64[ 1 ][ 3 ] = 1. / 5.; 52 52 53 53 inImage->data.F64[ 2 ][ 0 ] = 1. / 3.; 54 54 inImage->data.F64[ 2 ][ 1 ] = 1. / 4.; 55 55 inImage->data.F64[ 2 ][ 2 ] = 1. / 5.; 56 56 inImage->data.F64[ 2 ][ 3 ] = 1. / 6.; 57 57 58 58 inImage->data.F64[ 3 ][ 0 ] = 1. / 4.; 59 59 inImage->data.F64[ 3 ][ 1 ] = 1. / 5.; 60 60 inImage->data.F64[ 3 ][ 2 ] = 1. / 6.; 61 61 inImage->data.F64[ 3 ][ 3 ] = 1. / 7.; 62 62 63 63 PRINT_MATRIX( inImage ); 64 64 printFooter( stdout, "psMatrix", "Create input and output images", true ); 65 66 65 66 67 67 // Test B - Calculate Eigenvectors 68 68 printPositiveTestHeader( stdout, "psMatrix", "Calculate Eigenvectors" ); … … 70 70 PRINT_MATRIX( outImage ); 71 71 printFooter( stdout, "psMatrix", "Calculate Eigenvectors", true ); 72 73 72 73 74 74 // Test C - Free input and output images 75 75 printPositiveTestHeader( stdout, "psMatrix", "Free input and output images" ); … … 78 78 int nLeaks = psMemCheckLeaks( 0, NULL, stdout ); 79 79 if ( nLeaks != 0 ) { 80 printf( "ERROR: Found %d memory leaks\n", nLeaks );81 }80 printf( "ERROR: Found %d memory leaks\n", nLeaks ); 81 } 82 82 int nBad = psMemCheckCorruption( 0 ); 83 83 if ( nBad ) { 84 printf( "ERROR: Found %d bad memory blocks\n", nBad );85 }84 printf( "ERROR: Found %d bad memory blocks\n", nBad ); 85 } 86 86 printFooter( stdout, "psMatrix" , "Free input and output images", true ); 87 87 88 88 return 0; 89 89 } -
trunk/psLib/test/dataManip/tst_psMatrix07.c
r1073 r1406 16 16 * @author Ross Harman, MHPCC 17 17 * 18 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $19 * @date $Date: 2004-0 6-23 23:00:17$18 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 19 * @date $Date: 2004-08-06 22:34:06 $ 20 20 * 21 21 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 88 88 if(v1->type.dimen != PS_DIMEN_VECTOR) { 89 89 printf("Error: Resulting image is not PS_DIMEN_VECTOR\n"); 90 } else if(v1 != tempVector) { 91 printf("Error: Return pointer not equal to output argument pointer\n"); 92 } 90 } else 91 if(v1 != tempVector) { 92 printf("Error: Return pointer not equal to output argument pointer\n"); 93 } 93 94 printFooter(stdout, "psMatrix", "Convert matrix to PS_DIMEN_VECTOR vector", true); 94 95 … … 108 109 if(v1->type.dimen != PS_DIMEN_TRANSV) { 109 110 printf("Error: Resulting image is not PS_DIMEN_TRANSV\n"); 110 } else if(v1 != tempVector) { 111 printf("Error: Return pointer not equal to output argument pointer\n"); 112 } 111 } else 112 if(v1 != tempVector) { 113 printf("Error: Return pointer not equal to output argument pointer\n"); 114 } 113 115 printFooter(stdout, "psMatrix", "Convert matrix to PS_DIMEN_TRANSV vector", true); 114 116 … … 128 130 if(m2->type.dimen != PS_DIMEN_IMAGE) { 129 131 printf("Error: Resulting image is not PS_DIMEN_IMAGE\n"); 130 } else if(m2 != tempImage) { 131 printf("Error: Return pointer not equal to output argument pointer\n"); 132 } 132 } else 133 if(m2 != tempImage) { 134 printf("Error: Return pointer not equal to output argument pointer\n"); 135 } 133 136 printFooter(stdout, "psMatrix", "Convert PS_DIMEN_VECTOR vector to matrix", true); 134 137 … … 149 152 if(m3->type.dimen != PS_DIMEN_IMAGE) { 150 153 printf("Error: Resulting image is not PS_DIMEN_IMAGE\n"); 151 } else if(m3 != tempImage) { 152 printf("Error: Return pointer not equal to output argument pointer\n"); 153 } 154 } else 155 if(m3 != tempImage) { 156 printf("Error: Return pointer not equal to output argument pointer\n"); 157 } 154 158 printFooter(stdout, "psMatrix", "Convert PS_DIMEN_TRANSV vector to matrix", true); 155 159 -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic01.c
r1114 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 6-29 01:52:19$12 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic02.c
r1365 r1406 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 2 19:43:23$12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 #define PRINT_SCALAR(SCALAR,TYPE) \ 26 26 if(PS_IS_PSELEMTYPE_COMPLEX(SCALAR->type.type)) { \ 27 printf("%.2f%f+.2i ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE)); \28 } else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) { \29 printf("%d", (int)SCALAR->data.TYPE); \30 } else { \31 printf("%.2f", (double)SCALAR->data.TYPE); \32 } \27 printf("%.2f%f+.2i ", creal(SCALAR->data.TYPE), cimag(SCALAR->data.TYPE)); \ 28 } else if(PS_IS_PSELEMTYPE_INT(SCALAR->type.type)) { \ 29 printf("%d", (int)SCALAR->data.TYPE); \ 30 } else { \ 31 printf("%.2f", (double)SCALAR->data.TYPE); \ 32 } \ 33 33 printf("\n\n"); 34 34 … … 36 36 #define PRINT_VECTOR(VECTOR,TYPE) \ 37 37 for(int i=0; i<VECTOR->n; i++) { \ 38 if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) { \39 printf("%.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i])); \40 } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) { \41 printf("%d\n", (int)VECTOR->data.TYPE[i]); \42 } else { \43 printf("%.2f\n", (double)VECTOR->data.TYPE[i]); \44 } \45 } \38 if(PS_IS_PSELEMTYPE_COMPLEX(VECTOR->type.type)) { \ 39 printf("%.2f%+.2fi\n", creal(VECTOR->data.TYPE[i]), cimag(VECTOR->data.TYPE[i])); \ 40 } else if(PS_IS_PSELEMTYPE_INT(VECTOR->type.type)) { \ 41 printf("%d\n", (int)VECTOR->data.TYPE[i]); \ 42 } else { \ 43 printf("%.2f\n", (double)VECTOR->data.TYPE[i]); \ 44 } \ 45 } \ 46 46 printf("\n"); 47 47 … … 49 49 #define PRINT_MATRIX(IMAGE,TYPE) \ 50 50 for(int i=IMAGE->numRows-1; i>-1; i--) { \ 51 for(int j=0; j<IMAGE->numCols; j++) { \52 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) { \53 printf("%.2f%+.2fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j])); \54 } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) { \55 printf("%d ", (int)IMAGE->data.TYPE[i][j]); \56 } else { \57 printf("%.2f ", (double)IMAGE->data.TYPE[i][j]); \58 } \59 } \60 printf("\n"); \61 } \51 for(int j=0; j<IMAGE->numCols; j++) { \ 52 if(PS_IS_PSELEMTYPE_COMPLEX(IMAGE->type.type)) { \ 53 printf("%.2f%+.2fi ", creal(IMAGE->data.TYPE[i][j]), cimag(IMAGE->data.TYPE[i][j])); \ 54 } else if(PS_IS_PSELEMTYPE_INT(IMAGE->type.type)) { \ 55 printf("%d ", (int)IMAGE->data.TYPE[i][j]); \ 56 } else { \ 57 printf("%.2f ", (double)IMAGE->data.TYPE[i][j]); \ 58 } \ 59 } \ 60 printf("\n"); \ 61 } \ 62 62 printf("\n"); 63 63 … … 66 66 psVector *NAME = (psVector*)psVectorAlloc(SIZE, PS_TYPE_##TYPE); \ 67 67 for(int i=0; i<SIZE; i++) { \ 68 NAME->data.TYPE[i] = VALUE; \69 } \68 NAME->data.TYPE[i] = VALUE; \ 69 } \ 70 70 NAME->n = SIZE; 71 71 … … 74 74 psImage *NAME = (psImage*)psImageAlloc(NCOLS,NROWS,PS_TYPE_##TYPE); \ 75 75 for(int i=0; i<NAME->numRows; i++) { \ 76 for(int j=0; j<NAME->numCols; j++) { \77 NAME->data.TYPE[i][j] = VALUE; \78 } \79 }80 81 76 for(int j=0; j<NAME->numCols; j++) { \ 77 NAME->data.TYPE[i][j] = VALUE; \ 78 } \ 79 } 80 81 82 82 #define CHECK_MEMORY \ 83 83 psMemCheckLeaks(0, NULL, stdout); \ 84 84 int nBad = psMemCheckCorruption(0); \ 85 85 if(nBad) { \ 86 printf("ERROR: Found %d bad memory blocks\n", nBad); \87 }88 89 86 printf("ERROR: Found %d bad memory blocks\n", nBad); \ 87 } 88 89 90 90 int main( int argc, char* argv[] ) 91 91 { … … 109 109 printFooter(stdout, "psMatrixVectorArithmetic", "Test matrix psUnaryOp", true); \ 110 110 } 111 111 112 112 testBinaryOpM( abs, S32, -10, 0, 3, 2 ); 113 113 testBinaryOpM( abs, F32, -10.0, 0.0, 3, 2 ); … … 178 178 testBinaryOpM( datan, F64, 1.0, 0.0, 3, 2 ); 179 179 testBinaryOpM( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2 ); 180 181 180 181 182 182 // Test vector unary operations 183 183 #define testBinaryOpV(OP,TYPE,VALUE1,VALUE2,SIZE) \ … … 198 198 printFooter(stdout, "psMatrixVectorArithmetic", "Test vector psUnaryOp", true); \ 199 199 } 200 200 201 201 testBinaryOpV( abs, S32, -10, 0, 3 ); 202 202 testBinaryOpV( abs, F32, -10.0, 0.0, 3 ); … … 267 267 testBinaryOpV( datan, F64, 1.0, 0.0, 3 ); 268 268 testBinaryOpV( datan, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3 ); 269 269 270 270 return 0; 271 271 } -
trunk/psLib/test/dataManip/tst_psMatrixVectorArithmetic03.c
r1150 r1406 15 15 * @author Ross Harman, MHPCC 16 16 * 17 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $18 * @date $Date: 2004-0 6-30 20:07:07$17 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2004-08-06 22:34:06 $ 19 19 * 20 20 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/dataManip/tst_psMinimize00.c
r1177 r1406 45 45 tmp = 1.0; 46 46 tmp = x; 47 } else if (whichParamDeriv == 1) { 48 tmp = x; 49 tmp = x*x; 50 } else if (whichParamDeriv == 2) { 51 tmp = y; 52 tmp = y*y; 53 } else if (whichParamDeriv == 3) { 54 tmp = x * x * y; 55 } 47 } else 48 if (whichParamDeriv == 1) { 49 tmp = x; 50 tmp = x*x; 51 } else 52 if (whichParamDeriv == 2) { 53 tmp = y; 54 tmp = y*y; 55 } else 56 if (whichParamDeriv == 3) { 57 tmp = x * x * y; 58 } 56 59 57 60 // printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f %.1f %.1f (%d)) is %.1f ---------\n", -
trunk/psLib/test/dataManip/tst_psMinimize01.c
r1177 r1406 44 44 if (whichParamDeriv == 0) { 45 45 tmp = exp(-lambda * x); 46 } else if (whichParamDeriv == 1) { 47 tmp = -x * A * exp(-lambda * x); 48 } else if (whichParamDeriv == 2) { 49 tmp = 1.0; 50 } 46 } else 47 if (whichParamDeriv == 1) { 48 tmp = -x * A * exp(-lambda * x); 49 } else 50 if (whichParamDeriv == 2) { 51 tmp = 1.0; 52 } 51 53 52 54 // printf("--------- myFuncDeriv((%.1f) %.1f %.1f %.1f, %d) is %.1f ---------\n", -
trunk/psLib/test/dataManip/tst_psMinimize02.c
r1185 r1406 44 44 if (whichParamDeriv == 0) { 45 45 tmp = 20.0 * (x - P0); 46 } else if (whichParamDeriv == 1) { 47 tmp = 40.0 * (y - P1); 48 } 46 } else 47 if (whichParamDeriv == 1) { 48 tmp = 40.0 * (y - P1); 49 } 49 50 50 51 // printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f (%d)) is %.1f ---------\n", … … 83 84 tmp = 1.0; 84 85 tmp = x; 85 } else if (whichParamDeriv == 1) { 86 tmp = x; 87 tmp = x*x; 88 } else if (whichParamDeriv == 2) { 89 tmp = y; 90 tmp = y*y; 91 } else if (whichParamDeriv == 3) { 92 tmp = x * x * y; 93 } 86 } else 87 if (whichParamDeriv == 1) { 88 tmp = x; 89 tmp = x*x; 90 } else 91 if (whichParamDeriv == 2) { 92 tmp = y; 93 tmp = y*y; 94 } else 95 if (whichParamDeriv == 3) { 96 tmp = x * x * y; 97 } 94 98 95 99 printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f %.1f %.1f (%d)) is %.1f ---------\n", -
trunk/psLib/test/dataManip/tst_psMinimize03.c
r1185 r1406 44 44 if (whichParamDeriv == 0) { 45 45 tmp = 20.0 * (x - P0); 46 } else if (whichParamDeriv == 1) { 47 tmp = 40.0 * (y - P1); 48 } 46 } else 47 if (whichParamDeriv == 1) { 48 tmp = 40.0 * (y - P1); 49 } 49 50 50 51 // printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f (%d)) is %.1f ---------\n", … … 83 84 tmp = 1.0; 84 85 tmp = x; 85 } else if (whichParamDeriv == 1) { 86 tmp = x; 87 tmp = x*x; 88 } else if (whichParamDeriv == 2) { 89 tmp = y; 90 tmp = y*y; 91 } else if (whichParamDeriv == 3) { 92 tmp = x * x * y; 93 } 86 } else 87 if (whichParamDeriv == 1) { 88 tmp = x; 89 tmp = x*x; 90 } else 91 if (whichParamDeriv == 2) { 92 tmp = y; 93 tmp = y*y; 94 } else 95 if (whichParamDeriv == 3) { 96 tmp = x * x * y; 97 } 94 98 95 99 printf("--------- myFuncDeriv((%.1f %.1f) %.1f %.1f %.1f %.1f (%d)) is %.1f ---------\n", -
trunk/psLib/test/dataManip/tst_psStats07.c
r1365 r1406 45 45 float realN50WithMask = ( float ) N / 4; 46 46 float realNfitWithMask = ( float ) N / 4; 47 48 47 48 49 49 /*************************************************************************/ 50 50 /* Allocate and initialize data structures */ … … 55 55 PS_STAT_ROBUST_STDEV | 56 56 PS_STAT_ROBUST_QUARTILE ); 57 57 58 58 maskVector = psVectorAlloc( N, PS_TYPE_U8 ); 59 59 maskVector->n = N; … … 61 61 // Set the mask vector and calculate the expected maximum. 62 62 for ( i = 0;i < N;i++ ) { 63 if ( i < ( N / 2 ) ) { 64 maskVector->data.U8[ i ] = 0; 65 count++; 66 } else { 67 maskVector->data.U8[ i ] = 1; 68 } 63 if ( i < ( N / 2 ) ) { 64 maskVector->data.U8[ i ] = 0; 65 count++; 66 } else { 67 maskVector->data.U8[ i ] = 1; 69 68 } 69 } 70 70 /*************************************************************************/ 71 71 /* Call psVectorStats() with no vector mask. */ … … 74 74 "psStats functions", 75 75 "PS_STAT_ROBUST_STATS: robust mean: no vector mask" ); 76 76 77 77 myStats = psVectorStats( myStats, myVector, NULL, 0 ); 78 78 79 79 printf( "The expected Mean was %.2f; the calculated Mean was %.2f\n", 80 80 realMeanNoMask, myStats->robustMean ); 81 81 82 82 if ( fabs( myStats->robustMean - realMeanNoMask ) < ( ERROR_TOLERANCE * realMeanNoMask ) ) { 83 testStatus = true;84 } else {85 testStatus = false;86 globalTestStatus = false;87 }83 testStatus = true; 84 } else { 85 testStatus = false; 86 globalTestStatus = false; 87 } 88 88 printFooter( stdout, 89 89 "psVector functions", 90 90 "PS_STAT_ROBUST_STATS: robust mean: no vector mask", 91 91 testStatus ); 92 93 92 93 94 94 printPositiveTestHeader( stdout, 95 95 "psStats functions", 96 96 "PS_STAT_ROBUST_STATS: robust Median: no vector mask" ); 97 97 98 98 printf( "The expected Median was %.2f; the calculated Median was %.2f\n", 99 99 realMedianNoMask, myStats->robustMedian ); 100 100 if ( fabs( myStats->robustMedian - realMedianNoMask ) < ( ERROR_TOLERANCE * realMedianNoMask ) ) { 101 testStatus = true;102 } else {103 testStatus = false;104 globalTestStatus = false;105 }101 testStatus = true; 102 } else { 103 testStatus = false; 104 globalTestStatus = false; 105 } 106 106 printFooter( stdout, 107 107 "psVector functions", 108 108 "PS_STAT_ROBUST_STATS: robust Median: no vector mask", 109 109 testStatus ); 110 110 111 111 printPositiveTestHeader( stdout, 112 112 "psStats functions", 113 113 "PS_STAT_ROBUST_STATS: robust Mode: no vector mask" ); 114 115 114 115 116 116 printf( "The expected Mode was %.2f; the calculated Mode was %.2f\n", 117 117 realModeNoMask, myStats->robustMode ); 118 118 if ( fabs( myStats->robustMode - realModeNoMask ) < ( ERROR_TOLERANCE * realModeNoMask ) ) { 119 testStatus = true;120 } else {121 testStatus = false;122 globalTestStatus = false;123 }119 testStatus = true; 120 } else { 121 testStatus = false; 122 globalTestStatus = false; 123 } 124 124 printFooter( stdout, 125 125 "psVector functions", 126 126 "PS_STAT_ROBUST_STATS: robust Mode: no vector mask", 127 127 testStatus ); 128 129 130 128 129 130 131 131 printPositiveTestHeader( stdout, 132 132 "psStats functions", 133 133 "PS_STAT_ROBUST_STATS: robust Stdev: no vector mask" ); 134 134 135 135 printf( "The expected Stdev was %.2f; the calculated Stdev was %.2f\n", 136 136 realStdevNoMask, myStats->robustStdev ); 137 137 if ( fabs( myStats->robustStdev - realStdevNoMask ) < ( ERROR_TOLERANCE * realStdevNoMask ) ) { 138 testStatus = true;139 } else {140 testStatus = false;141 globalTestStatus = false;142 }138 testStatus = true; 139 } else { 140 testStatus = false; 141 globalTestStatus = false; 142 } 143 143 printFooter( stdout, 144 144 "psVector functions", 145 145 "PS_STAT_ROBUST_STATS: robust Stdev: no vector mask", 146 146 testStatus ); 147 148 149 147 148 149 150 150 printPositiveTestHeader( stdout, 151 151 "psStats functions", 152 152 "PS_STAT_ROBUST_STATS: lower quartile: no vector mask" ); 153 153 154 154 printf( "The expected LQ was %.2f; the calculated LQ was %.2f\n", 155 155 realLQNoMask, myStats->robustLQ ); 156 156 157 157 if ( fabs( myStats->robustLQ - realLQNoMask ) < ( ERROR_TOLERANCE * realLQNoMask ) ) { 158 testStatus = true;159 } else {160 testStatus = false;161 globalTestStatus = false;162 }158 testStatus = true; 159 } else { 160 testStatus = false; 161 globalTestStatus = false; 162 } 163 163 printFooter( stdout, 164 164 "psVector functions", 165 165 "PS_STAT_ROBUST_STATS: lower quartile: no vector mask", 166 166 testStatus ); 167 168 169 167 168 169 170 170 printPositiveTestHeader( stdout, 171 171 "psStats functions", 172 172 "PS_STAT_ROBUST_STATS: upper quartile: no vector mask" ); 173 173 174 174 printf( "The expected UQ was %.2f; the calculated UQ was %.2f\n", 175 175 realUQNoMask, myStats->robustUQ ); 176 176 if ( fabs( myStats->robustUQ - realUQNoMask ) < ( ERROR_TOLERANCE * realUQNoMask ) ) { 177 testStatus = true;178 } else {179 testStatus = false;180 globalTestStatus = false;181 }177 testStatus = true; 178 } else { 179 testStatus = false; 180 globalTestStatus = false; 181 } 182 182 printFooter( stdout, 183 183 "psVector functions", 184 184 "PS_STAT_ROBUST_STATS: lower quartile: no vector mask", 185 185 testStatus ); 186 187 188 186 187 188 189 189 printPositiveTestHeader( stdout, 190 190 "psStats functions", 191 191 "PS_STAT_ROBUST_STATS: robust N50: no vector mask" ); 192 192 193 193 // XXX: 194 194 realN50NoMask = myStats->robustN50; 195 195 196 196 printf( "The expected N50 was %.2f; the calculated N50 was %.2f\n", 197 197 realN50NoMask, myStats->robustN50 ); 198 198 if ( fabs( myStats->robustN50 - realN50NoMask ) < ( ERROR_TOLERANCE * realN50NoMask ) ) { 199 testStatus = true;200 } else {201 testStatus = false;202 globalTestStatus = false;203 }199 testStatus = true; 200 } else { 201 testStatus = false; 202 globalTestStatus = false; 203 } 204 204 printFooter( stdout, 205 205 "psVector functions", 206 206 "PS_STAT_ROBUST_STATS: robust N50: no vector mask", 207 207 testStatus ); 208 209 210 208 209 210 211 211 printPositiveTestHeader( stdout, 212 212 "psStats functions", 213 213 "PS_STAT_ROBUST_STATS: robust Nfit: no vector mask" ); 214 214 215 215 // XXX: 216 216 realNfitNoMask = myStats->robustNfit; 217 217 218 218 printf( "The expected Nfit was %.2f; the calculated Nfit was %.2f\n", 219 219 realNfitNoMask, myStats->robustNfit ); 220 220 if ( fabs( myStats->robustNfit - realNfitNoMask ) < ( ERROR_TOLERANCE * realNfitNoMask ) ) { 221 testStatus = true;222 } else {223 testStatus = false;224 globalTestStatus = false;225 }221 testStatus = true; 222 } else { 223 testStatus = false; 224 globalTestStatus = false; 225 } 226 226 printFooter( stdout, 227 227 "psVector functions", 228 228 "PS_STAT_ROBUST_STATS: robust Nfit: no vector mask", 229 229 testStatus ); 230 231 230 231 232 232 return ( 0 ); 233 233 234 234 /*************************************************************************/ 235 235 /* Call psVectorStats() with vector mask. */ … … 238 238 "psStats functions", 239 239 "PS_STAT_ROBUST_STATS: robust mean: with vector mask" ); 240 240 241 241 printf( "Calling psVectorStats() on a vector with elements masked.\n" ); 242 242 myStats = psVectorStats( myStats, myVector, maskVector, 1 ); … … 245 245 realMeanWithMask, myStats->robustMean ); 246 246 if ( fabs( myStats->robustMean - realMeanWithMask ) < ( ERROR_TOLERANCE * realMeanWithMask ) ) { 247 testStatus = true;248 } else {249 testStatus = false;250 globalTestStatus = false;251 }247 testStatus = true; 248 } else { 249 testStatus = false; 250 globalTestStatus = false; 251 } 252 252 printFooter( stdout, 253 253 "psVector functions", 254 254 "PS_STAT_ROBUST_STATS: robust mean: with vector mask", 255 255 testStatus ); 256 257 258 256 257 258 259 259 printPositiveTestHeader( stdout, 260 260 "psStats functions", 261 261 "PS_STAT_ROBUST_STATS: robust Median: with vector mask" ); 262 262 263 263 printf( "The expected Median was %.2f; the calculated Median was %.2f\n", 264 264 realMedianWithMask, myStats->robustMedian ); 265 265 if ( fabs( myStats->robustMedian - realMedianWithMask ) < ( ERROR_TOLERANCE * realMedianWithMask ) ) { 266 testStatus = true;267 } else {268 testStatus = false;269 globalTestStatus = false;270 }266 testStatus = true; 267 } else { 268 testStatus = false; 269 globalTestStatus = false; 270 } 271 271 printFooter( stdout, 272 272 "psVector functions", 273 273 "PS_STAT_ROBUST_STATS: robust Median: with vector mask", 274 274 testStatus ); 275 276 277 275 276 277 278 278 printPositiveTestHeader( stdout, 279 279 "psStats functions", 280 280 "PS_STAT_ROBUST_STATS: robust Mode: with vector mask" ); 281 281 282 282 printf( "The expected Mode was %.2f; the calculated Mode was %.2f\n", 283 283 realModeWithMask, myStats->robustMode ); 284 284 if ( fabs( myStats->robustMode - realModeWithMask ) < ( ERROR_TOLERANCE * realModeWithMask ) ) { 285 testStatus = true;286 } else {287 testStatus = false;288 globalTestStatus = false;289 }285 testStatus = true; 286 } else { 287 testStatus = false; 288 globalTestStatus = false; 289 } 290 290 printFooter( stdout, 291 291 "psVector functions", 292 292 "PS_STAT_ROBUST_STATS: robust Mode: with vector mask", 293 293 testStatus ); 294 295 296 294 295 296 297 297 printPositiveTestHeader( stdout, 298 298 "psStats functions", 299 299 "PS_STAT_ROBUST_STATS: robust Stdev: with vector mask" ); 300 300 301 301 printf( "The expected Stdev was %.2f; the calculated Stdev was %.2f\n", 302 302 realStdevWithMask, myStats->robustStdev ); 303 303 if ( fabs( myStats->robustStdev - realStdevWithMask ) < ( ERROR_TOLERANCE * realStdevWithMask ) ) { 304 testStatus = true;305 } else {306 testStatus = false;307 globalTestStatus = false;308 }304 testStatus = true; 305 } else { 306 testStatus = false; 307 globalTestStatus = false; 308 } 309 309 printFooter( stdout, 310 310 "psVector functions", 311 311 "PS_STAT_ROBUST_STATS: robust Stdev: with vector mask", 312 312 testStatus ); 313 314 315 313 314 315 316 316 printPositiveTestHeader( stdout, 317 317 "psStats functions", 318 318 "PS_STAT_ROBUST_STATS: lower quartile: with vector mask" ); 319 319 320 320 printf( "The expected LQ was %.2f; the calculated LQ was %.2f\n", 321 321 realLQWithMask, myStats->robustLQ ); 322 322 if ( fabs( myStats->robustLQ - realLQWithMask ) < ( ERROR_TOLERANCE * realLQWithMask ) ) { 323 testStatus = true;324 } else {325 testStatus = false;326 globalTestStatus = false;327 }323 testStatus = true; 324 } else { 325 testStatus = false; 326 globalTestStatus = false; 327 } 328 328 printFooter( stdout, 329 329 "psVector functions", 330 330 "PS_STAT_ROBUST_STATS: lower quartile: with vector mask", 331 331 testStatus ); 332 333 334 332 333 334 335 335 printPositiveTestHeader( stdout, 336 336 "psStats functions", 337 337 "PS_STAT_ROBUST_STATS: upper quartile: with vector mask" ); 338 338 339 339 printf( "The expected UQ was %.2f; the calculated UQ was %.2f\n", 340 340 realUQWithMask, myStats->robustUQ ); 341 341 if ( fabs( myStats->robustUQ - realUQWithMask ) < ( ERROR_TOLERANCE * realUQWithMask ) ) { 342 testStatus = true;343 } else {344 testStatus = false;345 globalTestStatus = false;346 }342 testStatus = true; 343 } else { 344 testStatus = false; 345 globalTestStatus = false; 346 } 347 347 printFooter( stdout, 348 348 "psVector functions", 349 349 "PS_STAT_ROBUST_STATS: lower quartile: with vector mask", 350 350 testStatus ); 351 352 353 351 352 353 354 354 printPositiveTestHeader( stdout, 355 355 "psStats functions", 356 356 "PS_STAT_ROBUST_STATS: robust N50: with vector mask" ); 357 357 358 358 printf( "The expected N50 was %.2f; the calculated N50 was %.2f\n", 359 359 realN50WithMask, myStats->robustN50 ); 360 360 if ( fabs( myStats->robustN50 - realN50WithMask ) < ( ERROR_TOLERANCE * realN50WithMask ) ) { 361 testStatus = true;362 } else {363 testStatus = false;364 globalTestStatus = false;365 }361 testStatus = true; 362 } else { 363 testStatus = false; 364 globalTestStatus = false; 365 } 366 366 printFooter( stdout, 367 367 "psVector functions", 368 368 "PS_STAT_ROBUST_STATS: robust N50: with vector mask", 369 369 testStatus ); 370 371 372 370 371 372 373 373 printPositiveTestHeader( stdout, 374 374 "psStats functions", 375 375 "PS_STAT_ROBUST_STATS: robust Nfit: with vector mask" ); 376 376 377 377 printf( "The expected Nfit was %.2f; the calculated Nfit was %.2f\n", 378 378 realNfitWithMask, myStats->robustNfit ); 379 379 if ( fabs( myStats->robustNfit - realNfitWithMask ) < ( ERROR_TOLERANCE * realNfitWithMask ) ) { 380 testStatus = true;381 } else {382 testStatus = false;383 globalTestStatus = false;384 }380 testStatus = true; 381 } else { 382 testStatus = false; 383 globalTestStatus = false; 384 } 385 385 printFooter( stdout, 386 386 "psVector functions", 387 387 "PS_STAT_ROBUST_STATS: robust Nfit: with vector mask", 388 388 testStatus ); 389 390 391 389 390 391 392 392 /*************************************************************************/ 393 393 /* Deallocate data structures */ … … 396 396 "psStats functions", 397 397 "psStats(): deallocating memory" ); 398 398 399 399 psFree( myStats ); 400 400 psFree( myVector ); 401 401 psFree( maskVector ); 402 402 403 403 psMemCheckCorruption( 1 ); 404 404 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 405 405 if ( 0 != memLeaks ) { 406 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );407 }408 406 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 407 } 408 409 409 printFooter( stdout, 410 410 "psVector functions", 411 411 "psStats(): deallocating memory", 412 412 testStatus ); 413 413 414 414 return ( !globalTestStatus ); 415 415 } -
trunk/psLib/test/dataManip/tst_psVectorFFT.c
r1404 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08-06 2 1:50:13$8 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:06 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/image/tst_psImage.c
r1212 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 7-13 01:37:58$8 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:06 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 26 26 27 27 testDescription tests[] = { 28 {testImageAlloc,546,"psImageAlloc",0,false}, 29 {testImageAlloc,548,"psImageFree",0,true}, 30 {testImageSubset,547,"psImageSubset",0,false}, 31 {testImageSubset,550,"psImageSubset",0,true}, 32 {testImageCopy,551,"psImageCopy",0,false}, 33 {NULL} 28 { 29 testImageAlloc,546,"psImageAlloc",0,false 30 }, 31 { 32 testImageAlloc,548,"psImageFree",0,true 33 }, 34 { 35 testImageSubset,547,"psImageSubset",0,false 36 }, 37 { 38 testImageSubset,550,"psImageSubset",0,true 39 }, 40 { 41 testImageCopy,551,"psImageCopy",0,false 42 }, 43 { 44 NULL 45 } 34 46 }; 35 47 … … 49 61 psImage* image = NULL; 50 62 unsigned int sizes = 6; 51 unsigned int numCols[] = {0,1,1,100,100,150}; 52 unsigned int numRows[] = {0,1,100,1,150,100}; 63 unsigned int numCols[] = { 64 0,1,1,100,100,150 65 }; 66 unsigned int numRows[] = { 67 0,1,100,1,150,100 68 }; 53 69 unsigned int types = 12; 54 70 psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64, -
trunk/psLib/test/image/tst_psImageExtraction.c
r1405 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08-06 22: 29:11$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:06 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/image/tst_psImageFFT.c
r1193 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 7-08 01:05:01$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:06 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 35 35 testDescription tests[] = { 36 {testImageFFT,600,"psImageFFT",0,false}, 37 {testImageRealImaginary,601,"psImageRealImaginary",0,false}, 38 {testImageComplex,602,"psImageComplex",0,false}, 39 {testImageConjugate,603,"psImageConjugate",0,false}, 40 {testImagePowerSpectrum,604,"psImagePowerSpectrum",0,false}, 41 {NULL} 36 { 37 testImageFFT,600,"psImageFFT",0,false 38 }, 39 { 40 testImageRealImaginary,601,"psImageRealImaginary",0,false 41 }, 42 { 43 testImageComplex,602,"psImageComplex",0,false 44 }, 45 { 46 testImageConjugate,603,"psImageConjugate",0,false 47 }, 48 { 49 testImagePowerSpectrum,604,"psImagePowerSpectrum",0,false 50 }, 51 { 52 NULL 53 } 42 54 }; 43 55 … … 89 101 psError(__func__,"Result invalid at %d,%d (%.2f)",col,row,mag); 90 102 } 91 } else if ( (col == 0 && (row == 1 || row == n-1)) 103 } else 104 if ( (col == 0 && (row == 1 || row == n-1)) 92 105 || (row == 0 && (col==1 || col == n-1)) ) { 93 psError(__func__,"Result invalid at %d,%d (%.2f)",col,row,mag);94 }106 psError(__func__,"Result invalid at %d,%d (%.2f)",col,row,mag); 107 } 95 108 } 96 109 } -
trunk/psLib/test/image/tst_psImageIO.c
r1253 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 7-21 23:49:52$8 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:06 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 35 35 36 36 testDescription tests[] = { 37 {testImageRead,567,"psImageReadSection",0,false}, 38 {testImageWrite,569,"psImageWriteSection",0,false}, 39 {NULL} 37 { 38 testImageRead,567,"psImageReadSection",0,false 39 }, 40 { 41 testImageWrite,569,"psImageWriteSection",0,false 42 }, 43 { 44 NULL 45 } 40 46 }; 41 47 … … 291 297 mkdir("tmpImages",0777); 292 298 remove 293 ("writeTest.fits"); 299 ("writeTest.fits") 300 ; 294 301 if (! psImageWriteSection(img,0,0,0,NULL,0,"tmpImages/writeTest.fits")) { 295 302 psError(__func__,"Couldn't write writeTest.fits."); -
trunk/psLib/test/image/tst_psImageManip.c
r1319 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-0 7-29 01:20:10$8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:06 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 34 34 testDescription tests[] = { 35 {testImageClip,571,"psImageClip",0,false}, 36 {testImageClipNAN,572,"psImageClipNAN",0,false}, 37 {testImageClipComplexRegion,673,"psImageClipComplexRegion",0,false}, 38 {testImageOverlay,573,"psImageOverlay",0,false}, 39 {testImageRebin,559,"psImageRebin",0,false}, 40 {testImageRoll,562,"psImageRoll",0,false}, 41 {testImageRotate,560,"psImageRotate",0,false}, 42 {NULL} 35 { 36 testImageClip,571,"psImageClip",0,false 37 }, 38 { 39 testImageClipNAN,572,"psImageClipNAN",0,false 40 }, 41 { 42 testImageClipComplexRegion,673,"psImageClipComplexRegion",0,false 43 }, 44 { 45 testImageOverlay,573,"psImageOverlay",0,false 46 }, 47 { 48 testImageRebin,559,"psImageRebin",0,false 49 }, 50 { 51 testImageRoll,562,"psImageRoll",0,false 52 }, 53 { 54 testImageRotate,560,"psImageRotate",0,false 55 }, 56 { 57 NULL 58 } 43 59 }; 44 60 … … 1117 1133 mkdir("temp",0777); 1118 1134 remove 1119 ("temp/fOut.fits"); 1135 ("temp/fOut.fits") 1136 ; 1120 1137 remove 1121 ("temp/sOut.fits"); 1138 ("temp/sOut.fits") 1139 ; 1122 1140 int index = 0; 1123 1141 bool fail = false; -
trunk/psLib/test/image/tst_psImageStats00.c
r1365 r1406 28 28 int IMAGE_Y_SIZE = 0; 29 29 int currentId = 0; 30 30 31 31 currentId = psMemGetId(); 32 32 for ( nb = 0;nb < 6;nb++ ) { 33 if ( nb == 0 ) { 34 IMAGE_X_SIZE = 1; 35 IMAGE_Y_SIZE = 1; 33 if ( nb == 0 ) { 34 IMAGE_X_SIZE = 1; 35 IMAGE_Y_SIZE = 1; 36 } 37 if ( nb == 1 ) { 38 IMAGE_X_SIZE = 1; 39 IMAGE_Y_SIZE = N; 40 } 41 if ( nb == 2 ) { 42 IMAGE_X_SIZE = N; 43 IMAGE_Y_SIZE = 1; 44 } 45 if ( nb == 3 ) { 46 IMAGE_X_SIZE = N; 47 IMAGE_Y_SIZE = N; 48 } 49 if ( nb == 4 ) { 50 IMAGE_X_SIZE = N; 51 IMAGE_Y_SIZE = M; 52 } 53 if ( nb == 5 ) { 54 IMAGE_X_SIZE = M; 55 IMAGE_Y_SIZE = N; 56 } 57 printf( "*******************************\n" ); 58 printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE ); 59 printf( "*******************************\n" ); 60 /*********************************************************************/ 61 /* Allocate and initialize data structures */ 62 /*********************************************************************/ 63 tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 ); 64 65 for ( i = 0;i < tmpImage->numRows;i++ ) { 66 for ( j = 0;j < tmpImage->numCols;j++ ) { 67 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j + 0.1 ); 68 } 69 } 70 tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 ); 71 for ( i = 0;i < tmpMask->numRows;i++ ) { 72 for ( j = 0;j < tmpMask->numCols;j++ ) { 73 if ( ( i > ( tmpMask->numRows / 2 ) ) && 74 ( j > ( tmpMask->numCols / 2 ) ) ) { 75 tmpMask->data.U8[ i ][ j ] = 1; 76 } else { 77 tmpMask->data.U8[ i ][ j ] = 0; 36 78 } 37 if ( nb == 1 ) { 38 IMAGE_X_SIZE = 1; 39 IMAGE_Y_SIZE = N; 40 } 41 if ( nb == 2 ) { 42 IMAGE_X_SIZE = N; 43 IMAGE_Y_SIZE = 1; 44 } 45 if ( nb == 3 ) { 46 IMAGE_X_SIZE = N; 47 IMAGE_Y_SIZE = N; 48 } 49 if ( nb == 4 ) { 50 IMAGE_X_SIZE = N; 51 IMAGE_Y_SIZE = M; 52 } 53 if ( nb == 5 ) { 54 IMAGE_X_SIZE = M; 55 IMAGE_Y_SIZE = N; 56 } 57 printf( "*******************************\n" ); 58 printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE ); 59 printf( "*******************************\n" ); 60 /*********************************************************************/ 61 /* Allocate and initialize data structures */ 62 /*********************************************************************/ 63 tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 ); 64 65 for ( i = 0;i < tmpImage->numRows;i++ ) { 66 for ( j = 0;j < tmpImage->numCols;j++ ) { 67 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j + 0.1 ); 68 } 69 } 70 tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 ); 71 for ( i = 0;i < tmpMask->numRows;i++ ) { 72 for ( j = 0;j < tmpMask->numCols;j++ ) { 73 if ( ( i > ( tmpMask->numRows / 2 ) ) && 74 ( j > ( tmpMask->numCols / 2 ) ) ) { 75 tmpMask->data.U8[ i ][ j ] = 1; 76 } else { 77 tmpMask->data.U8[ i ][ j ] = 0; 78 } 79 } 80 } 81 82 /*************************************************************************/ 83 /* Calculate Histogram with no mask */ 84 /*************************************************************************/ 85 printPositiveTestHeader( stdout, 86 "psImageStats functions", 87 "Calculate Histogram, no mask" ); 88 89 myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ), 90 NUM_BINS ); 91 myHist = psImageHistogram( myHist, tmpImage, NULL, 0 ); 92 for ( i = 0;i < NUM_BINS;i++ ) { 93 printf( "Bin number %d bounds: (%.1f - %.1f) data (%d)\n", i, 94 myHist->bounds->data.F32[ i ], 95 myHist->bounds->data.F32[ i + 1 ], 96 myHist->nums->data.S32[ i ] ); 97 } 98 psFree( myHist ); 99 100 psMemCheckCorruption( 1 ); 101 printFooter( stdout, 102 "psImageStats functions", 103 "Calculate Histogram, no mask", 104 testStatus ); 105 106 /*************************************************************************/ 107 /* Calculate Histogram with mask */ 108 /*************************************************************************/ 109 printPositiveTestHeader( stdout, 110 "psImageStats functions", 111 "Calculate Histogram with mask" ); 112 113 myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ), 114 NUM_BINS ); 115 myHist = psImageHistogram( myHist, tmpImage, tmpMask, 1 ); 116 for ( i = 0;i < NUM_BINS;i++ ) { 117 printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i, 118 myHist->bounds->data.F32[ i ], 119 myHist->bounds->data.F32[ i + 1 ], 120 myHist->nums->data.S32[ i ] ); 121 } 122 123 psMemCheckCorruption( 1 ); 124 printFooter( stdout, 125 "psImageStats functions", 126 "Calculate Histogram with mask", 127 testStatus ); 128 129 /*************************************************************************/ 130 /* Deallocate data structures */ 131 /*************************************************************************/ 132 printPositiveTestHeader( stdout, 133 "psImageStats functions", 134 "Deallocate the psHistogram/psImage structure." ); 135 psFree( myHist ); 136 psFree( tmpImage ); 137 psFree( tmpMask ); 138 139 psMemCheckCorruption( 1 ); 140 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 141 if ( 0 != memLeaks ) { 142 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 143 } 144 145 printFooter( stdout, 146 "psImageStats functions", 147 "Deallocate the psHistogram/psImage structure.", 148 testStatus ); 79 } 149 80 } 81 82 /*************************************************************************/ 83 /* Calculate Histogram with no mask */ 84 /*************************************************************************/ 85 printPositiveTestHeader( stdout, 86 "psImageStats functions", 87 "Calculate Histogram, no mask" ); 88 89 myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ), 90 NUM_BINS ); 91 myHist = psImageHistogram( myHist, tmpImage, NULL, 0 ); 92 for ( i = 0;i < NUM_BINS;i++ ) { 93 printf( "Bin number %d bounds: (%.1f - %.1f) data (%d)\n", i, 94 myHist->bounds->data.F32[ i ], 95 myHist->bounds->data.F32[ i + 1 ], 96 myHist->nums->data.S32[ i ] ); 97 } 98 psFree( myHist ); 99 100 psMemCheckCorruption( 1 ); 101 printFooter( stdout, 102 "psImageStats functions", 103 "Calculate Histogram, no mask", 104 testStatus ); 105 106 /*************************************************************************/ 107 /* Calculate Histogram with mask */ 108 /*************************************************************************/ 109 printPositiveTestHeader( stdout, 110 "psImageStats functions", 111 "Calculate Histogram with mask" ); 112 113 myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ), 114 NUM_BINS ); 115 myHist = psImageHistogram( myHist, tmpImage, tmpMask, 1 ); 116 for ( i = 0;i < NUM_BINS;i++ ) { 117 printf( "Bin number %d bounds: (%.2f - %.2f) data (%d)\n", i, 118 myHist->bounds->data.F32[ i ], 119 myHist->bounds->data.F32[ i + 1 ], 120 myHist->nums->data.S32[ i ] ); 121 } 122 123 psMemCheckCorruption( 1 ); 124 printFooter( stdout, 125 "psImageStats functions", 126 "Calculate Histogram with mask", 127 testStatus ); 128 129 /*************************************************************************/ 130 /* Deallocate data structures */ 131 /*************************************************************************/ 132 printPositiveTestHeader( stdout, 133 "psImageStats functions", 134 "Deallocate the psHistogram/psImage structure." ); 135 psFree( myHist ); 136 psFree( tmpImage ); 137 psFree( tmpMask ); 138 139 psMemCheckCorruption( 1 ); 140 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 141 if ( 0 != memLeaks ) { 142 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 143 } 144 145 printFooter( stdout, 146 "psImageStats functions", 147 "Deallocate the psHistogram/psImage structure.", 148 testStatus ); 149 } 150 150 printPositiveTestHeader( stdout, 151 151 "psImageStats functions", 152 152 "Calling psImageHistogram() with NULL parameters" ); 153 153 154 154 tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 ); 155 155 myHist = psHistogramAlloc( 0.0, ( float ) ( IMAGE_X_SIZE + IMAGE_Y_SIZE ), … … 157 157 myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 ); 158 158 if ( myHist2 != NULL ) { 159 printf( "ERROR: myHist2 not equal to NULL\n" );160 }161 159 printf( "ERROR: myHist2 not equal to NULL\n" ); 160 } 161 162 162 myHist2 = psImageHistogram( myHist, NULL, NULL, 0 ); 163 163 myHist2 = psImageHistogram( NULL, tmpImage, NULL, 0 ); 164 164 if ( myHist2 != NULL ) { 165 printf( "ERROR: myHist2 not equal to NULL\n" );166 }167 165 printf( "ERROR: myHist2 not equal to NULL\n" ); 166 } 167 168 168 psMemCheckCorruption( 1 ); 169 169 psFree( myHist ); … … 172 172 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 173 173 if ( 0 != memLeaks ) { 174 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );175 }176 174 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 175 } 176 177 177 printFooter( stdout, 178 178 "psImageStats functions", 179 179 "Calling psImageHistogram() with NULL parameters", 180 180 testStatus ); 181 181 182 182 return ( !testStatus ); 183 183 } -
trunk/psLib/test/image/tst_psImageStats01.c
r1365 r1406 29 29 int IMAGE_Y_SIZE = 0; 30 30 int currentId = 0; 31 31 32 32 currentId = psMemGetId(); 33 33 for ( nb = 0;nb < 6;nb++ ) { 34 if ( nb == 0 ) { 35 IMAGE_X_SIZE = 1; 36 IMAGE_Y_SIZE = 1; 34 if ( nb == 0 ) { 35 IMAGE_X_SIZE = 1; 36 IMAGE_Y_SIZE = 1; 37 } 38 if ( nb == 1 ) { 39 IMAGE_X_SIZE = 1; 40 IMAGE_Y_SIZE = N; 41 } 42 if ( nb == 2 ) { 43 IMAGE_X_SIZE = N; 44 IMAGE_Y_SIZE = 1; 45 } 46 if ( nb == 3 ) { 47 IMAGE_X_SIZE = N; 48 IMAGE_Y_SIZE = N; 49 } 50 if ( nb == 4 ) { 51 IMAGE_X_SIZE = N; 52 IMAGE_Y_SIZE = M; 53 } 54 if ( nb == 5 ) { 55 IMAGE_X_SIZE = M; 56 IMAGE_Y_SIZE = N; 57 } 58 printf( "*******************************\n" ); 59 printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE ); 60 printf( "*******************************\n" ); 61 62 /*************************************************************************/ 63 /* Allocate and initialize data structures */ 64 /*************************************************************************/ 65 tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 ); 66 67 for ( i = 0;i < tmpImage->numRows;i++ ) { 68 for ( j = 0;j < tmpImage->numCols;j++ ) { 69 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ); 70 } 71 } 72 tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 ); 73 for ( i = 0;i < tmpMask->numRows;i++ ) { 74 for ( j = 0;j < tmpMask->numCols;j++ ) { 75 if ( ( i > ( tmpMask->numRows / 2 ) ) && 76 ( j > ( tmpMask->numCols / 2 ) ) ) { 77 tmpMask->data.U8[ i ][ j ] = 1; 78 } else { 79 tmpMask->data.U8[ i ][ j ] = 0; 37 80 } 38 if ( nb == 1 ) { 39 IMAGE_X_SIZE = 1; 40 IMAGE_Y_SIZE = N; 41 } 42 if ( nb == 2 ) { 43 IMAGE_X_SIZE = N; 44 IMAGE_Y_SIZE = 1; 45 } 46 if ( nb == 3 ) { 47 IMAGE_X_SIZE = N; 48 IMAGE_Y_SIZE = N; 49 } 50 if ( nb == 4 ) { 51 IMAGE_X_SIZE = N; 52 IMAGE_Y_SIZE = M; 53 } 54 if ( nb == 5 ) { 55 IMAGE_X_SIZE = M; 56 IMAGE_Y_SIZE = N; 57 } 58 printf( "*******************************\n" ); 59 printf( "* IMAGE SIZE is (%d by %d)\n", IMAGE_X_SIZE, IMAGE_Y_SIZE ); 60 printf( "*******************************\n" ); 61 62 /*************************************************************************/ 63 /* Allocate and initialize data structures */ 64 /*************************************************************************/ 65 tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 ); 66 67 for ( i = 0;i < tmpImage->numRows;i++ ) { 68 for ( j = 0;j < tmpImage->numCols;j++ ) { 69 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ); 70 } 71 } 72 tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 ); 73 for ( i = 0;i < tmpMask->numRows;i++ ) { 74 for ( j = 0;j < tmpMask->numCols;j++ ) { 75 if ( ( i > ( tmpMask->numRows / 2 ) ) && 76 ( j > ( tmpMask->numCols / 2 ) ) ) { 77 tmpMask->data.U8[ i ][ j ] = 1; 78 } else { 79 tmpMask->data.U8[ i ][ j ] = 0; 80 } 81 } 82 } 83 84 myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN ); 85 /*************************************************************************/ 86 /* Calculate Sample Mean with no mask */ 87 /*************************************************************************/ 88 printPositiveTestHeader( stdout, 89 "psImageStats functions", 90 "Calculate Sample Mean, no mask %d" ); 91 92 myStats = psImageStats( myStats, tmpImage, NULL, 0 ); 93 printf( "The sample mean was %.2f\n", myStats->sampleMean ); 94 95 psMemCheckCorruption( 1 ); 96 97 printFooter( stdout, 98 "psImageStats functions", 99 "Calculate Sample Mean, no mask", 100 testStatus ); 101 102 /*************************************************************************/ 103 /* Calculate Sample Mean with mask */ 104 /*************************************************************************/ 105 printPositiveTestHeader( stdout, 106 "psImageStats functions", 107 "Calculate Sample Mean with mask" ); 108 109 myStats = psImageStats( myStats, tmpImage, tmpMask, 1 ); 110 printf( "The sample mean was %.2f\n", myStats->sampleMean ); 111 112 psMemCheckCorruption( 1 ); 113 114 printFooter( stdout, 115 "psImageStats functions", 116 "Calculate Sample Mean with mask", 117 testStatus ); 118 119 /*************************************************************************/ 120 /* Deallocate data structures */ 121 /*************************************************************************/ 122 printPositiveTestHeader( stdout, 123 "psImageStats functions", 124 "Deallocate the psStats/psImage structure." ); 125 psFree( myStats ); 126 psFree( tmpImage ); 127 psFree( tmpMask ); 128 129 psMemCheckCorruption( 1 ); 130 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 131 if ( 0 != memLeaks ) { 132 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 133 } 134 135 printFooter( stdout, 136 "psImageStats functions", 137 "Deallocate the psStats/psImage structure.", 138 testStatus ); 81 } 139 82 } 140 83 84 myStats = psStatsAlloc( PS_STAT_SAMPLE_MEAN ); 85 /*************************************************************************/ 86 /* Calculate Sample Mean with no mask */ 87 /*************************************************************************/ 88 printPositiveTestHeader( stdout, 89 "psImageStats functions", 90 "Calculate Sample Mean, no mask %d" ); 91 92 myStats = psImageStats( myStats, tmpImage, NULL, 0 ); 93 printf( "The sample mean was %.2f\n", myStats->sampleMean ); 94 95 psMemCheckCorruption( 1 ); 96 97 printFooter( stdout, 98 "psImageStats functions", 99 "Calculate Sample Mean, no mask", 100 testStatus ); 101 102 /*************************************************************************/ 103 /* Calculate Sample Mean with mask */ 104 /*************************************************************************/ 105 printPositiveTestHeader( stdout, 106 "psImageStats functions", 107 "Calculate Sample Mean with mask" ); 108 109 myStats = psImageStats( myStats, tmpImage, tmpMask, 1 ); 110 printf( "The sample mean was %.2f\n", myStats->sampleMean ); 111 112 psMemCheckCorruption( 1 ); 113 114 printFooter( stdout, 115 "psImageStats functions", 116 "Calculate Sample Mean with mask", 117 testStatus ); 118 119 /*************************************************************************/ 120 /* Deallocate data structures */ 121 /*************************************************************************/ 122 printPositiveTestHeader( stdout, 123 "psImageStats functions", 124 "Deallocate the psStats/psImage structure." ); 125 psFree( myStats ); 126 psFree( tmpImage ); 127 psFree( tmpMask ); 128 129 psMemCheckCorruption( 1 ); 130 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 131 if ( 0 != memLeaks ) { 132 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 133 } 134 135 printFooter( stdout, 136 "psImageStats functions", 137 "Deallocate the psStats/psImage structure.", 138 testStatus ); 139 } 140 141 141 /*************************************************************************/ 142 142 /* Test With Various Null Inputs */ … … 145 145 "psImageStats functions", 146 146 "Test With Various Null Inputs" ); 147 147 148 148 tmpImage = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_F32 ); 149 149 tmpMask = psImageAlloc( IMAGE_X_SIZE, IMAGE_Y_SIZE, PS_TYPE_U8 ); 150 150 myStats = psStatsAlloc( 0 ); 151 151 152 152 myStats2 = psImageStats( myStats, NULL, NULL, 0 ); 153 153 if ( myStats2 != NULL ) { 154 printf( "ERROR: myStats2 = psImageStats(myStats, NULL, NULL, 0) != NULL\n" );155 }156 154 printf( "ERROR: myStats2 = psImageStats(myStats, NULL, NULL, 0) != NULL\n" ); 155 } 156 157 157 myStats2 = psImageStats( NULL, tmpImage, NULL, 0 ); 158 158 if ( myStats2 != NULL ) { 159 printf( "ERROR: myStats2 = psImageStats(NULL, tmpImage, NULL, 0) != NULL\n" );160 }161 159 printf( "ERROR: myStats2 = psImageStats(NULL, tmpImage, NULL, 0) != NULL\n" ); 160 } 161 162 162 myStats2 = psImageStats( myStats, tmpImage, NULL, 0 ); 163 163 164 164 psFree( myStats ); 165 165 psFree( tmpImage ); 166 166 psFree( tmpMask ); 167 167 168 168 psMemCheckCorruption( 1 ); 169 169 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 170 170 if ( 0 != memLeaks ) { 171 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );172 }173 171 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 172 } 173 174 174 printFooter( stdout, 175 175 "psImageStats functions", -
trunk/psLib/test/image/tst_psImageStats02.c
r1365 r1406 4 4 thouroughly tested elsewhere, we will only test psImageStats() with 5 5 the PS_STAT_SAMPLE_MEAN here. 6 6 7 7 NOTE: After you debug, set CHEBY_X_DIM != CHEBY_Y_DIM. 8 8 Also, uses non-square images. … … 32 32 int rc = 0; 33 33 int currentId = 0; 34 34 35 35 currentId = psMemGetId(); 36 36 /*************************************************************************/ … … 40 40 outImage = psImageAlloc( IMAGE_SIZE, IMAGE_SIZE, PS_TYPE_F32 ); 41 41 for ( i = 0;i < IMAGE_SIZE;i++ ) { 42 for ( j = 0;j < IMAGE_SIZE;j++ ) { 43 tmpImage->data.F32[ i ][ j ] = 4.0; 44 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ); 45 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i ); 46 outImage->data.F32[ i ][ j ] = 0.0; 47 } 42 for ( j = 0;j < IMAGE_SIZE;j++ ) { 43 tmpImage->data.F32[ i ][ j ] = 4.0; 44 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ); 45 tmpImage->data.F32[ i ][ j ] = ( float ) ( i + j ) + ( 4.0 * ( float ) i ); 46 outImage->data.F32[ i ][ j ] = 0.0; 48 47 } 48 } 49 49 my2DPoly = psPolynomial2DAlloc( CHEBY_X_DIM, CHEBY_Y_DIM ); 50 50 /*************************************************************************/ … … 54 54 "psImageStats functions", 55 55 "Calculate Chebyshev Polynomials, no mask" ); 56 56 57 57 my2DPoly = psImageFitPolynomial( tmpImage, my2DPoly ); 58 58 for ( i = 0;i < CHEBY_X_DIM;i++ ) { 59 for ( j = 0;j < CHEBY_Y_DIM;j++ ) { 60 printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, my2DPoly->coeff[ i ][ j ] ); 61 } 59 for ( j = 0;j < CHEBY_Y_DIM;j++ ) { 60 printf( "Cheby Polynomial (%d, %d) coefficient is %.2f\n", i, j, my2DPoly->coeff[ i ][ j ] ); 62 61 } 63 62 } 63 64 64 psMemCheckCorruption( 1 ); 65 65 printFooter( stdout, … … 73 73 "psImageStats functions", 74 74 "Calculate Chebyshev Polynomials, no mask" ); 75 75 76 76 rc = psImageEvalPolynomial( outImage, my2DPoly ); 77 77 for ( i = 0;i < IMAGE_SIZE;i++ ) { 78 for ( j = 0;j < IMAGE_SIZE;j++ ) { 79 80 // printf("pixel[%d][%d] is (%f, %f)\n", i, j, 81 // tmpImage->data.F32[i][j], 82 // outImage->data.F32[i][j]); 83 if ( fabs( outImage->data.F32[ i ][ j ] - tmpImage->data.F32[ i ][ j ] ) > THRESHOLD ) { 84 printf( "Pixel (%d, %d) is %.2f, should be %.2f\n", i, j, 85 outImage->data.F32[ i ][ j ], 86 tmpImage->data.F32[ i ][ j ] ); 87 } 88 89 } 78 for ( j = 0;j < IMAGE_SIZE;j++ ) { 79 80 // printf("pixel[%d][%d] is (%f, %f)\n", i, j, 81 // tmpImage->data.F32[i][j], 82 // outImage->data.F32[i][j]); 83 if ( fabs( outImage->data.F32[ i ][ j ] - tmpImage->data.F32[ i ][ j ] ) > THRESHOLD ) { 84 printf( "Pixel (%d, %d) is %.2f, should be %.2f\n", i, j, 85 outImage->data.F32[ i ][ j ], 86 tmpImage->data.F32[ i ][ j ] ); 87 } 88 90 89 } 91 90 } 91 92 92 psMemCheckCorruption( 1 ); 93 93 printFooter( stdout, … … 95 95 "Calculate Chebyshev Polynomials, no mask", 96 96 testStatus ); 97 97 98 98 /*************************************************************************/ 99 99 /* Deallocate data structures */ … … 106 106 psFree( outImage ); 107 107 psFree( my2DPoly ); 108 108 109 109 psMemCheckCorruption( 1 ); 110 110 memLeaks = psMemCheckLeaks( currentId, NULL, NULL ); 111 111 if ( 0 != memLeaks ) { 112 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks );113 }114 112 psAbort( __func__, "Memory Leaks! (%d leaks)", memLeaks ); 113 } 114 115 115 printFooter( stdout, 116 116 "psImageStats functions", 117 117 "Deallocate the psStats/psImage structure.", 118 118 testStatus ); 119 119 120 120 return ( !testStatus ); 121 121 } -
trunk/psLib/test/psTest.c
r1365 r1406 37 37 int n; 38 38 extern char *optarg; 39 39 40 40 if ( argc > 0 ) { 41 while ( ( c = getopt( argc, argv, "lhn:dt:" ) ) != -1 ) {42 switch ( c ) {43 case 'h':44 printf( "Usage: %s [-l] [-d] [-h] [-n=Testpoint#] [-t=TestpointName]\n"45 " where:\n"46 " -l : lists the testpoints contained in this test driver executable\n"47 " -d : turns on debugger-friendly mode (no forking, aborts/signals are not handled)\n"48 " -h : prints this help\n"49 " -n : specifies a particular testpoint by number to run\n"50 " -t : specifies a particular testpoint by name to run\n"51 " (if no -l, -n or -t options are given, all testpoints are run)\n",52 argv[ 0 ] );53 runAll = false;54 break;55 case 'd':56 useFork = false;57 break;58 case 'l':59 printf( "Test Driver: %s\n", testPointFile );60 printf( "Package Name: %s\n", packageName );61 printf( "Testpoints:\n" );62 runAll = false;63 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {64 printf( " %6d - %s \n", tests[ index ].testPointNumber,65 tests[ index ].testPointName );66 }67 printf( "\n" );68 break;69 case 't':70 runAll = false;71 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {72 if ( strcmp( optarg, tests[ index ].testPointName ) == 0 ) {73 success = p_runTest( fp,74 testPointFile,75 packageName,76 tests[ index ].testPointName,77 tests[ index ].fcn,78 tests[ index ].expectedReturn,79 useFork ) && success;80 }81 }82 break;83 case 'n':84 runAll = false;85 if ( sscanf( optarg, "%i", &n ) != 1 ) {86 psError( __func__, "Failed to parse the testpoint number (%s).",87 optarg );88 break;89 }90 found = false;91 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {92 if ( n == tests[ index ].testPointNumber ) {93 found = true;94 success = p_runTest( fp,95 testPointFile,96 packageName,97 tests[ index ].testPointName,98 tests[ index ].fcn,99 tests[ index ].expectedReturn,100 useFork ) && success;101 }102 }103 if ( ! found ) {104 psError( __func__, "The specified testpoint number (%d) doesn't exist in this test driver.",105 n );106 break;107 }108 break;109 case '?':110 psError( __func__, "Option %s is not recognized and is ignored.", optarg );111 break;112 }113 }114 }115 41 while ( ( c = getopt( argc, argv, "lhn:dt:" ) ) != -1 ) { 42 switch ( c ) { 43 case 'h': 44 printf( "Usage: %s [-l] [-d] [-h] [-n=Testpoint#] [-t=TestpointName]\n" 45 " where:\n" 46 " -l : lists the testpoints contained in this test driver executable\n" 47 " -d : turns on debugger-friendly mode (no forking, aborts/signals are not handled)\n" 48 " -h : prints this help\n" 49 " -n : specifies a particular testpoint by number to run\n" 50 " -t : specifies a particular testpoint by name to run\n" 51 " (if no -l, -n or -t options are given, all testpoints are run)\n", 52 argv[ 0 ] ); 53 runAll = false; 54 break; 55 case 'd': 56 useFork = false; 57 break; 58 case 'l': 59 printf( "Test Driver: %s\n", testPointFile ); 60 printf( "Package Name: %s\n", packageName ); 61 printf( "Testpoints:\n" ); 62 runAll = false; 63 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) { 64 printf( " %6d - %s \n", tests[ index ].testPointNumber, 65 tests[ index ].testPointName ); 66 } 67 printf( "\n" ); 68 break; 69 case 't': 70 runAll = false; 71 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) { 72 if ( strcmp( optarg, tests[ index ].testPointName ) == 0 ) { 73 success = p_runTest( fp, 74 testPointFile, 75 packageName, 76 tests[ index ].testPointName, 77 tests[ index ].fcn, 78 tests[ index ].expectedReturn, 79 useFork ) && success; 80 } 81 } 82 break; 83 case 'n': 84 runAll = false; 85 if ( sscanf( optarg, "%i", &n ) != 1 ) { 86 psError( __func__, "Failed to parse the testpoint number (%s).", 87 optarg ); 88 break; 89 } 90 found = false; 91 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) { 92 if ( n == tests[ index ].testPointNumber ) { 93 found = true; 94 success = p_runTest( fp, 95 testPointFile, 96 packageName, 97 tests[ index ].testPointName, 98 tests[ index ].fcn, 99 tests[ index ].expectedReturn, 100 useFork ) && success; 101 } 102 } 103 if ( ! found ) { 104 psError( __func__, "The specified testpoint number (%d) doesn't exist in this test driver.", 105 n ); 106 break; 107 } 108 break; 109 case '?': 110 psError( __func__, "Option %s is not recognized and is ignored.", optarg ); 111 break; 112 } 113 } 114 } 115 116 116 if ( runAll ) { 117 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) {118 if ( ! tests[ index ].isDuplicateEntry ) {119 success = p_runTest( fp,120 testPointFile,121 packageName,122 tests[ index ].testPointName,123 tests[ index ].fcn,124 tests[ index ].expectedReturn,125 useFork ) && success;126 }127 }128 }129 117 for ( int index = 0; tests[ index ].fcn != NULL; index++ ) { 118 if ( ! tests[ index ].isDuplicateEntry ) { 119 success = p_runTest( fp, 120 testPointFile, 121 packageName, 122 tests[ index ].testPointName, 123 tests[ index ].fcn, 124 tests[ index ].expectedReturn, 125 useFork ) && success; 126 } 127 } 128 } 129 130 130 if ( ! success ) { 131 psError( testPointFile, "One or more tests failed" );132 }133 131 psError( testPointFile, "One or more tests failed" ); 132 } 133 134 134 return success; 135 135 } … … 140 140 int childReturn = 0; 141 141 pid_t child; 142 142 143 143 p_printPositiveTestHeader( fp, testPointFile, packageName, testPointName ); 144 144 145 145 if ( useFork ) { 146 child = fork(); 147 if ( child == 0 ) { // I am the child process, run the test 148 int currentId = psMemGetId(); 149 int retVal = fcn(); 150 if ( retVal == 0 ) { // only bother checking memory if test executed to end. 151 if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) { 152 psError( __func__, "Memory Leaks Detected" ); 153 retVal = 64; 154 } 155 psMemCheckCorruption( 1 ); 156 } 157 exit( retVal ); 158 } else if ( child < 0 ) { 159 fprintf( fp, "Couldn't fork a process to run a negative test (%s|%s)", 160 packageName, testPointName ); 161 abort(); 162 } 163 164 waitpid( child, &childReturn, 0 ); 165 if ( WIFSIGNALED( childReturn ) ) { 166 childReturn = -WTERMSIG( childReturn ); 167 } else { 168 childReturn = WEXITSTATUS( childReturn ); 169 } 146 child = fork(); 147 if ( child == 0 ) { // I am the child process, run the test 148 int currentId = psMemGetId(); 149 int retVal = fcn(); 150 if ( retVal == 0 ) { // only bother checking memory if test executed to end. 151 if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) { 152 psError( __func__, "Memory Leaks Detected" ); 153 retVal = 64; 154 } 155 psMemCheckCorruption( 1 ); 156 } 157 exit( retVal ); 158 } else 159 if ( child < 0 ) { 160 fprintf( fp, "Couldn't fork a process to run a negative test (%s|%s)", 161 packageName, testPointName ); 162 abort(); 163 } 164 165 waitpid( child, &childReturn, 0 ); 166 if ( WIFSIGNALED( childReturn ) ) { 167 childReturn = -WTERMSIG( childReturn ); 170 168 } else { 171 int currentId = psMemGetId(); 172 childReturn = fcn(); 173 if ( childReturn == 0 ) { // only bother checking memory if test executed to end. 174 if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) { 175 psError( __func__, "Memory Leaks Detected" ); 176 childReturn = 64; 177 } 178 psMemCheckCorruption( 1 ); 179 } 180 } 181 182 169 childReturn = WEXITSTATUS( childReturn ); 170 } 171 } else { 172 int currentId = psMemGetId(); 173 childReturn = fcn(); 174 if ( childReturn == 0 ) { // only bother checking memory if test executed to end. 175 if ( psMemCheckLeaks( currentId, NULL, stderr ) != 0 ) { 176 psError( __func__, "Memory Leaks Detected" ); 177 childReturn = 64; 178 } 179 psMemCheckCorruption( 1 ); 180 } 181 } 182 183 183 184 if ( childReturn != expectedReturn ) { 184 fprintf( fp, "Return value mismatch: expected %d, got %d",185 expectedReturn, childReturn );186 }187 185 fprintf( fp, "Return value mismatch: expected %d, got %d", 186 expectedReturn, childReturn ); 187 } 188 188 189 p_printFooter( fp, testPointFile, packageName, testPointName, 189 190 ( childReturn == expectedReturn ) ); 190 191 191 192 return ( childReturn == expectedReturn ); 192 193 } … … 198 199 { 199 200 char TP[ 80 ]; 200 201 201 202 snprintf( TP, 80, "%s{%s}", packageName, testPointName ); 202 203 203 204 fprintf( fp, HEADER_TOP ); 204 205 fprintf( fp, HEADER_LINE_STRING, "TestFile", testPointFile ); … … 216 217 { 217 218 char TP[ 80 ]; 218 219 219 220 snprintf( TP, 80, "%s{%s}", packageName, testPointName ); 220 221 221 222 fprintf( fp, HEADER_TOP ); 222 223 fprintf( fp, HEADER_LINE_STRING, "TestFile", testPointFile ); … … 236 237 { 237 238 if ( success ) { 238 fprintf( fp, "\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );239 } else {240 fprintf( fp, "\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile );241 }242 } 239 fprintf( fp, "\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile ); 240 } else { 241 fprintf( fp, "\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName, testPointName, testPointFile ); 242 } 243 } -
trunk/psLib/test/sysUtils/atst_psAbort_01.c
r717 r1406 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-0 5-18 19:22:35$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:06 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/sysUtils/atst_psAbort_02.c
r717 r1406 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-0 5-18 19:22:35$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:06 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/sysUtils/atst_psAbort_03.c
r717 r1406 8 8 * @author Eric Van Alst, MHPCC 9 9 * 10 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-0 5-18 19:22:35$10 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-08-06 22:34:06 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/sysUtils/tst_psError.c
r717 r1406 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-0 5-18 19:22:35$12 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-06 22:34:06 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/sysUtils/tst_psHash02.c
r1201 r1406 42 42 int i = 0; 43 43 ID *id = NULL; 44 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL}; 45 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL}; 44 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL 45 }; 46 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL 47 }; 46 48 int currentId = psMemGetId(); 47 49 int memLeaks = 0; -
trunk/psLib/test/sysUtils/tst_psHash03.c
r1295 r1406 70 70 bool retVal = false; 71 71 ID *id = NULL; 72 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL}; 73 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL}; 72 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL 73 }; 74 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL 75 }; 74 76 int memLeaks = 0; 75 77 -
trunk/psLib/test/sysUtils/tst_psHash04.c
r1201 r1406 37 37 int testStatus = true; 38 38 int i = 0; 39 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL}; 40 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL}; 39 char *myKeys[] = {"ENTRY00", "ENTRY01", "ENTRY02", "ENTRY03", NULL 40 }; 41 char *myData[] = {"IDA", "IDB", "IDC", "IDD", NULL 42 }; 41 43 int currentId = psMemGetId(); 42 44 int memLeaks = 0; -
trunk/psLib/test/sysUtils/tst_psMemory.c
r1365 r1406 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1.2 1$ $Name: not supported by cvs2svn $9 * @date $Date: 2004-08-0 2 19:43:23$8 * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2004-08-06 22:34:06 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 80 80 } 81 81 }; 82 82 83 83 int main( int argc, char* argv[] ) 84 84 { 85 85 psLogSetLevel( PS_LOG_INFO ); 86 86 87 87 return ( ! runTestSuite( stderr, "psMemory", tests, argc, argv ) ); 88 88 } … … 94 94 const int size = 100; 95 95 int failed = 0; 96 96 97 97 psLogMsg( __func__, PS_LOG_INFO, "psAlloc shall allocate memory blocks writeable by caller.\n" ); 98 98 99 99 mem = ( int* ) psAlloc( size * sizeof( int ) ); 100 100 if ( mem == NULL ) { 101 psError( __FILE__, "psAlloc returned a NULL value in %s!", __func__ ); 102 return 1; 101 psError( __FILE__, "psAlloc returned a NULL value in %s!", __func__ ); 102 return 1; 103 } 104 105 for ( int index = 0;index < size;index++ ) { 106 mem[ index ] = index; 107 } 108 109 for ( int index = 0;index < size;index++ ) { 110 if ( mem[ index ] != index ) { 111 failed++; 103 112 } 104 105 for ( int index = 0;index < size;index++ ) { 106 mem[ index ] = index; 107 } 108 109 for ( int index = 0;index < size;index++ ) { 110 if ( mem[ index ] != index ) { 111 failed++; 112 } 113 } 114 113 } 114 115 115 psFree( mem ); 116 116 117 117 return failed; 118 118 } … … 123 123 int * mem; 124 124 int ref = 0; 125 125 126 126 psLogMsg( __func__, PS_LOG_INFO, "memory reference count shall be incrementable/decrementable" ); 127 127 128 128 mem = ( int* ) psAlloc( 100 * sizeof( int ) ); 129 129 130 130 ref = psMemGetRefCounter( mem ); 131 131 if ( ref != 1 ) { 132 psError( __func__, "Expected to buffer reference count to be initially 1, but it was %d.", ref );133 return 1;134 }135 132 psError( __func__, "Expected to buffer reference count to be initially 1, but it was %d.", ref ); 133 return 1; 134 } 135 136 136 psMemIncrRefCounter( mem ); 137 137 psMemIncrRefCounter( mem ); 138 138 psMemIncrRefCounter( mem ); 139 139 140 140 ref = psMemGetRefCounter( mem ); 141 141 if ( ref != 4 ) { 142 psError( __func__, "Expected to find buffer reference count to be 4, but it was %d.", ref );143 return 1;144 }145 142 psError( __func__, "Expected to find buffer reference count to be 4, but it was %d.", ref ); 143 return 1; 144 } 145 146 146 psMemDecrRefCounter( mem ); 147 147 psMemDecrRefCounter( mem ); 148 148 149 149 ref = psMemGetRefCounter( mem ); 150 150 if ( ref != 2 ) { 151 psError( __func__, "Expected to find buffer reference count to be 2, but it was %d.", ref );152 return 1;153 }154 151 psError( __func__, "Expected to find buffer reference count to be 2, but it was %d.", ref ); 152 return 1; 153 } 154 155 155 psLogMsg( __func__, PS_LOG_INFO, "psFree shall be just decrement a multiple refererenced pointer." ); 156 156 157 157 psFree( mem ); 158 158 159 159 ref = psMemGetRefCounter( mem ); 160 160 if ( ref != 1 ) { 161 psError( __func__, "Expected to find buffer reference count to be 1, but it was %d.", ref );162 return 1;163 }164 161 psError( __func__, "Expected to find buffer reference count to be 1, but it was %d.", ref ); 162 return 1; 163 } 164 165 165 psFree( mem ); 166 166 167 167 return 0; 168 168 } … … 174 174 int * mem[ 100 ]; 175 175 psMemExhaustedCallback cb; 176 177 for ( int lcv = 0; lcv < 100; lcv++ ) { 178 mem[ lcv ] = NULL;179 }180 176 177 for ( int lcv = 0; lcv < 100; lcv++ ) { 178 mem[ lcv ] = NULL; 179 } 180 181 181 psLogMsg( __func__, PS_LOG_INFO, "Upon requesting more memory than is available, psRealloc shall call " 182 182 "the psMemExhaustedCallback.\n" ); 183 183 184 184 exhaustedCallbackCalled = 0; 185 185 186 186 cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback ); 187 188 for ( int lcv = 0; lcv < 100; lcv++ ) { 189 mem[ lcv ] = ( int* ) psAlloc( 10 );190 }191 192 for ( int lcv = 0; lcv < 100; lcv++ ) { 193 mem[ lcv ] = ( int* ) psRealloc( mem[ lcv ], SIZE_MAX - 1000 );194 }195 187 188 for ( int lcv = 0; lcv < 100; lcv++ ) { 189 mem[ lcv ] = ( int* ) psAlloc( 10 ); 190 } 191 192 for ( int lcv = 0; lcv < 100; lcv++ ) { 193 mem[ lcv ] = ( int* ) psRealloc( mem[ lcv ], SIZE_MAX - 1000 ); 194 } 195 196 196 psMemExhaustedCallbackSet( cb ); 197 197 198 198 if ( exhaustedCallbackCalled == 0 ) { 199 psError( __FILE__, "Called psRealloc with HUGE memory requirement and survived in %s!", __func__ );200 return 1;201 }202 203 for ( int lcv = 0; lcv < 100; lcv++ ) { 204 psFree( mem[ lcv ] );205 }206 199 psError( __FILE__, "Called psRealloc with HUGE memory requirement and survived in %s!", __func__ ); 200 return 1; 201 } 202 203 for ( int lcv = 0; lcv < 100; lcv++ ) { 204 psFree( mem[ lcv ] ); 205 } 206 207 207 return 0; 208 208 } … … 213 213 int * mem[ 100 ]; 214 214 psMemExhaustedCallback cb; 215 216 for ( int lcv = 0; lcv < 100; lcv++ ) { 217 mem[ lcv ] = NULL;218 }219 215 216 for ( int lcv = 0; lcv < 100; lcv++ ) { 217 mem[ lcv ] = NULL; 218 } 219 220 220 psLogMsg( __func__, PS_LOG_INFO, "Upon requesting more memory than is available, psalloc shall call " 221 221 "the psMemExhaustedCallback.\n" ); 222 222 223 223 exhaustedCallbackCalled = 0; 224 224 225 225 cb = psMemExhaustedCallbackSet( TPOutOfMemoryExhaustedCallback ); 226 227 for ( int lcv = 0; lcv < 100; lcv++ ) { 228 mem[ lcv ] = ( int* ) psAlloc( SIZE_MAX - 1000 );229 }230 226 227 for ( int lcv = 0; lcv < 100; lcv++ ) { 228 mem[ lcv ] = ( int* ) psAlloc( SIZE_MAX - 1000 ); 229 } 230 231 231 psMemExhaustedCallbackSet( cb ); 232 232 233 233 if ( exhaustedCallbackCalled == 0 ) { 234 psError( __FILE__, "Called psAlloc with HUGE memory requirement and survived in %s!", __func__ );235 return 1;236 }237 238 for ( int lcv = 0; lcv < 100; lcv++ ) { 239 psFree( mem[ lcv ] );240 }241 234 psError( __FILE__, "Called psAlloc with HUGE memory requirement and survived in %s!", __func__ ); 235 return 1; 236 } 237 238 for ( int lcv = 0; lcv < 100; lcv++ ) { 239 psFree( mem[ lcv ] ); 240 } 241 242 242 return 0; 243 243 } … … 250 250 int* mem3; 251 251 const int initialSize = 100; 252 252 253 253 psLogMsg( __func__, PS_LOG_INFO, "psRealloc shall increase/decrease memory buffer while " 254 254 "preserving contents" ); 255 255 256 256 // allocate buffer with known values. 257 257 mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) ); … … 259 259 mem3 = ( int* ) psAlloc( initialSize * sizeof( int ) ); 260 260 for ( int lcv = 0;lcv < initialSize;lcv++ ) { 261 mem1[ lcv ] = mem2[ lcv ] = mem3[ lcv ] = lcv;262 }263 261 mem1[ lcv ] = mem2[ lcv ] = mem3[ lcv ] = lcv; 262 } 263 264 264 psMemCheckCorruption( 1 ); 265 265 psLogMsg( __func__, PS_LOG_INFO, "Expanding memory buffer." ); 266 266 267 267 // realloc to 2x 268 268 mem1 = ( int* ) psRealloc( mem1, 2 * initialSize * sizeof( int ) ); 269 269 mem2 = ( int* ) psRealloc( mem2, 2 * initialSize * sizeof( int ) ); 270 270 mem3 = ( int* ) psRealloc( mem3, 2 * initialSize * sizeof( int ) ); 271 271 272 272 // check values of initial block 273 273 for ( int i = 0;i < initialSize;i++ ) { 274 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 275 psError( __FILE__, "Realloc didn't preserve the contents with expanding buffer in %s.", 276 __func__ ); 277 break; 278 } 274 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 275 psError( __FILE__, "Realloc didn't preserve the contents with expanding buffer in %s.", 276 __func__ ); 277 break; 279 278 } 280 279 } 280 281 281 psMemCheckCorruption( 1 ); 282 282 psLogMsg( __func__, PS_LOG_INFO, "Shrinking memory buffer." ); 283 283 284 284 // realloc to 1/2 initial value. 285 285 mem1 = ( int* ) psRealloc( mem1, ( initialSize / 2 ) * sizeof( int ) ); 286 286 mem2 = ( int* ) psRealloc( mem2, ( initialSize / 2 ) * sizeof( int ) ); 287 287 mem3 = ( int* ) psRealloc( mem3, ( initialSize / 2 ) * sizeof( int ) ); 288 288 289 289 // check values of initial block 290 290 for ( int i = 0;i < initialSize / 2;i++ ) { 291 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 292 psError( __FILE__, "Realloc didn't preserve the contents with shrinking buffer in %s.", 293 __func__ ); 294 break; 295 } 291 if ( mem1[ i ] != i || mem2[ i ] != i || mem3[ i ] != i ) { 292 psError( __FILE__, "Realloc didn't preserve the contents with shrinking buffer in %s.", 293 __func__ ); 294 break; 296 295 } 297 296 } 297 298 298 psFree( mem1 ); 299 299 psFree( mem2 ); 300 300 psFree( mem3 ); 301 301 302 302 return 0; 303 303 } … … 311 311 const int initialSize = 100; 312 312 int mark; 313 313 314 314 allocCallbackCalled = 0; 315 315 freeCallbackCalled = 0; 316 316 psMemAllocateCallbackSet( memAllocateCallback ); 317 317 psMemFreeCallbackSet( memFreeCallback ); 318 318 319 319 psMemAllocateCallbackSetID( currentId + 1 ); 320 320 psMemFreeCallbackSetID( currentId + 1 ); 321 321 322 322 psLogMsg( __func__, PS_LOG_INFO, "call to psAlloc/psRealloc shall generate a callback if specified " 323 323 "memory ID is allocated." ); 324 324 325 325 // allocate buffer with known values. 326 326 mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) ); 327 327 mem2 = ( int* ) psAlloc( initialSize * sizeof( int ) ); 328 328 mem3 = ( int* ) psAlloc( initialSize * sizeof( int ) ); 329 329 330 330 psFree( mem1 ); 331 331 psFree( mem2 ); 332 332 psFree( mem3 ); 333 333 334 334 if ( allocCallbackCalled != 2 || freeCallbackCalled != 2 ) { 335 psError( __FILE__, "alloc/free callbacks were not called the proper number of times in %s",336 __func__ );337 return 1;338 }339 335 psError( __FILE__, "alloc/free callbacks were not called the proper number of times in %s", 336 __func__ ); 337 return 1; 338 } 339 340 340 allocCallbackCalled = 0; 341 341 freeCallbackCalled = 0; 342 342 343 343 mark = psMemGetId(); 344 344 345 345 mem1 = ( int* ) psAlloc( initialSize * sizeof( int ) ); 346 346 347 347 psMemAllocateCallbackSetID( mark ); 348 348 349 349 mem1 = ( int* ) psRealloc( mem1, initialSize * 2 * sizeof( int ) ); 350 350 351 351 psFree( mem1 ); 352 352 353 353 if ( allocCallbackCalled != 2 ) { 354 psError( __FILE__, "realloc callbacks were not called the proper number of times in %s",355 __func__ );356 return 1;357 }358 359 return 0; 360 354 psError( __FILE__, "realloc callbacks were not called the proper number of times in %s", 355 __func__ ); 356 return 1; 357 } 358 359 return 0; 360 361 361 } 362 362 … … 370 370 int nLeaks = 0; 371 371 int lineMark = 0; 372 372 373 373 psLogMsg( __func__, PS_LOG_INFO, "psMemCheckLeaks shall return the number of blocks above an ID " 374 374 "that are still allocated" ); 375 375 376 376 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 377 lineMark = __LINE__ + 1;378 buffers[ lcv ] = psAlloc( sizeof( int ) );379 }380 377 lineMark = __LINE__ + 1; 378 buffers[ lcv ] = psAlloc( sizeof( int ) ); 379 } 380 381 381 for ( lcv = 1;lcv < numBuffers;lcv++ ) { 382 psFree( buffers[ lcv ] ); 383 } 384 385 psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one instance." ); 386 387 nLeaks = psMemCheckLeaks( currentId, &blks, stderr ); 388 389 if ( nLeaks != 1 ) { 390 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 391 return 1; 392 } 393 394 if ( blks[ 0 ] ->lineno != lineMark ) { 395 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one (line %d vs %d) in %s.", 396 lineMark, blks[ 0 ] ->lineno, __func__ ); 397 return 1; 398 } 399 400 psFree( buffers[ 0 ] ); 401 psFree( blks ); 402 403 psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with a different leak location" ); 404 psMemCheckLeaks( currentId, NULL, stderr ); 405 406 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 407 lineMark = __LINE__ + 1; 408 buffers[ lcv ] = psAlloc( sizeof( int ) ); 409 } 410 411 for ( lcv = 0;lcv < numBuffers - 1;lcv++ ) { 412 psFree( buffers[ lcv ] ); 413 } 414 415 psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one error." ); 416 417 nLeaks = psMemCheckLeaks( currentId, &blks, stderr ); 418 419 if ( nLeaks != 1 ) { 420 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 421 return 1; 422 } 423 424 if ( blks[ 0 ] ->lineno != lineMark ) { 425 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ ); 426 return 1; 427 } 428 429 psFree( buffers[ 4 ] ); 430 psFree( blks ); 431 432 psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with multiple leak locations." ); 433 434 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 435 lineMark = __LINE__ + 1; 436 buffers[ lcv ] = psAlloc( sizeof( int ) ); 437 } 438 439 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 440 if ( lcv % 2 == 0 ) { 382 441 psFree( buffers[ lcv ] ); 383 442 } 384 385 psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one instance." ); 386 443 } 444 445 psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce two errors." ); 446 387 447 nLeaks = psMemCheckLeaks( currentId, &blks, stderr ); 388 389 if ( nLeaks != 1) {390 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ );391 return 1;392 }393 448 449 if ( nLeaks != 2 ) { 450 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 451 return 1; 452 } 453 394 454 if ( blks[ 0 ] ->lineno != lineMark ) { 395 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one (line %d vs %d) in %s.", 396 lineMark, blks[ 0 ] ->lineno, __func__ ); 397 return 1; 398 } 399 400 psFree( buffers[ 0 ] ); 401 psFree( blks ); 402 403 psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with a different leak location" ); 404 psMemCheckLeaks( currentId, NULL, stderr ); 405 406 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 407 lineMark = __LINE__ + 1; 408 buffers[ lcv ] = psAlloc( sizeof( int ) ); 409 } 410 411 for ( lcv = 0;lcv < numBuffers - 1;lcv++ ) { 412 psFree( buffers[ lcv ] ); 413 } 414 415 psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce one error." ); 416 417 nLeaks = psMemCheckLeaks( currentId, &blks, stderr ); 418 419 if ( nLeaks != 1 ) { 420 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 421 return 1; 422 } 423 424 if ( blks[ 0 ] ->lineno != lineMark ) { 425 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ ); 426 return 1; 427 } 428 429 psFree( buffers[ 4 ] ); 430 psFree( blks ); 431 432 psLogMsg( __func__, PS_LOG_INFO, "Testing psMemCheckLeaks again with multiple leak locations." ); 433 434 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 435 lineMark = __LINE__ + 1; 436 buffers[ lcv ] = psAlloc( sizeof( int ) ); 437 } 438 439 for ( lcv = 0;lcv < numBuffers;lcv++ ) { 440 if ( lcv % 2 == 0 ) { 441 psFree( buffers[ lcv ] ); 442 } 443 } 444 445 psLogMsg( __func__, PS_LOG_INFO, "following psMemCheckLeaks call should produce two errors." ); 446 447 nLeaks = psMemCheckLeaks( currentId, &blks, stderr ); 448 449 if ( nLeaks != 2 ) { 450 psError( __FILE__, "psMemCheckLeaks should have found 1 leak, but found %d in %s.", nLeaks, __func__ ); 451 return 1; 452 } 453 454 if ( blks[ 0 ] ->lineno != lineMark ) { 455 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ ); 456 return 1; 457 } 458 455 psError( __FILE__, "psMemCheckLeaks found a leak other than the expected one in %s.", __func__ ); 456 return 1; 457 } 458 459 459 psFree( blks ); 460 460 psFree( buffers[ 1 ] ); 461 461 psFree( buffers[ 3 ] ); 462 462 463 463 return 0; 464 464 } … … 470 470 int corruptions = 0; 471 471 psMemProblemCallback cb; 472 472 473 473 psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption shall detect memory corruptions" ); 474 474 475 475 buffer = psAlloc( sizeof( int ) ); 476 476 477 477 // cause memory corruption via buffer underflow 478 478 *buffer = 1; … … 480 480 oldValue = *buffer; 481 481 *buffer = 2; 482 482 483 483 problemCallbackCalled = 0; 484 484 cb = psMemProblemCallbackSet( memProblemCallback ); 485 485 486 486 psLogMsg( __func__, PS_LOG_INFO, "psMemCheckCorruption should output an error message and " 487 487 "memProblemCallback callback should be called." ); 488 488 489 489 corruptions = psMemCheckCorruption( 0 ); 490 490 491 491 // restore the memory problem callback 492 492 psMemProblemCallbackSet( cb ); 493 493 494 494 // restore the value, 'uncorrupting' the buffer 495 495 *buffer = oldValue; 496 496 buffer++; 497 497 498 498 psFree( buffer ); 499 499 500 500 if ( corruptions != 1 ) { 501 psError( __FILE__, "Expected one memory corruption but found %d in %s.",502 corruptions, __func__ );503 return 1;504 }505 501 psError( __FILE__, "Expected one memory corruption but found %d in %s.", 502 corruptions, __func__ ); 503 return 1; 504 } 505 506 506 if ( problemCallbackCalled != 1 ) { 507 psError( __FILE__, "The memProblemCallback was not invoked but should have been in %s",508 __func__ );509 return 1;510 }511 512 return 0; 513 507 psError( __FILE__, "The memProblemCallback was not invoked but should have been in %s", 508 __func__ ); 509 return 1; 510 } 511 512 return 0; 513 514 514 } 515 515 … … 547 547 548 548 void * buffer = psAlloc( 1024 ); 549 549 550 550 psFree( buffer ); 551 551 552 552 psLogMsg( __func__, PS_LOG_INFO, "Next should be an error about multiple freeing." ); 553 553 psFree( buffer ); 554 555 return 0; 556 } 554 555 return 0; 556 } -
trunk/psLib/test/sysUtils/tst_psString.c
r717 r1406 17 17 * @author Eric Van Alst, MHPCC 18 18 * 19 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-0 5-18 19:22:35$19 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-08-06 22:34:06 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii -
trunk/psLib/test/sysUtils/tst_psStringCopy.c
r717 r1406 17 17 * @author Eric Van Alst, MHPCC 18 18 * 19 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-0 5-18 19:22:35$19 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-08-06 22:34:06 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Note:
See TracChangeset
for help on using the changeset viewer.
