Re: [eigen] .matrix()/.array() on MatrixBase<Derived>/ArrayBased<Derived>

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


That sounds very reasonable and useful.
Just like we implement Matrix::eval() returning just a reference to *this.

Benoit

2010/1/21 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> Hi,
>
> any objections against these null cost functions:
>
> MatrixBase:
>    MatrixBase<Derived>& matrix() { return *this; }
>    const MatrixBase<Derived>& matrix() const { return *this; }
>
> and the corresponding array() ones for ArrayBase.
>
> When writing functions taking DenseBase<Derived> or any functions that
> will take Array as well as Matrix, this is quite handy. You don't know
> whether you need to convert or not, so you just do it when you want
> array or matrix ops respectively.
>
> - Hauke
>
>
>



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