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: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 25 Jun 2009 00:52:06 +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=zpj/hEjxH2RP+5uNp6sRm+ngba6yAPdQHKrUiA3kTEk=; b=JTKdHdgbeGx17HrjD8ldC3YCFLRHWMv0+yOxvbFqQTeppDWZe/3Zhlp8QYuaN67otB Zk8S+GXwCLq3ihAN9L8N8hvspZP7Gm4AgxYlvUjKaaJPwDCRbHcufxzILEPnf83oNBdT sFJv7T3y5G23LQdTswX57HpHrAwX9tvh8wP7E=
- 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=qKPxHaW5eaQueQ/YSYLq3chhGWMzCptn9AT8CuWAimJYAQt+BNamaHQ7XaHobw9No/ NfloIVNYAGtSdvO9L3vuXYhyvLMR9YE8T1UAE7zD1Al9UGGZdSp27fEUGduJ1VH3suh7 ipXeU7I2Tqb/Httgzj4+oaGnCkFTPW1bC0Y5g=
2009/6/24 Patrick Mihelich <patrick.mihelich@xxxxxxxxx>:
> I like the NoChange API, but I get a little leery seeing overloads
> disambiguated on integral types (even though it seems OK here). A safe
> approach in general is to use a statically initialized tag object, that is
> change
>
> enum NoChange_t { NoChange };
>
> to
>
> struct NoChange_t {} NoChange = {};
Hehe, that's why I initially proposed an approach with a struct
NoChange... but I retracted it because I was afraid of "multiply
defined object" issues as this is in a header file. I'll be honest: I
didn't know about the C++ syntax that you propose here. Do you confirm
it's standard c++98, and takes care of the "multiply defined object"
issue? If yes i'm all for your solution.
Cheers,
Benoit
>
> Cheers,
> Patrick
>
> On Wed, Jun 24, 2009 at 1:37 PM, Markus <grey_earl@xxxxxx> wrote:
>>
>> Am Mittwoch, 24. Juni 2009 schrieb Benoit Jacob:
>> > First of all the variant proposed:
>> > >> So I'm strongly for your code change, but changing the assertion to
>> > >> EIGEN_STATIC_ASSERT_EXACTLY_ONE_DYNAMIC_DIM(Matrix)
>> >
>> > 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);
>> >
>> > Cheers,
>> > Benoit
>> >
>>
>> Does this also work for fully dynamic matrices now?
>>
>> So if I have
>>
>> Matrix<double, Dynamic, Dynamic> mat;
>> mat.resize(3,3);
>> mat.resize(NoChange, 5);
>>
>> does this work? If yes, everything fine with me.
>>
>> Markus
>>
>>
>
>