|
Sacado Package Browser (Single Doxygen Collection) Version of the Day
|
00001 // $Id$ 00002 // $Source$ 00003 // @HEADER 00004 // *********************************************************************** 00005 // 00006 // Sacado Package 00007 // Copyright (2006) Sandia Corporation 00008 // 00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00010 // the U.S. Government retains certain rights in this software. 00011 // 00012 // This library is free software; you can redistribute it and/or modify 00013 // it under the terms of the GNU Lesser General Public License as 00014 // published by the Free Software Foundation; either version 2.1 of the 00015 // License, or (at your option) any later version. 00016 // 00017 // This library is distributed in the hope that it will be useful, but 00018 // WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 // Lesser General Public License for more details. 00021 // 00022 // You should have received a copy of the GNU Lesser General Public 00023 // License along with this library; if not, write to the Free Software 00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00025 // USA 00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps 00027 // (etphipp@sandia.gov). 00028 // 00029 // *********************************************************************** 00030 // @HEADER 00031 00032 #ifndef TAYLORUNITTESTS_HPP 00033 #define TAYLORUNITTESTS_HPP 00034 00035 // ADOL-C includes 00036 #include "adolc/adouble.h" 00037 #include "adolc/interfaces.h" 00038 00039 // Sacado includes 00040 #include "Sacado.hpp" 00041 #include "Sacado_Random.hpp" 00042 00043 inline adouble max(const adouble& a, const adouble& b) { return fmax(a,b); } 00044 inline adouble max(const adouble& a, double v) { return fmax(a,v); } 00045 inline adouble max(double v, const adouble& b) { return fmax(v,b); } 00046 inline adouble min(const adouble& a, const adouble& b) { return fmin(a,b); } 00047 inline adouble min(const adouble& a, double v) { return fmin(a,v); } 00048 inline adouble min(double v, const adouble& b) { return fmin(v,b); } 00049 00050 // Cppunit includes 00051 #include <cppunit/extensions/HelperMacros.h> 00052 00053 #define COMPARE_DOUBLES(a, b) \ 00054 CPPUNIT_ASSERT( fabs(a-b) < tol_a + tol_r*fabs(a) ); 00055 00056 #define COMPARE_POLYS(x_dtay, x_adolc) \ 00057 CPPUNIT_ASSERT(x_dtay.degree() == d); \ 00058 for (unsigned int i=0; i<=d; i++) { \ 00059 COMPARE_DOUBLES(x_dtay.coeff(i), x_adolc[i]); \ 00060 } \ 00061 ; 00062 00063 #define BINARY_OP2_TEST(TESTNAME,OP) \ 00064 void TESTNAME () { \ 00065 c_dtay = a_dtay OP b_dtay; \ 00066 trace_on(0); \ 00067 adouble aa, ab, ac; \ 00068 aa <<= X[0][0]; \ 00069 ab <<= X[1][0]; \ 00070 ac = aa OP ab; \ 00071 ac >>= Y[0][0]; \ 00072 trace_off(); \ 00073 forward(0,1,2,d,0,X,Y); \ 00074 COMPARE_POLYS(c_dtay,Y[0]); \ 00075 } 00076 00077 #define BINARY_OPRC_TEST(TESTNAME,OP) \ 00078 void TESTNAME () { \ 00079 double val = urand.number(); \ 00080 c_dtay = a_dtay OP val; \ 00081 trace_on(0); \ 00082 adouble aa, ac; \ 00083 aa <<= X[0][0]; \ 00084 ac = aa OP val; \ 00085 ac >>= Y[0][0]; \ 00086 trace_off(); \ 00087 forward(0,1,1,d,0,X,Y); \ 00088 COMPARE_POLYS(c_dtay,Y[0]); \ 00089 } 00090 00091 #define BINARY_OPLC_TEST(TESTNAME,OP) \ 00092 void TESTNAME () { \ 00093 double val = urand.number(); \ 00094 c_dtay = val OP a_dtay; \ 00095 trace_on(0); \ 00096 adouble aa, ac; \ 00097 aa <<= X[0][0]; \ 00098 ac = val OP aa; \ 00099 ac >>= Y[0][0]; \ 00100 trace_off(); \ 00101 forward(0,1,1,d,0,X,Y); \ 00102 COMPARE_POLYS(c_dtay,Y[0]); \ 00103 } 00104 00105 #define BINARY_OP_TEST(TESTNAME,OP) \ 00106 BINARY_OP2_TEST(TESTNAME,OP); \ 00107 BINARY_OPLC_TEST(TESTNAME ## LeftConstant,OP); \ 00108 BINARY_OPRC_TEST(TESTNAME ## RightConstant,OP) 00109 00110 #define CPPUNIT_BINARY_OP_TEST(TESTNAME) \ 00111 CPPUNIT_TEST(TESTNAME); \ 00112 CPPUNIT_TEST(TESTNAME ## LeftConstant); \ 00113 CPPUNIT_TEST(TESTNAME ## RightConstant) 00114 00115 #define RELOP_OP2_TEST(TESTNAME,OP) \ 00116 void TESTNAME () { \ 00117 bool r1 = a_dtay OP b_dtay; \ 00118 bool r2 = a_dtay.coeff(0) OP b_dtay.coeff(0); \ 00119 CPPUNIT_ASSERT(r1 == r2); \ 00120 } 00121 00122 #define RELOP_OPLC_TEST(TESTNAME,OP) \ 00123 void TESTNAME () { \ 00124 double val = urand.number(); \ 00125 bool r1 = val OP b_dtay; \ 00126 bool r2 = val OP b_dtay.coeff(0); \ 00127 CPPUNIT_ASSERT(r1 == r2); \ 00128 } 00129 00130 #define RELOP_OPRC_TEST(TESTNAME,OP) \ 00131 void TESTNAME () { \ 00132 double val = urand.number(); \ 00133 bool r1 = a_dtay OP val; \ 00134 bool r2 = a_dtay.coeff(0) OP val; \ 00135 CPPUNIT_ASSERT(r1 == r2); \ 00136 } 00137 00138 #define RELOP_OP_TEST(TESTNAME,OP) \ 00139 RELOP_OP2_TEST(TESTNAME,OP); \ 00140 RELOP_OPLC_TEST(TESTNAME ## LeftConstant,OP); \ 00141 RELOP_OPRC_TEST(TESTNAME ## RightConstant,OP) 00142 00143 #define CPPUNIT_RELOP_OP_TEST(TESTNAME) \ 00144 CPPUNIT_TEST(TESTNAME); \ 00145 CPPUNIT_TEST(TESTNAME ## LeftConstant); \ 00146 CPPUNIT_TEST(TESTNAME ## RightConstant) 00147 00148 #define BINARY_FUNC2_TEST(TESTNAME,FUNC) \ 00149 void TESTNAME () { \ 00150 c_dtay = FUNC (a_dtay, b_dtay); \ 00151 trace_on(0); \ 00152 adouble aa, ab, ac; \ 00153 aa <<= X[0][0]; \ 00154 ab <<= X[1][0]; \ 00155 ac = FUNC (aa, ab); \ 00156 ac >>= Y[0][0]; \ 00157 trace_off(); \ 00158 forward(0,1,2,d,0,X,Y); \ 00159 COMPARE_POLYS(c_dtay,Y[0]); \ 00160 } 00161 00162 #define BINARY_FUNCRC_TEST(TESTNAME,FUNC) \ 00163 void TESTNAME () { \ 00164 double val = urand.number(); \ 00165 c_dtay = FUNC (a_dtay, val); \ 00166 trace_on(0); \ 00167 adouble aa, ac; \ 00168 aa <<= X[0][0]; \ 00169 ac = FUNC (aa, val); \ 00170 ac >>= Y[0][0]; \ 00171 trace_off(); \ 00172 forward(0,1,1,d,0,X,Y); \ 00173 COMPARE_POLYS(c_dtay,Y[0]); \ 00174 } 00175 00176 #define BINARY_FUNCLC_TEST(TESTNAME,FUNC) \ 00177 void TESTNAME () { \ 00178 double val = urand.number(); \ 00179 c_dtay = FUNC (val, a_dtay); \ 00180 trace_on(0); \ 00181 adouble aa, ac; \ 00182 aa <<= X[0][0]; \ 00183 ac = FUNC (val, aa); \ 00184 ac >>= Y[0][0]; \ 00185 trace_off(); \ 00186 forward(0,1,1,d,0,X,Y); \ 00187 COMPARE_POLYS(c_dtay,Y[0]); \ 00188 } 00189 00190 #define BINARY_FUNC_TEST(TESTNAME,FUNC) \ 00191 BINARY_FUNC2_TEST(TESTNAME,FUNC); \ 00192 BINARY_FUNCLC_TEST(TESTNAME ## LeftConstant,FUNC); \ 00193 BINARY_FUNCRC_TEST(TESTNAME ## RightConstant,FUNC) 00194 00195 #define CPPUNIT_BINARY_FUNC_TEST(TESTNAME) \ 00196 CPPUNIT_TEST(TESTNAME); \ 00197 CPPUNIT_TEST(TESTNAME ## LeftConstant); \ 00198 CPPUNIT_TEST(TESTNAME ## RightConstant) 00199 00200 #define UNARY_OP_TEST(TESTNAME,OP) \ 00201 void TESTNAME () { \ 00202 c_dtay = OP a_dtay; \ 00203 trace_on(0); \ 00204 adouble aa, ac; \ 00205 aa <<= X[0][0]; \ 00206 ac = OP aa; \ 00207 ac >>= Y[0][0]; \ 00208 trace_off(); \ 00209 forward(0,1,1,d,0,X,Y); \ 00210 COMPARE_POLYS(c_dtay,Y[0]); \ 00211 } 00212 00213 #define UNARY_FUNC_TEST(TESTNAME,FUNC) \ 00214 void TESTNAME () { \ 00215 c_dtay = FUNC (a_dtay); \ 00216 trace_on(0); \ 00217 adouble aa, ac; \ 00218 aa <<= X[0][0]; \ 00219 ac = FUNC (aa); \ 00220 ac >>= Y[0][0]; \ 00221 trace_off(); \ 00222 forward(0,1,1,d,0,X,Y); \ 00223 COMPARE_POLYS(c_dtay,Y[0]); \ 00224 } 00225 00226 #define UNARY_ASSIGNOP2_TEST(TESTNAME,OP) \ 00227 void TESTNAME () { \ 00228 c_dtay = a_dtay; \ 00229 c_dtay OP b_dtay; \ 00230 trace_on(0); \ 00231 adouble aa, ab, ac; \ 00232 aa <<= X[0][0]; \ 00233 ab <<= X[1][0]; \ 00234 ac = aa; \ 00235 ac OP ab; \ 00236 ac >>= Y[0][0]; \ 00237 trace_off(); \ 00238 forward(0,1,2,d,0,X,Y); \ 00239 COMPARE_POLYS(c_dtay,Y[0]); \ 00240 } 00241 00242 #define UNARY_ASSIGNOPRC_TEST(TESTNAME,OP) \ 00243 void TESTNAME () { \ 00244 double val = urand.number(); \ 00245 c_dtay = a_dtay; \ 00246 c_dtay OP val; \ 00247 trace_on(0); \ 00248 adouble aa, ac; \ 00249 aa <<= X[0][0]; \ 00250 ac = aa; \ 00251 ac OP val; \ 00252 ac >>= Y[0][0]; \ 00253 trace_off(); \ 00254 forward(0,1,1,d,0,X,Y); \ 00255 COMPARE_POLYS(c_dtay,Y[0]); \ 00256 } 00257 00258 #define UNARY_ASSIGNOPLC_TEST(TESTNAME,OP) \ 00259 void TESTNAME () { \ 00260 double val = urand.number(); \ 00261 c_dtay = val; \ 00262 c_dtay OP a_dtay; \ 00263 trace_on(0); \ 00264 adouble aa, ac; \ 00265 aa <<= X[0][0]; \ 00266 ac = val; \ 00267 ac OP aa; \ 00268 ac >>= Y[0][0]; \ 00269 trace_off(); \ 00270 forward(0,1,1,d,0,X,Y); \ 00271 COMPARE_POLYS(c_dtay,Y[0]); \ 00272 } 00273 00274 #define UNARY_ASSIGNOP_TEST(TESTNAME,OP) \ 00275 UNARY_ASSIGNOP2_TEST(TESTNAME,OP); \ 00276 UNARY_ASSIGNOPLC_TEST(TESTNAME ## LeftConstant,OP); \ 00277 UNARY_ASSIGNOPRC_TEST(TESTNAME ## RightConstant,OP) 00278 00279 #define CPPUNIT_UNARY_ASSIGNOP_TEST(TESTNAME) \ 00280 CPPUNIT_TEST(TESTNAME); \ 00281 CPPUNIT_TEST(TESTNAME ## LeftConstant); \ 00282 CPPUNIT_TEST(TESTNAME ## RightConstant) 00283 00284 // A class for testing each Taylor operation 00285 template <class TaylorType> 00286 class TaylorOpsUnitTest : public CppUnit::TestFixture { 00287 00288 CPPUNIT_TEST_SUITE( TaylorOpsUnitTest ); 00289 00290 CPPUNIT_BINARY_OP_TEST(testAddition); 00291 CPPUNIT_BINARY_OP_TEST(testSubtraction); 00292 CPPUNIT_BINARY_OP_TEST(testMultiplication); 00293 CPPUNIT_BINARY_OP_TEST(testDivision); 00294 00295 CPPUNIT_RELOP_OP_TEST(testEquals); 00296 CPPUNIT_RELOP_OP_TEST(testNotEquals); 00297 CPPUNIT_RELOP_OP_TEST(testLessThanOrEquals); 00298 CPPUNIT_RELOP_OP_TEST(testGreaterThanOrEquals); 00299 CPPUNIT_RELOP_OP_TEST(testLessThan); 00300 CPPUNIT_RELOP_OP_TEST(testGreaterThan); 00301 00302 CPPUNIT_BINARY_FUNC_TEST(testPow); 00303 CPPUNIT_BINARY_FUNC_TEST(testMax); 00304 CPPUNIT_BINARY_FUNC_TEST(testMin); 00305 00306 CPPUNIT_TEST(testUnaryPlus); 00307 CPPUNIT_TEST(testUnaryMinus); 00308 00309 CPPUNIT_TEST(testExp); 00310 CPPUNIT_TEST(testLog); 00311 CPPUNIT_TEST(testLog10); 00312 CPPUNIT_TEST(testSqrt); 00313 CPPUNIT_TEST(testCos); 00314 CPPUNIT_TEST(testSin); 00315 CPPUNIT_TEST(testTan); 00316 CPPUNIT_TEST(testACos); 00317 CPPUNIT_TEST(testASin); 00318 CPPUNIT_TEST(testATan); 00319 CPPUNIT_TEST(testCosh); 00320 CPPUNIT_TEST(testSinh); 00321 CPPUNIT_TEST(testTanh); 00322 CPPUNIT_TEST(testFAbs); 00323 00324 CPPUNIT_UNARY_ASSIGNOP_TEST(testPlusEquals); 00325 CPPUNIT_UNARY_ASSIGNOP_TEST(testMinusEquals); 00326 CPPUNIT_UNARY_ASSIGNOP_TEST(testTimesEquals); 00327 CPPUNIT_UNARY_ASSIGNOP_TEST(testDivideEquals); 00328 00329 CPPUNIT_TEST(testComposite1); 00330 00331 CPPUNIT_TEST_SUITE_END(); 00332 00333 public: 00334 00335 TaylorOpsUnitTest(); 00336 00337 TaylorOpsUnitTest(unsigned int degree, double absolute_tolerance, 00338 double relative_tolerance); 00339 00340 ~TaylorOpsUnitTest(); 00341 00342 void setUp(); 00343 00344 void tearDown(); 00345 00346 BINARY_OP_TEST(testAddition, +); 00347 BINARY_OP_TEST(testSubtraction, -); 00348 BINARY_OP_TEST(testMultiplication, *); 00349 BINARY_OP_TEST(testDivision, /); 00350 00351 RELOP_OP_TEST(testEquals, ==); 00352 RELOP_OP_TEST(testNotEquals, !=); 00353 RELOP_OP_TEST(testLessThanOrEquals, <=); 00354 RELOP_OP_TEST(testGreaterThanOrEquals, >=); 00355 RELOP_OP_TEST(testLessThan, <); 00356 RELOP_OP_TEST(testGreaterThan, >); 00357 00358 BINARY_FUNC_TEST(testPow, pow); 00359 BINARY_FUNC_TEST(testMax, max); 00360 BINARY_FUNC_TEST(testMin, min); 00361 00362 UNARY_OP_TEST(testUnaryPlus, +); 00363 UNARY_OP_TEST(testUnaryMinus, -); 00364 00365 UNARY_FUNC_TEST(testExp, exp); 00366 UNARY_FUNC_TEST(testLog, log); 00367 UNARY_FUNC_TEST(testLog10, log10); 00368 UNARY_FUNC_TEST(testSqrt, sqrt); 00369 UNARY_FUNC_TEST(testCos, cos); 00370 UNARY_FUNC_TEST(testSin, sin); 00371 UNARY_FUNC_TEST(testTan, tan); 00372 UNARY_FUNC_TEST(testACos, acos); 00373 UNARY_FUNC_TEST(testASin, asin); 00374 UNARY_FUNC_TEST(testATan, atan); 00375 UNARY_FUNC_TEST(testCosh, cosh); 00376 UNARY_FUNC_TEST(testSinh, sinh); 00377 UNARY_FUNC_TEST(testTanh, tanh); 00378 UNARY_FUNC_TEST(testFAbs, fabs); 00379 00380 UNARY_ASSIGNOP_TEST(testPlusEquals, +=); 00381 UNARY_ASSIGNOP_TEST(testMinusEquals, -=); 00382 UNARY_ASSIGNOP_TEST(testTimesEquals, *=); 00383 UNARY_ASSIGNOP_TEST(testDivideEquals, /=); 00384 00385 template <typename ScalarT> 00386 ScalarT composite1(const ScalarT& a, const ScalarT& b) { 00387 ScalarT t1 = 3. * a + sin(b) / log(fabs(a - b * 7.)); 00388 ScalarT t2 = 1.0e3; 00389 ScalarT t3 = 5.7e4; 00390 ScalarT t4 = 3.2e5; 00391 t1 *= cos(a + exp(t1)) / 6. - tan(t1*sqrt(fabs(a * log10(fabs(b))))); 00392 t1 -= acos((6.+asin(pow(fabs(a),b)/t2))/t3) * asin(pow(fabs(b),2.)*1.0/t4) * atan((b*pow(2.,log(fabs(a))))/(t3*t4)); 00393 t1 /= cosh(b - 0.7) + 7.*sinh(t1 + 0.8)*tanh(9./(a+1.)) - 9.; 00394 t1 += pow(fabs(a*4.),b-8.)/cos(a*b*a); 00395 00396 return t1; 00397 } 00398 00399 void testComposite1() { 00400 c_dtay = composite1(a_dtay, b_dtay); 00401 trace_on(0); 00402 adouble aa, ab, ac; 00403 aa <<= X[0][0]; 00404 ab <<= X[1][0]; 00405 ac = composite1(aa,ab); 00406 ac >>= Y[0][0]; 00407 trace_off(); 00408 forward(0,1,2,d,0,X,Y); 00409 COMPARE_POLYS(c_dtay,Y[0]); 00410 } 00411 00412 void print_poly(double *x); 00413 00414 void print_diff(const TaylorType& x_dtay, double* x_adolc); 00415 00416 protected: 00417 00418 // Taylor variables 00419 TaylorType a_dtay, b_dtay, c_dtay; 00420 00421 // ADOL-C arrays 00422 double **X, **Y; 00423 00424 // Random number generator 00425 Sacado::Random<double> urand; 00426 00427 // Degree of polynomials 00428 unsigned int d; 00429 00430 // Tolerances to which fad objects should be the same 00431 double tol_a, tol_r; 00432 00433 }; // class TaylorOpsUnitTest 00434 00435 template <class TaylorType> 00436 TaylorOpsUnitTest<TaylorType>::TaylorOpsUnitTest() : 00437 urand(), d(5), tol_a(1.0e-11), tol_r(1.0e-10) 00438 { 00439 X = new double*[2]; 00440 X[0] = new double[d+1]; 00441 X[1] = new double[d+1]; 00442 00443 Y = new double*[1]; 00444 Y[0] = new double[d+1]; 00445 } 00446 00447 template <class TaylorType> 00448 TaylorOpsUnitTest<TaylorType>::TaylorOpsUnitTest(unsigned int degree, 00449 double absolute_tolerance, 00450 double relative_tolerance) : 00451 urand(), 00452 d(degree), 00453 tol_a(absolute_tolerance), 00454 tol_r(relative_tolerance) 00455 { 00456 X = new double*[2]; 00457 X[0] = new double[d+1]; 00458 X[1] = new double[d+1]; 00459 00460 Y = new double*[1]; 00461 Y[0] = new double[d+1]; 00462 } 00463 00464 template <class TaylorType> 00465 TaylorOpsUnitTest<TaylorType>::~TaylorOpsUnitTest() 00466 { 00467 delete [] X[1]; 00468 delete [] X[0]; 00469 delete [] X; 00470 00471 delete [] Y[0]; 00472 delete [] Y; 00473 } 00474 00475 template <class TaylorType> 00476 void TaylorOpsUnitTest<TaylorType>::setUp() { 00477 double val; 00478 00479 a_dtay = TaylorType(d,0.0); 00480 b_dtay = TaylorType(d,0.0); 00481 00482 for (unsigned int i=0; i<=d; i++) { 00483 val = urand.number(); 00484 a_dtay.fastAccessCoeff(i) = val; 00485 X[0][i] = val; 00486 00487 val = urand.number(); 00488 b_dtay.fastAccessCoeff(i) = val; 00489 X[1][i] = val; 00490 00491 Y[0][i] = 0.0; 00492 } 00493 } 00494 00495 template <class TaylorType> 00496 void TaylorOpsUnitTest<TaylorType>::tearDown() {} 00497 00498 template <class TaylorType> 00499 void TaylorOpsUnitTest<TaylorType>::print_poly(double *x) { 00500 std::cout.setf(std::ios::fixed,std::ios::floatfield); 00501 std::cout.width(12); 00502 std::cout << "["; 00503 00504 for (unsigned int i=0; i<=d; i++) { 00505 std::cout.width(12); 00506 std::cout << x[i]; 00507 } 00508 00509 std::cout << "]\n"; 00510 } 00511 00512 template <class TaylorType> 00513 void TaylorOpsUnitTest<TaylorType>::print_diff(const TaylorType& x_dtay, 00514 double *x) { 00515 std::cout.setf(std::ios::scientific,std::ios::floatfield); 00516 //std::cout.width(12); 00517 std::cout << "["; 00518 00519 for (unsigned int i=0; i<=d; i++) { 00520 //std::cout.width(12); 00521 std::cout << x_dtay.coeff(i) - x[i] << " "; 00522 } 00523 00524 std::cout << "]\n"; 00525 } 00526 00527 #include "Sacado_Tay_CacheTaylor.hpp" 00528 // CacheTaylor unit tests that don't test max/min, since this class 00529 // doesn't define those yet 00530 class CacheTaylorOpsUnitTest : 00531 public TaylorOpsUnitTest< Sacado::Tay::CacheTaylor<double> > { 00532 00533 CPPUNIT_TEST_SUITE( CacheTaylorOpsUnitTest ); 00534 00535 CPPUNIT_BINARY_OP_TEST(testAddition); 00536 CPPUNIT_BINARY_OP_TEST(testSubtraction); 00537 CPPUNIT_BINARY_OP_TEST(testMultiplication); 00538 CPPUNIT_BINARY_OP_TEST(testDivision); 00539 00540 CPPUNIT_RELOP_OP_TEST(testEquals); 00541 CPPUNIT_RELOP_OP_TEST(testNotEquals); 00542 CPPUNIT_RELOP_OP_TEST(testLessThanOrEquals); 00543 CPPUNIT_RELOP_OP_TEST(testGreaterThanOrEquals); 00544 CPPUNIT_RELOP_OP_TEST(testLessThan); 00545 CPPUNIT_RELOP_OP_TEST(testGreaterThan); 00546 00547 CPPUNIT_BINARY_FUNC_TEST(testPow); 00548 CPPUNIT_BINARY_FUNC_TEST(testMax); 00549 CPPUNIT_BINARY_FUNC_TEST(testMin); 00550 00551 CPPUNIT_TEST(testUnaryPlus); 00552 CPPUNIT_TEST(testUnaryMinus); 00553 00554 CPPUNIT_TEST(testExp); 00555 CPPUNIT_TEST(testLog); 00556 CPPUNIT_TEST(testLog10); 00557 CPPUNIT_TEST(testSqrt); 00558 CPPUNIT_TEST(testCos); 00559 CPPUNIT_TEST(testSin); 00560 CPPUNIT_TEST(testTan); 00561 CPPUNIT_TEST(testACos); 00562 CPPUNIT_TEST(testASin); 00563 CPPUNIT_TEST(testATan); 00564 CPPUNIT_TEST(testCosh); 00565 CPPUNIT_TEST(testSinh); 00566 CPPUNIT_TEST(testTanh); 00567 CPPUNIT_TEST(testFAbs); 00568 00569 CPPUNIT_UNARY_ASSIGNOP_TEST(testPlusEquals); 00570 CPPUNIT_UNARY_ASSIGNOP_TEST(testMinusEquals); 00571 CPPUNIT_UNARY_ASSIGNOP_TEST(testTimesEquals); 00572 CPPUNIT_UNARY_ASSIGNOP_TEST(testDivideEquals); 00573 00574 CPPUNIT_TEST(testComposite1); 00575 00576 CPPUNIT_TEST_SUITE_END(); 00577 00578 public: 00579 00580 CacheTaylorOpsUnitTest() {} 00581 00582 CacheTaylorOpsUnitTest(unsigned int degree, double absolute_tolerance, 00583 double relative_tolerance) : 00584 TaylorOpsUnitTest< Sacado::Tay::CacheTaylor<double> >(degree, 00585 absolute_tolerance, 00586 relative_tolerance) {} 00587 00588 ~CacheTaylorOpsUnitTest() {} 00589 00590 void testMax() {} 00591 void testMin() {} 00592 00593 }; 00594 00595 #endif // TAYLORUNITTESTS_HPP
1.7.4