I have an error when using the Eigen library, and all I am trying to do is subtract the scalar from Eigen :: VectorXf. So my code is as follows:
#define VECTOR_TYPE Eigen::VectorXf
#define MATRIX_TYPE Eigen::MatrixXf
JacobiSVD<MATRIX_TYPE> jacobi_svd(myMat,ComputeThinU | ComputeThinV);
const float offset = 3.0f;
VECTOR_TYPE singular_values = jacobi_svd.singularValues();
VECTOR_TYPE test = singular_values - offset;
The last line leads to a compilation error like:
error: invalid operands in binary expression ('Eigen :: VectorXf' (aka 'Matrix') and 'float') VECTOR_TYPE test = singular_values - scale;
Eigen / src / Core /../ plugins / CommonCwiseBinaryOps.h: 19: 28: note: candidate template is ignored: could not match 'MatrixBase' with 'float' EIGEN_MAKE_CWISE_BINARY_OP (operator-, internal :: scalar_difference_op)
source
share