Re: [eigen] TriangularView::coeff() fails to compile

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


thank you for the report and, more importantly, for the fix :)

I've just committed this change.

gael

On Sat, Jul 10, 2010 at 9:46 PM, Martin Senst <martin.senst@xxxxxx> wrote:
> It actually works when the methods check_coordinates() and
> check_coordinates_internal() in file TriangularMatrix.h, lines 92, 104 and 109
> are declared as const.
>
> Cheers
> Martin
>
>
>
> Am Samstag 10 Juli 2010, 21:39:29 schrieb Martin Senst:
>> Hello,
>>
>> the following program, with Eigen3
>>
>> #include <Eigen/Eigen>
>>
>> int main()
>> {
>>   Eigen::MatrixXd X(2, 2);
>>   X.triangularView<Eigen::Upper>().coeff(0, 0);
>> }
>>
>>
>> results in the compiler error (sorry that it's in German)
>>
>>
>> In file included from ../eigen/Eigen/Core:278:0,
>>                  from ../eigen/Eigen/Dense:1,
>>                  from ../eigen/Eigen/Eigen:1,
>>                  from test.cpp:1:
>> ../eigen/Eigen/src/Core/TriangularMatrix.h: In Elementfunktion
>> »Eigen::TriangularView<MatrixType, Mode>::Scalar
>> Eigen::TriangularView<MatrixType,
>> Mode>::coeff(Eigen::TriangularView<MatrixType, Mode>::Index,
>> Eigen::TriangularView<MatrixType, Mode>::Index) const [with _MatrixType =
>> Eigen::Matrix<double, -0x00000000000000001, -0x00000000000000001>, unsigned
>> int _Mode = 2u, Eigen::TriangularView<MatrixType, Mode>::Scalar = double,
>> Eigen::TriangularView<MatrixType, Mode>::Index = long int]«:
>> test.cpp:6:46:   instantiated from here
>> ../eigen/Eigen/src/Core/TriangularMatrix.h:204:7: Fehler: Die Übergabe von
>> »const Eigen::TriangularView<Eigen::Matrix<double, -0x00000000000000001,
>> -0x00000000000000001>, 2u>« als »this«-Argument von »void
>> Eigen::TriangularBase<Derived>::check_coordinates_internal(Eigen::Triangula
>> rBase<Derived>::Index, Eigen::TriangularBase<Derived>::Index) [with Derived
>> =
>> Eigen::TriangularView<Eigen::Matrix<double, -0x00000000000000001,
>> -0x00000000000000001>, 2u>, Eigen::TriangularBase<Derived>::Index = long
>> int]« streicht Qualifizierer
>>
>>
>> Is this a bug? Since coeff() only reads from the triangular view, I think
>> the code above should be supported.
>>
>> Cheers
>> Martin
>
>
>
>



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