codac
codac copied to clipboard
[eigen] Avoid using .template cast<Interval>() for mixed types operations
In C++, the following operation cannot be written...
Eigen::Matrix<Interval,-1,-1> A;
Eigen::Matrix<double,-1,-1> B;
Eigen::Matrix<Interval,-1,-1> C = A * B;
.. without casting B to an interval type:
Eigen::Matrix<Interval,-1,-1> C = A * B.template cast<Interval>();
This could be simplified (maybe), based on: https://libeigen.gitlab.io/eigen/docs-3.3/structEigen_1_1ScalarBinaryOpTraits.html