| 156 | } |
| 157 | |
| 158 | bool CheckSimpleVector(void) |
| 159 | { bool ok = true; |
| 160 | using CppAD::vector; |
| 161 | |
| 162 | // -------------------------------------------------------- |
| 163 | // If you change double to float in the next statement, |
| 164 | // CheckSimpleVector will generate an error message at compile time. |
| 165 | double a = 3.; |
| 166 | // -------------------------------------------------------- |
| 167 | |
| 168 | size_t n = 2; |
| 169 | MyVector<double> v(n); |
| 170 | v[0] = 1.; |
| 171 | v[1] = 2.; |
| 172 | MyVector<double> r = Sscal(a, v); |
| 173 | ok &= (r[0] == 3.); |
| 174 | ok &= (r[1] == 6.); |
| 175 | |
| 176 | return ok; |
| 177 | } |
| 178 | |
| 179 | // END C++ |