Open
Description
Since class Matrix
is templatized
template <typename Scalar>
class Matrix final {
......
private:
...........
// The zero_point, i.e. which Scalar value is to be interpreted as zero.
// When Scalar is floating-point, this must be 0.
Scalar zero_point_ = 0;
};
I could have something like: Matrix<Eigen::half> myMatrix;
but then at compilation I get error: no viable conversion from 'int' to 'Eigen::half' Scalar zero_point_ = 0;
since the zero isn't templatized
integer 0 and float zero are interchangeable so the above code works; but it's not the generic case for templates. I believe an implementation like Scalar zero_point_ = Scalar{0};
is more generic
Similar fixes to other classes and parts of the code?
Metadata
Metadata
Assignees
Labels
No labels