codac icon indicating copy to clipboard operation
codac copied to clipboard

[eigen] Avoid using .template cast<Interval>() for mixed types operations

Open SimonRohou opened this issue 3 months ago • 0 comments

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

SimonRohou avatar Oct 28 '25 13:10 SimonRohou