6 namespace DataStream_impl {
35 throw std::runtime_error(
36 std::string(
"No viable conversion to type 'char' from double ") +
43 if (a.size())
return a[0];
65 std::transform(a.begin(), a.end(), a.begin(), tolower);
67 if (a ==
"true")
return true;
68 if (a ==
"false")
return false;
69 throw std::runtime_error(
"No viable convertion to type 'bool' from string '" +
75 if (toupper(a) ==
'F')
return false;
76 if (toupper(a) ==
'T')
return true;
77 throw std::runtime_error(
"No viable convertion to type 'bool' from char '" +
78 std::string(1, a) +
"\n");
95 return std::string(1, a);
std::string to_string(ENUM val)
Return string representation of enum class.
Eigen::CwiseUnaryOp< decltype(Local::round_l< typename Derived::Scalar >), const Derived > round(const Eigen::MatrixBase< Derived > &val)
Round Eigen::MatrixXd.
bool almost_zero(const T &val, double tol=TOL)
If T is not integral, use std::abs(val) < tol;.