Re: [eigen] How to resize a partially fixed matrix |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] How to resize a partially fixed matrix
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 24 Jun 2009 11:52:39 +0200
- 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=rGn72oLzS6ZChdrf1ZChsm4wd7z+P04fCrMBBuKq5mI=; b=xX6Fvlldvcp2hPcQ451uIXApC2NBBaaxgE/T/Ut/w0c+cPeCB+lXMI6hWxHvQpIYQ6 zr4fT3FLUAYndvT5YL4W3sN9y9P0Wo1PxvBvdL9GexLo6DQsozc+TOfvt7xlbA/V1R8V JTHOZeZ2K7RI/KSevdKUJNkmMcSjBBkl83sJk=
- 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=gBMoc0vFvaCKbehydpRxZQdlNwwv7g9L3+dTp1Jj678G5Mizx74j6dl84/RiYZbpW3 ofzqm/OvgosXSyj8T375dU7dd7DfwWmcOm/LzHV8ednCIgi2Nt05h3IvPvQWnq2aa/EH BwrahGyCM3rlXuMknVZ/srcZUE4Cvg2Y2sOnA=
On Wed, Jun 24, 2009 at 10:37 AM, Helmut
Jarausch<jarausch@xxxxxxxxxxxxxxxxxxx> wrote:
> Hi,
>
> I wonder how I can resize a matrix where one of the dimension is fixed,
> like
>
> Matrix<double,4,Eigen::Dynamic> MS_BC;
>
> ....
>
> MS_BC.resize(5); // this fails
yes it fails because resize(int size) is for vector only.
> but this works
> MS_BC.resize(4,5);
> but it's not logical?
well that depends. First of all it is very clear that
MS_BC.resize(4,5) *must* work. Now about allowing resize(int size) to
work on such matrices why not. I guess that the main use case for such
matrices is to use a Matrix to store a collection of small vectors,
and so the matrix can be seen as a std::vector, and so having
resize(int size) working makes sense. On the other hand, in that case
the parameter "size" will mean either the number of rows or the number
of cols depending on the context that is not very nice. So there are
pro and cons, but eventually I'm 51% ok to extend resize to partially
dynamic matrices. or, we add an explicit partial_resize(int size)
function ?
gael.
> Helmut.
>
> --
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> RWTH - Aachen University
> D 52056 Aachen, Germany
>
>
>