Re: [eigen] LevenbergMarquardt VC2008 error |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] LevenbergMarquardt VC2008 error
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 21 Dec 2010 22:20:40 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=UOwIBzEydHxi4NJGZNU1chLE10xCnpQ5z40TmoqA1/Q=; b=ICEV2jwrzPvqY/FUUHGjkvn09P/Gd1gSgFocwdL6ZBwLpGnUgzPVYMG+AuQH5S/7Hu 1SRlcJFY/ZpHdibxDBvonwo8sMOW0O2fVyMh3BaXhWS9jCiH3isA1OOvSSXoKexGXLgr veA2dxOyws2TaHQ9QU2w1wcokleDYEYfMIGhE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=gdKYRxe8r5PZ85iwRufEDsjLGghYbZKyeK5EW4qRTnxbZpeACwVguxXGLCKpekLGEm DfX/jpv9/Ch2X0vpQhuDxmEqiqpPXjO5ziipxOoArcZ808ANvEkcFE1Xy/qzJZ87KTIC d4j1kGhlX2MgBJwOomgHzcgFGZP360WHU/RPY=
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
>
>> ]