Re: [eigen] triangular * scalar product?

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


Indeed, there is no such operator, but that's very easy to add. In the
meantime you can do:

m2 = (m1*3).triangularView<Eigen::Upper>();

that's equivalent, and this is how we would implement it.

gael

On Fri, Oct 28, 2011 at 6:21 PM, Jim Bosch <talljimbo@xxxxxxxxx> wrote:
> It looks like triangularView doesn't support multiplication by scalars
> (except in-place).  Is this just an oversight, or is there some reason
> implementation would be difficult?
>
> To be precise, the following does not compile:
>
> #include <Eigen/Core>
>
> int main() {
>    Eigen::MatrixXd m1(5, 5);
>    m1.setRandom();
>    Eigen::MatrixXd m2(5, 5);
>    m2 = m1.triangularView<Eigen::Upper>() * 3.0;
> }
>
> Thanks!
>
> Jim Bosch
>
>
>



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