MCPcopy Create free account
hub / github.com/coin-or/CppAD / CheckSimpleVector

Function CheckSimpleVector

example/utility/check_simple_vector.cpp:158–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158bool 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++

Callers

nothing calls this directly

Calls 1

SscalFunction · 0.85

Tested by

no test coverage detected