Re: [eigen] discrepancy in (triangular view + transpose) and self-adjointness

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


Christoph Hertzberg wrote:
Manoj Rajagopalan wrote:
But, the following code produces a discrepancy:

    MatrixXi B(N,N);
    B.setRandom();
    C1 = A.selfadjointView<Lower>() * B;
    C2 = (A_l * B)   +   (A_zl.transpose() * B);
    assert(C1 == C2); // <--------  FALSE!

seems like A_zl.transpose() * B ignores the ZeroDiag flag.
replacing (A_zl.transpose() * B) by
(A_zl.transpose().toDenseMatrix() * B)
makes it working ...
I can't tell where exactly the error happens

damn, thats hard to debug.
It seems that the Problem is that in /Eigen/src/Core/products/TriangularMatrixMatrix.h:90

// implements col-major += alpha * op(triangular) * op(general)
template <typename Scalar, typename Index, int Mode,
          int LhsStorageOrder, bool ConjugateLhs,
          int RhsStorageOrder, bool ConjugateRhs>
struct ei_product_triangular_matrix_matrix<Scalar,Index,Mode,true,
                                           LhsStorageOrder,ConjugateLhs,
                                           RhsStorageOrder,ConjugateRhs,ColMajor>;

does check for UnitDiag, but never checks for ZeroDiag.

Can't help with fixing, though ...


--
----------------------------------------------
Dipl.-Inf. Christoph Hertzberg
Cartesium 0.051
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: (+49) 421-218-64252
----------------------------------------------



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