Re: [eigen] Patch for diagonal matrix output

[ Thread Index | Date Index | More Archives ]

It is on purpose that the toDenseMatrix() method here isn't called
eval(). Calling it eval() is a bit ambiguous in the case of e.g. an
expression "diagonal of a sum of two matrices".

I understand the motivation for your patch and I agree that it's a
good idea, but I think that we can fix this in a better way: instead
of writing it separately for DiagonalBase and then separately again
for all special matrix types, we should be able to do it once and for
all at the level of EigenBase. We must just make sure that all
EigenBase-derived types implement toDenseMatrix(). (If not, that's
something we should fix. For MatrixBase, toDenseMatrix should be a
synonym of eval() ).


2010/4/2 Manoj Rajagopalan <rmanoj@xxxxxxxxx>:
> Hi eigen users and developers,
>   I found I couldn't use the << operator to write a diagonal matrix to cout
> without having to convert to a dense matrix intermediate. So I wrote the
> attached patch. Please consider this for inclusion if it passes tests.
>   The patch was created against the default branch from the root of the
> working copy directory.
> Thanks,
> Manoj

Mail converted by MHonArc 2.6.19+