I am trying to use the Eigen library for some simple image processing. I would use Array3f for the triple of RGB and Array to store the RGB image. This seems to work partially, and I can conveniently perform component addition, multiplication, and division of images. But some operations (in particular, subtraction or negation) seem to create compilation errors. Here is a minimal example:
The above code gives me three errors:
./Eigen/src/Core/CwiseBinaryOp.h:128:7: error: no member named 'YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY' in 'Eigen::internal::static_assertion<false>' EIGEN_CHECK_BINARY_COMPATIBILIY(BinaryOp,typename Lhs::Scalar,typename Rhs::Scalar); ... ./Eigen/src/Core/CwiseBinaryOp.h:187:14: error: no matching function for call to object of type 'const Eigen::internal::scalar_sum_op<Eigen::Array<float, 3, 1, 0, 3, 1> >' return derived().functor()(derived().lhs().coeff(index), ... ./Eigen/src/Core/../plugins/ArrayCwiseBinaryOps.h:208:10: error: no viable conversion from 'const CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const Eigen::Array<Eigen::Array<float, 3, 1, 0, 3, 1>, -1, -1, 0, -1, -1>, const Eigen::CwiseUnaryOp<Eigen::internal::scalar_opposite_op<float>, const Eigen::Array<float, 3, 1, 0, 3, 1> > >' to 'const CwiseUnaryOp<internal::scalar_add_op<Scalar>, const Eigen::Array<Eigen::Array<float, 3, 1, 0, 3, 1>, -1, -1, 0, -1, -1> >' return *this + (-scalar); ...