24 #include "fmatvec/fmatvec.h"
25 #include "mbsim/mbsim_event.h"
26 #include <mbsim/numerics/csparse.h>
27 #include <mbxmlutilshelper/dom.h>
28 #include <xercesc/dom/DOMDocument.hpp>
32 #include <boost/lexical_cast.hpp>
33 #include <boost/algorithm/string/trim.hpp>
40 double sign(
double x);
45 inline double mod(
double x,
double y) {
return x - y * floor (x / y); }
53 double ArcTan(
double x,
double y);
67 static double cast(
const double &x) {
81 class ToDouble<fmatvec::RowVector<Row,double> > {
91 static Ret cast(
const char *x) {
99 static double cast(
const std::string &x) {
100 return boost::lexical_cast<
double>(boost::algorithm::trim_copy(x));
107 static Ret cast(
double x) {
108 throw std::runtime_error(
"FromDouble::cast not implemented for current type.");
128 template <
class Row,
class Col>
129 class FromDouble<fmatvec::Matrix<fmatvec::General,Row,Col,double> > {
139 static double cast(
double x) {
147 static Ret cast(
const fmatvec::VecV &x) {
155 static double cast(
const fmatvec::VecV &x) {
164 fmatvec::Vec3 computeTangential(
const fmatvec::Vec3 &n);
double ArcTan(double x, double y)
calculates planar angle in [0,2] with respect to Cartesian coordinates of: Arc Tangent (y/x) ...
Definition: utils.cc:39
double sign(double x)
Compute the sign of x.
Definition: utils.cc:30
double mod(double x, double y)
Compute the modulo of x and y.
Definition: utils.h:45
Mat cs2Mat(cs *sparseMat)
calculate a fmatvec::Mat out of a sparse matrix
Definition: utils.cc:48