Changeset 5094 for trunk/psLib/test/math/tst_psFunc11.c
- Timestamp:
- Sep 22, 2005, 12:22:15 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/math/tst_psFunc11.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tst_psFunc11.c
r5092 r5094 4 4 * ORD and CHEB type polynomials. 5 5 * 6 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $7 * @date $Date: 2005-09-22 2 0:45:43$6 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2005-09-22 22:22:15 $ 8 8 * 9 9 * Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii … … 19 19 20 20 static psS32 testPoly4DEval(void); 21 //static psS32 testPoly4DEvalVector(void);21 static psS32 testPoly4DEvalVector(void); 22 22 23 23 testDescription tests[] = { 24 24 {testPoly4DEval,583,"psPolynomial4DEval",true,false}, 25 //{testPoly4DEvalVector,000,"psPolynomial4DEvalVector",true,false},25 {testPoly4DEvalVector,000,"psPolynomial4DEvalVector",true,false}, 26 26 {NULL} 27 27 }; … … 378 378 { 379 379 psBool testStatus = true; 380 381 380 // Allocate polynomial structure 382 381 psPolynomial4D* polyOrd = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD); … … 405 404 testStatus = false; 406 405 } 407 408 406 psF64 resultCheb = psPolynomial4DEval(polyCheb,Dpoly4DWXYZChebValue[i][0],Dpoly4DWXYZChebValue[i][1], 409 407 Dpoly4DWXYZChebValue[i][2],Dpoly4DWXYZChebValue[i][3]); … … 431 429 return(testStatus); 432 430 } 433 /* 431 434 432 psS32 testPoly4DEvalVector(void) 435 433 { 434 psBool testStatus = true; 436 435 // Allocate polynomial 437 436 psPolynomial4D* polyOrd = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_ORD); 438 437 psPolynomial4D* polyCheb = psPolynomial4DAlloc(TERMS-1, TERMS-1, TERMS-1, TERMS-1, PS_POLYNOMIAL_CHEB); 439 438 440 439 // Set polynomial members 441 440 for(psS32 i = 0; i < TERMS; i++) { … … 451 450 } 452 451 } 453 452 454 453 // Create input vectors 455 454 psVector* inputOrdW = psVectorAlloc(TESTPOINTS, PS_TYPE_F64); … … 471 470 inputChebZ->data.F64[i] = Dpoly4DWXYZChebValue[i][3]; 472 471 } 473 472 474 473 // Evaluate the vectors 475 474 psVector* outputOrd = psPolynomial4DEvalVector(polyOrd,inputOrdW,inputOrdX,inputOrdY,inputOrdZ); … … 480 479 if(outputOrd->type.type != PS_TYPE_F64) { 481 480 printf("TEST ERROR: Output vector of type %d expected %d", 482 outputOrd->type.type, PS_TYPE_F64);481 outputOrd->type.type, PS_TYPE_F64); 483 482 testStatus = false; 484 483 } … … 490 489 if(outputCheb->type.type != PS_TYPE_F64) { 491 490 printf("TEST ERROR: Output vector of type %d expected %d", 492 outputCheb->type.type, PS_TYPE_F64);493 testStatus = false; 494 } 495 491 outputCheb->type.type, PS_TYPE_F64); 492 testStatus = false; 493 } 494 496 495 // Verify the results 497 496 for(psS32 i = 0; i < TESTPOINTS; i++) { 498 497 if(fabs(Dpoly4DResult[i]-outputOrd->data.F64[i]) > ERROR_TOL) { 499 498 printf("TEST ERROR: Result[%d] %lg not equal to expected %lg", 500 i, outputOrd->data.F64[i], Dpoly4DResult[i]);499 i, outputOrd->data.F64[i], Dpoly4DResult[i]); 501 500 testStatus = false; 502 501 } 503 502 if(fabs(Dpoly4DChebResult[i]-outputCheb->data.F64[i]) > ERROR_TOL) { 504 503 printf("TEST ERROR: ResultCheb[%d] %lg not equal to expected %lg", 505 i, outputCheb->data.F64[i], Dpoly4DChebResult[i]);504 i, outputCheb->data.F64[i], Dpoly4DChebResult[i]); 506 505 testStatus = false; 507 506 } 508 507 } 509 508 510 509 // Attempt to invoke function with null polynomial 511 510 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL polynomial"); … … 514 513 testStatus = false; 515 514 } 516 515 517 516 // Attempt to invoke function with null input vector 518 517 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for NULL input vector"); … … 539 538 testStatus = false; 540 539 } 541 540 542 541 // Attempt to invoke function with a non F64 type input vector 543 542 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message for invalid input type"); … … 572 571 } 573 572 inputOrdW->type.type = PS_TYPE_F64; 574 573 575 574 psFree(inputOrdX); 576 575 psFree(inputOrdY); … … 585 584 psFree(polyOrd); 586 585 psFree(polyCheb); 587 586 588 587 return(testStatus); 589 588 } 590 591 */
Note:
See TracChangeset
for help on using the changeset viewer.
