base_require
| 28 | // |
| 29 | // base_require |
| 30 | bool base_require(void) |
| 31 | { // ok |
| 32 | bool ok = true; |
| 33 | // |
| 34 | // x, y |
| 35 | valvector x, y; |
| 36 | // |
| 37 | // ok |
| 38 | x = valvector(2.5); |
| 39 | int integer_x = CppAD::Integer(x); |
| 40 | ok &= integer_x == 2; |
| 41 | // |
| 42 | // ok |
| 43 | valvector nan = CppAD::numeric_limits<valvector>::quiet_NaN(); |
| 44 | ok &= CppAD::isnan( nan ); |
| 45 | // |
| 46 | // ok |
| 47 | x = valvector( {1, 2} ); |
| 48 | std::string string_x = CppAD::to_string( x ); |
| 49 | std::string s; |
| 50 | for(auto itr = string_x.begin(); itr != string_x.end(); ++itr) |
| 51 | if( *itr != ' ') |
| 52 | s.push_back( *itr ); |
| 53 | ok &= s == "{1,2}"; |
| 54 | // |
| 55 | // ok |
| 56 | x = valvector( {1, 2} ); |
| 57 | y = valvector( {1.0, 2.0} ); |
| 58 | ok &= CppAD::EqualOpSeq(x, y); |
| 59 | // |
| 60 | // ok |
| 61 | ok &= CppAD::IdenticalCon(x); |
| 62 | ok &= ! CppAD::IdenticalZero(x); |
| 63 | ok &= ! CppAD::IdenticalOne(x); |
| 64 | ok &= CppAD::IdenticalEqualCon(x, y); |
| 65 | // |
| 66 | x = valvector( {0.0, 0.0} ); |
| 67 | ok &= CppAD::IdenticalZero(x); |
| 68 | // |
| 69 | return ok; |
| 70 | } |
| 71 | // END C++ |
nothing calls this directly
no test coverage detected