Changeset 4887
- Timestamp:
- Aug 26, 2005, 1:01:17 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 8 edited
-
pslib.kdevelop (modified) (1 diff)
-
src/mathtypes/psImage.c (modified) (2 diffs)
-
src/mathtypes/psVector.c (modified) (12 diffs)
-
src/mathtypes/psVector.h (modified) (2 diffs)
-
test/mathtypes/tst_psImage.c (modified) (2 diffs)
-
test/mathtypes/tst_psVector.c (modified) (4 diffs)
-
test/mathtypes/verified/tst_psImage.stderr (modified) (1 diff)
-
test/mathtypes/verified/tst_psVector.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/pslib.kdevelop
r4877 r4887 49 49 <envvar value="1" name="WANT_AUTOMAKE_1_6" /> 50 50 </envvars> 51 <abortonerror>false</abortonerror>52 <numberofjobs>2</numberofjobs>53 <dontact>false</dontact>54 <makebin/>55 <prio>0</prio>56 51 </make> 57 52 </kdevautoproject> -
trunk/psLib/src/mathtypes/psImage.c
r4886 r4887 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.7 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-08-26 03:35:02$11 * @version $Revision: 1.77 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-26 23:01:17 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 219 219 case PS_TYPE_U8: 220 220 temp = va_arg (argp, psU32); 221 if ( temp >= 0 || temp <= 255)221 if ( temp >= PS_MIN_U8 && temp <= PS_MAX_U8 ) 222 222 vU8 = temp; 223 else 223 else { 224 224 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: U8 Value out of Range.\n"); 225 return false; 226 } 225 227 for (int iy = 0; iy < image->numRows; iy++) { 226 228 for (int ix = 0; ix < image->numCols; ix++) { -
trunk/psLib/src/mathtypes/psVector.c
r4821 r4887 9 9 * @author Robert DeSonia, MHPCC 10 10 * 11 * @version $Revision: 1.4 8$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-08- 19 21:27:43$11 * @version $Revision: 1.49 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-08-26 23:01:17 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 612 612 ...) 613 613 { 614 615 614 va_list argp; 616 615 psU8 vU8; … … 627 626 psC64 vC64; 628 627 628 unsigned int temp; 629 int temp2; 630 629 631 if (image == NULL) 630 632 return (false); … … 634 636 switch (image->type.type) { 635 637 case PS_TYPE_U8: 636 vU8 = va_arg (argp, psU32); 637 638 for (long iy = 0; iy < image->n; iy++) { 639 // for (int ix = 0; ix < image->numCols; ix++) { 638 temp = va_arg (argp, psU32); 639 if ( temp >= PS_MIN_U8 && temp <= PS_MAX_U8 ) 640 vU8 = temp; 641 else { 642 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: U8 Value out of Range.\n"); 643 return false; 644 } 645 for (long iy = 0; iy < image->n; iy++) { 640 646 image->data.U8[iy] = vU8; 641 // } 642 } 643 break; 644 647 } 648 return (true); 645 649 case PS_TYPE_F32: 646 vF32 = va_arg (argp, psF64); 647 648 for (long iy = 0; iy < image->n; iy++) { 649 // for (int ix = 0; ix < image->numCols; ix++) { 650 vF32 = (psF32)va_arg (argp, psF64); 651 for (long iy = 0; iy < image->n; iy++) { 650 652 image->data.F32[iy] = vF32; 651 // } 652 } 653 return (true); 654 653 } 654 return (true); 655 655 case PS_TYPE_F64: 656 656 vF64 = va_arg (argp, psF64); 657 658 for (long iy = 0; iy < image->n; iy++) { 659 // for (int ix = 0; ix < image->numCols; ix++) { 657 for (long iy = 0; iy < image->n; iy++) { 660 658 image->data.F64[iy] = vF64; 661 // }662 659 } 663 660 return (true); 664 661 case PS_TYPE_U16: 665 vU16 = va_arg (argp, psU32); 666 662 temp = va_arg (argp, psU32); 663 if ( temp >= PS_MIN_U16 && temp <= PS_MAX_U16 ) 664 vU16 = temp; 665 else { 666 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: U16 Value out of Range.\n"); 667 return false; 668 } 667 669 for (long iy = 0; iy < image->n; iy++) { 668 670 image->data.U16[iy] = vU16; … … 671 673 case PS_TYPE_U32: 672 674 vU32 = va_arg (argp, psU32); 673 674 675 for (long iy = 0; iy < image->n; iy++) { 675 676 image->data.U32[iy] = vU32; … … 678 679 case PS_TYPE_U64: 679 680 vU64 = va_arg (argp, psU64); 680 681 681 for (long iy = 0; iy < image->n; iy++) { 682 682 image->data.U64[iy] = vU64; … … 684 684 return (true); 685 685 case PS_TYPE_S8: 686 vS8 = va_arg (argp, psS32); 687 686 temp2 = va_arg (argp, psS32); 687 if ( temp2 >= PS_MIN_S8 && temp2 <= PS_MAX_S8 ) 688 vS8 = temp2; 689 else { 690 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: S8 Value out of Range.\n"); 691 return false; 692 } 688 693 for (long iy = 0; iy < image->n; iy++) { 689 694 image->data.S8[iy] = vS8; … … 691 696 return (true); 692 697 case PS_TYPE_S16: 693 vS16 = va_arg (argp, psS32); 694 698 temp2 = va_arg (argp, psS32); 699 if ( temp2 >= PS_MIN_S16 && temp2 <= PS_MAX_S16 ) 700 vS16 = temp2; 701 else { 702 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Error: S16 Value out of Range.\n"); 703 return false; 704 } 695 705 for (long iy = 0; iy < image->n; iy++) { 696 706 image->data.S16[iy] = vS16; … … 699 709 case PS_TYPE_S32: 700 710 vS32 = va_arg (argp, psS32); 701 702 711 for (long iy = 0; iy < image->n; iy++) { 703 712 image->data.S32[iy] = vS32; … … 706 715 case PS_TYPE_S64: 707 716 vS64 = va_arg (argp, psS64); 708 709 717 for (long iy = 0; iy < image->n; iy++) { 710 718 image->data.S64[iy] = vS64; … … 713 721 case PS_TYPE_C32: 714 722 vC32 = va_arg (argp, psC32); 715 716 723 for (long iy = 0; iy < image->n; iy++) { 717 724 image->data.C32[iy] = vC32; … … 720 727 case PS_TYPE_C64: 721 728 vC64 = va_arg (argp, psC64); 722 723 729 for (long iy = 0; iy < image->n; iy++) { 724 730 image->data.C64[iy] = vC64; 725 731 } 726 732 return (true); 727 728 733 default: 729 734 psError (PS_ERR_BAD_PARAMETER_TYPE, true, "datatype %d not defined in psImageInit\n", image->type); -
trunk/psLib/src/mathtypes/psVector.h
r4821 r4887 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-08- 19 21:27:43$13 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-08-26 23:01:17 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 /// @{ 28 28 29 ///< Union of psVector data types.30 /*31 typedef union {32 psU8* U8; ///< Unsigned 8-bit integer data.33 psU16* U16; ///< Unsigned 16-bit integer data.34 psU32* U32; ///< Unsigned 32-bit integer data.35 psU64* U64; ///< Unsigned 64-bit integer data.36 psS8* S8; ///< Signed 8-bit integer data.37 psS16* S16; ///< Signed 16-bit integer data.38 psS32* S32; ///< Signed 32-bit integer data.39 psS64* S64; ///< Signed 64-bit integer data.40 psF32* F32; ///< Single-precision float data.41 psF64* F64; ///< Double-precision float data.42 psC32* C32; ///< Single-precision complex data.43 psC64* C64; ///< Double-precision complex data.44 }45 p_psVectorData;46 */47 29 /** An vector to support primitive types. 48 30 * -
trunk/psLib/test/mathtypes/tst_psImage.c
r4886 r4887 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-08-26 03:35:03$8 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-08-26 23:01:17 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 328 328 int nCol = 1; 329 329 in1 = psImageAlloc(nRow, nCol, PS_TYPE_U8); 330 if ( !psImageInit(in1, 1 ) ) {330 if ( !psImageInit(in1, -1 ) ) { 331 331 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "ImageInit failed. U8 Case - 1x1\n"); 332 332 } -
trunk/psLib/test/mathtypes/tst_psVector.c
r4547 r4887 14 14 * @author Ross Harman, MHPCC 15 15 * 16 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $17 * @date $Date: 2005-0 7-13 02:47:00$16 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2005-08-26 23:01:17 $ 18 18 * 19 19 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 27 27 static psS32 testVectorRealloc(void); 28 28 static psS32 testVectorExtend(void); 29 static psS32 testVectorInit(void); 29 30 30 31 testDescription tests[] = { … … 32 33 {testVectorRealloc,-2,"psVectorRealloc",0,false}, 33 34 {testVectorExtend,-3,"psVectorExtend",0,false}, 35 {testVectorInit,-4,"psVectorInit",0,false}, 34 36 {NULL} 35 37 }; … … 270 272 return 0; 271 273 } 274 275 psS32 testVectorInit(void) 276 { 277 psVector *in1 = NULL; 278 psVector *in2 = NULL; 279 psVector *in3 = NULL; 280 psVector *in4 = NULL; 281 psVector *in5 = NULL; 282 psVector *in6 = NULL; 283 psVector *in7 = NULL; 284 psVector *in8 = NULL; 285 psVector *in9 = NULL; 286 psVector *in10 = NULL; 287 psVector *in11 = NULL; 288 psVector *in12 = NULL; 289 int nalloc = 1; 290 in1 = psVectorAlloc(nalloc, PS_TYPE_U8); 291 in2 = psVectorAlloc(nalloc, PS_TYPE_U16); 292 in3 = psVectorAlloc(nalloc, PS_TYPE_U32); 293 in4 = psVectorAlloc(nalloc, PS_TYPE_U64); 294 in5 = psVectorAlloc(nalloc, PS_TYPE_S8); 295 in6 = psVectorAlloc(nalloc, PS_TYPE_S16); 296 in7 = psVectorAlloc(nalloc, PS_TYPE_S32); 297 in8 = psVectorAlloc(nalloc, PS_TYPE_S64); 298 in9 = psVectorAlloc(nalloc, PS_TYPE_F32); 299 in10 = psVectorAlloc(nalloc, PS_TYPE_F64); 300 in11 = psVectorAlloc(nalloc, PS_TYPE_C32); 301 in12 = psVectorAlloc(nalloc, PS_TYPE_C64); 302 psC32 vC32; 303 psC64 vC64; 304 305 if ( !psVectorInit(in1, 1 ) ) { 306 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U8 Case \n"); 307 } 308 if ( !psVectorInit(in2, PS_MAX_U64) ) { 309 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U16 Case \n"); 310 } 311 if ( !psVectorInit(in3, 10) ) { 312 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U32 Case \n"); 313 } 314 if ( !psVectorInit(in4, -1) ) { 315 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. U64 Case \n"); 316 } 317 if ( !psVectorInit(in5, PS_MAX_S16 ) ) { 318 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. S8 Case \n"); 319 } 320 if ( !psVectorInit(in6, -100 ) ) { 321 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. S16 Case \n"); 322 } 323 if ( !psVectorInit(in7, 1 ) ) { 324 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. S32 Case \n"); 325 } 326 if ( !psVectorInit(in8, PS_MAX_U64 ) ) { 327 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. S64 Case \n"); 328 } 329 if ( !psVectorInit(in9, 1.1 ) ) { 330 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. F32 Case \n"); 331 } 332 if ( !psVectorInit(in10, 1.4 ) ) { 333 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. F64 Case \n"); 334 } 335 336 vC32 = 1.23 + 1.19I; 337 vC64 = 2.13 + 2.31I; 338 if ( !psVectorInit(in11, vC32 ) ) { 339 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. C32 Case \n"); 340 } 341 if ( !psVectorInit(in12, vC64 ) ) { 342 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "VectorInit failed. C64 Case \n"); 343 } 344 345 psFree(in1); 346 psFree(in2); 347 psFree(in3); 348 psFree(in4); 349 psFree(in5); 350 psFree(in6); 351 psFree(in7); 352 psFree(in8); 353 psFree(in9); 354 psFree(in10); 355 psFree(in11); 356 psFree(in12); 357 return 0; 358 } -
trunk/psLib/test/mathtypes/verified/tst_psImage.stderr
r4886 r4887 122 122 123 123 <DATE><TIME>|<HOST>|E|psImageInit (FILE:LINENO) 124 Error: U8 Value out of Range. 125 <DATE><TIME>|<HOST>|E|testImageInit (FILE:LINENO) 126 ImageInit failed. U8 Case - 1x1 127 <DATE><TIME>|<HOST>|E|psImageInit (FILE:LINENO) 124 128 datatype 260 not defined in psImageInit 125 129 <DATE><TIME>|<HOST>|E|testImageInit (FILE:LINENO) -
trunk/psLib/test/mathtypes/verified/tst_psVector.stderr
r4547 r4887 32 32 ---> TESTPOINT PASSED (psVector{psVectorExtend} | tst_psVector.c) 33 33 34 /***************************** TESTPOINT ******************************************\ 35 * TestFile: tst_psVector.c * 36 * TestPoint: psVector{psVectorInit} * 37 * TestType: Positive * 38 \**********************************************************************************/ 39 40 <DATE><TIME>|<HOST>|E|psVectorInit (FILE:LINENO) 41 Error: U16 Value out of Range. 42 <DATE><TIME>|<HOST>|E|testVectorInit (FILE:LINENO) 43 VectorInit failed. U16 Case 44 <DATE><TIME>|<HOST>|E|psVectorInit (FILE:LINENO) 45 Error: S8 Value out of Range. 46 <DATE><TIME>|<HOST>|E|testVectorInit (FILE:LINENO) 47 VectorInit failed. S8 Case 48 49 ---> TESTPOINT PASSED (psVector{psVectorInit} | tst_psVector.c) 50
Note:
See TracChangeset
for help on using the changeset viewer.
