[eigen] Compiler error with stableNorm |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi,
When compiling the code below, I get a compiler error (using gcc-7 on openSuse 13.2). The code
compiles fine when replacing stableNorm by blueNorm. Is this intendend ?
Here is a minimal example reproducing the issue:
#include <complex>
#include <iostream>
#include <Eigen/Core>
int main(void){
typedef std::complex<double> Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1> Vector;
typedef Eigen::Matrix<RealScalar, Eigen::Dynamic, 1> RealVector;
Vector v;
Scalar s;
std::cout << (s*v).stableNorm() <<std::endl;
return 0;
}
The following error message seems to indicate the main problem:
eigen/3.3.4/include/eigen3/Eigen/src/Core/StableNorm.h:187:34:
error: no matching function for call to ‘Eigen::VectorBlock<const Eigen::Matrix<std::complex<double>,
-1, 1>, -1>::VectorBlock(Eigen::DenseBase<Eigen::Matrix<std::complex<double>, -1, 1>
>::SegmentReturnType)’
internal::stable_norm_kernel(SegmentWrapper(copy.segment(bi,numext::mini(blockSize, n - bi))),
ssq, scale, invScale);
eigen3/Eigen/src/Core/VectorBlock.h:56:47: note:
no known conversion for argument 1 from ‘Eigen::DenseBase<Eigen::Matrix<std::complex<double>, -1, 1>
>::SegmentReturnType {aka Eigen::VectorBlock<Eigen::Matrix<std::complex<double>, -1, 1>, -1>}’ to
‘const Eigen::VectorBlock<const Eigen::Matrix<std::complex<double>, -1, 1>, -1>&’
eigen/3.3.4/include/eigen3/Eigen/src/Core/VectorBlock.h:56:47: note: candidate:
Eigen::VectorBlock<const Eigen::Matrix<std::complex<double>, -1, 1>,
-1>::VectorBlock(Eigen::VectorBlock<const Eigen::Matrix<std::complex<double>, -1, 1>, -1>&&)
/home/opairs01/tools/eigen/3.3.4/include/eigen3/Eigen/src/Core/VectorBlock.h:56:47:
note: no known conversion for argument 1 from
‘Eigen::DenseBase<Eigen::Matrix<std::complex<double>, -1, 1> >::SegmentReturnType {aka
Eigen::VectorBlock<Eigen::Matrix<std::complex<double>, -1, 1>, -1>}’ to ‘Eigen::VectorBlock<const
Eigen::Matrix<std::complex<double>, -1, 1>, -1>&&’
Any help would be appreciated.
Regards
Claas