|Re: [eigen] How to resize a partially fixed matrix|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] How to resize a partially fixed matrix
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 24 Jun 2009 22:14:24 +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=vx46+OwI0uC+S5vCZyCyHtqdz1QtMmqeskViROcerDw=; b=OBUlTr6tcrUssJEEj+lT98cjxzeMwTymhiH6J0jg43Ktgo+JPVd0ZxjPRzWDi8zY8e hOElJ6UpTeoKjA3J8drJZiXVfcbAE17QIZOAVOqNi+q3KZEsgVWvuE9N2KHUoxrAfkZv 8nPrxab29h+SSsbc09/W52zGf9spnDeMVh5hc=
- 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=PQwmlZpJmrTmwa3NYuruwLM8uL8EDKdIiMht33Q8ObjIJGrHfSnCePdoVvCo/AgxIG 3Mdzr3fgdcHeDayJKwuw8HMp124WSeb/bamZmhFdtV57c8pIR2NNfz9MAEwhj3E+h+eM oS/8c/WYd4MCkXHsNUPlYQdm03pBcOhvsXRDA=
First of all the variant proposed:
>> So I'm strongly for your code change, but changing the assertion to
doesn't make me comfortable, again because a method that works for
(partially)dynamic matrices should also work on fixed-size matrices of
the same size, I am very reluctant here.
So here's what I did (changeset b030f9866bae):
* add resize(int, NoChange) and resize(NoChange, int)
* add missing assert in resize(int)
* add examples for all resize variants
* expand docs (part of which is from Tim Hutt's e-mail)
Now if you want we can add another name (or completely rename) the new
resize(int, NoChange) and resize(NoChange, int).
But perhaps it's good enough like this? i don't have a strong opinion.
resizeHoriz(size) and colwise().resize(size) look nice but they aren't
much shorter to type than resize(NoChange,size);
2009/6/24 Tim Hutt <tdhutt@xxxxxxxxx>:
> 2009/6/24 Markus Benjamin Fröb <grey_earl@xxxxxx>:
>> I don't see why the second case should work, since a) it's ambigous what the
>> user wanted and b) in the documentation it says explicitly "Of course, fixed-
>> size matrices can't be resized."
> I agree.