Re: [eigen] Compiler error with stableNorm

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Wow, that was fast. Thanks!

On 12/15/2017 03:17 PM, Gael Guennebaud wrote:
> thank you for the report,
> 
> fixed:
> https://bitbucket.org/eigen/eigen/commits/c2947c341c68/
> https://bitbucket.org/eigen/eigen/commits/499e982b9281/
> 
> you can either update to the head of 3.3, or workaround by evaluating the subexpression:
> (s*v).eval().stableNorm().
> 
> cheers,
> gael
> 
> On Fri, Dec 15, 2017 at 2:51 PM, Claas H. Köhler <claas.koehler@xxxxxx <mailto:claas.koehler@xxxxxx>>
> wrote:
> 
>     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
> 
> 
> 

-- 
Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)
Institut für Methodik der Fernerkundung | Experimentelle Verfahren | Münchener Str 20| 82234 Weßling

Dr. Claas H. Köhler
Telefon 08153 28-1274 | Telefax 08153 28-1337 | claas.koehler@xxxxxx

www.DLR.de/EOC



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/