Re: [eigen] still the solve() API debate

[ Thread Index | Date Index | More Archives ]

2009/9/11 Robert Bocquier <robert.bocquier@xxxxxxxxxxx>:
> Well, I don't fully understand this thread, so may be I will say something
> stupid, but I found these "asymmetric" writing of swap pretty unreadable.

Nevermind, we're not going to use them anyway :)

> Why is this impossible ?
> Eigen::swap(matrix.row(i), matrix.row(j));

Same reason as above: one can't pass matrix.row(i) as non-constant
reference (because it is a temporary) so one must pass it as constant
reference, and then constness can't be honored. So this is possible
but has the same drawback as the current implementation, actually it's
a bit worse even because it forgets constness of both sides instead of
just the right-hand side.

Actually my first proposal,
matrix.row(i) = Eigen::swap(matrix.row(j));

doesn't work either.

So my only potential proposal was:
matrix.row(i) = matrix.row(j).swap();

and you're already 2 persons to reject it, so let's forget about it :)


Mail converted by MHonArc 2.6.19+