iheartla / Iheartla.github.io

0 stars 0 forks source link

Change precision {float, double} #9

Open pressureless opened 3 years ago

pressureless commented 3 years ago

Created by @SoufianeKHIAT:

Nice to have, being able to change precision of computation.

Can be easily hidden behind a typedef.

#ifdef FLOAT_32
typedef float        Scalar;
#else
typedef double  Scalar;
#endif

[minor] And matrix type will became:

Eigen::Matrix<Scalar, ..., ...>

Which can be hidden behind another typedef, which will simplify the usage in test/production/...

pressureless commented 3 years ago

Comment by @alecjacobson:

Thanks! we have most of these rules for matlab (even more strict than C++). Should be easy to enable for C++ or even optionally for any target.