12 template <
typename TimeT = std::chrono::milliseconds>
14 template <
typename F,
typename... Args>
15 static typename TimeT::rep
execution(
F func, Args&&... args) {
16 auto start = std::chrono::system_clock::now();
19 func(std::forward<Args>(args)...);
21 auto duration = std::chrono::duration_cast<TimeT>(
22 std::chrono::system_clock::now() - start);
24 return duration.count();
28 template <
typename Derived>
29 std::string
to_string(
const Eigen::MatrixBase<Derived>& a) {
36 void valuecheck(
const T& a,
const T& b, std::string error_msg =
"") {
38 std::ostringstream stream;
40 stream <<
"Expected:\n" << a <<
"\nbut got:\n" << b <<
"\n";
41 throw std::runtime_error(stream.str());
47 std::ostringstream stream;
48 stream <<
"Expected:\n" << a <<
"\nbut got:\n" << b <<
"\n";
49 throw std::runtime_error(stream.str());
Definition: testUtil.h:13
FunctionalForm abs(FunctionalForm const &x)
Definition: functional_form.cc:183
void valuecheck(const T &a, const T &b, std::string error_msg="")
Definition: testUtil.h:36
static TimeT::rep execution(F func, Args &&...args)
Definition: testUtil.h:15
std::string to_string(const Eigen::MatrixBase< Derived > &a)
Definition: testUtil.h:29
std::vector< snopt::doublereal > F
Definition: SnoptSolver.cpp:47