Re: [eigen] .matrix()/.array() on MatrixBase<Derived>/ArrayBased<Derived> |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] .matrix()/.array() on MatrixBase<Derived>/ArrayBased<Derived>
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 21 Jan 2010 11:49:41 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=u3s90faIm75nj/qaRjaXM6/GRs0o6jJJsKFr5SIPaHg=; b=B7pfSUR5xcYzCANzaxP7jMzqE0By0t7V8C2AM7smYTtsEfio0pEJfE4yy/DfHxv/52 bTvRKqtkILeqLk5+YKMtJeE+5jsrBYqPovvJjQaeT3ZTUKAEd880NUuJ4xZnfkoheDRM Qb9cmo42F1uYKcxMoyoZFcjPkKxcNtnwCnITA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WzSp/GiDbtX5Tul/bYCkVFuVXBR81mlhaZRMEMK8AqG4hpxSIIigokyEvNpXkgI1Yz oyyHNNZxVIEPr8xXxpP12zmJqvJulNcn3MR+hp40HXR6mD8/ZvPH2aOdN5EvW/OC8A8B FiWb2QFkTLSkQwKrv6MDW/3RNgB5qdIYeUzm0=
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
>
>
>