Re: [eigen] LevenbergMarquardt VC2008 error

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


yes, I think Benoit has a patch fixing this. The pb is that Transpose
has a non const data() member which should not be present for a "const
Transpose". To be more precise, when the nested object is a "read-only
const MapBase", then Transpose::data() calls
const_cast_derived().data() on it, but const_cast_derived() still
returns an object inheriting a "read only MapBase<>" for which there
is only a "const Scalar* data() const" member, thus the invalid
conversion error. However, I don't know why MSVC complains because it
should not try to instantiate this non const data() member... Anyway,
this is going to be fixed very soon.

gael

On Tue, Dec 21, 2010 at 6:57 PM, Thomas Capricelli
<orzel@xxxxxxxxxxxxxxx> wrote:
> Err..!! ?? No, i'm afraid i can not. Benoit, Gael.. any idea ? The code
> leading to this is unsupported/Eigen/src/NonLinearOptimization/lmpar.h:218 :
>
> qr.matrixQR().topLeftCorner(n, n).transpose().template
> triangularView<Lower>().solveInPlace(wa1);
>
> I guess some recent changes about correctness is responsible for this.. ?
> Should i use some newer API ? I can't reproduce here, the unittests for
> LevenbergMarquardt in eigen compiles fine here, and my own projects based on
> eigen that uses LM have no compilation problem either...
>
> Thomas
>
> --
>
> Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
>
> http://www.freehackers.org/thomas
>
> On Tuesday 21 December 2010 10:21:43 SHIROKOBROD Oleg wrote:
>
>> Hi Thomas,
>
>>
>
>>
>
>>
>
>> I think you are the right person for asking. While compiling my
>
>> NonlinearLeastSquareFitterTest with MSVS 2008, I get the following
>
>> error message
>
>>
>
>>
>
>>
>
>> Compiling...
>
>> NonlinearLeastSquareFitterTest.cpp
>
>> eigen3\eigen\src\core\transpose.h(120) : error C2440: 'return' : cannot
>
>> convert from 'const double *' to 'double *'
>
>> Conversion loses qualifiers
>
>> eigen\src\core\transpose.h(120) : while compiling class template
>
>> member function 'double *Eigen::TransposeImpl::data(void)'
>
>> with
>
>> [
>
>> MatrixType=Eigen::Block<EIGEN::MATRIX,-1,-1,false>,
>
>> StorageKind=Eigen::Dense
>
>> ]
>
>> eigen3\eigen\src\core\transpose.h(69) : see reference to class
>
>> template instantiation 'Eigen::TransposeImpl' being compiled
>
>> with
>
>> [
>
>> MatrixType=Eigen::Block<EIGEN::MATRIX,-1,-1,false>,
>
>> StorageKind=Eigen::Dense
>
>> ]
>
>> eigen3\unsupported\eigen\src\nonlinearoptimization\lmpar.h(218)
>
>> : see reference to class template instantiation 'Eigen::Transpose' being
>
>> compiled
>
>> with
>
>> [
>
>> MatrixType=Eigen::Block<EIGEN::MATRIX,-1,-1,false>
>
>> ]
>
>>
>
>> eigen3\unsupported\eigen\src\nonlinearoptimization\levenbergmarquardt.h(
>
>> 279) : see reference to function template instantiation 'void
>
>> Eigen::internal::lmpar2(const Eigen::ColPivHouseholderQR<_MatrixType>
>
>> &,const Eigen::Matrix<_Scalar,_Rows,_Cols> &,const
>
>> Eigen::Matrix<_Scalar,_Rows,_Cols> &,Scalar,Scalar
>
>> &,Eigen::Matrix<_Scalar,_Rows,_Cols> &)' being compiled
>
>> with
>
>> [
>
>> Scalar=double,
>
>> _MatrixType=Eigen::Matrix,
>
>> _Scalar=double,
>
>> _Rows=-1,
>
>> _Cols=1
>
>> ]
>
>>
>
>> eigen3\unsupported\eigen\src\nonlinearoptimization\levenbergmarquardt.h(
>
>> 222) : while compiling class template member function
>
>> 'Eigen::LevenbergMarquardtSpace::Status
>
>> Eigen::LevenbergMarquardt::minimizeOneStep(Eigen::Matrix<_Scalar,_Rows,_
>
>> Cols> &)'
>
>> with
>
>> [
>
>> FunctorType=
>
>> EigenNonlinearLeastSquareFitter<LINEARCOMBINATION>,
>
>> _Scalar=double,
>
>> _Rows=-1,
>
>> _Cols=1
>
>> ]
>
>>
>
>> eigen3\unsupported\eigen\src\nonlinearoptimization\levenbergmarquardt.h(
>
>> 166) : while compiling class template member function
>
>> 'Eigen::LevenbergMarquardtSpace::Status
>
>> Eigen::LevenbergMarquardt::minimize(Eigen::Matrix<_Scalar,_Rows,_Cols>
>
>> &)'
>
>> with
>
>> [
>
>> FunctorType=
>
>> EigenNonlinearLeastSquareFitter<LINEARCOMBINATION>,
>
>> _Scalar=double,
>
>> _Rows=-1,
>
>> _Cols=1
>
>> ]



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