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*: Tim Hutt <tdhutt@xxxxxxxxx>*Date*: Wed, 24 Jun 2009 21:16:22 +0100*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 :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=qqA/556JQcEZT4XftgJ2BJkBymWwEnUD8M0o4HuzC1E=; b=cwRjCMY1KndAlPWhvLoGsJfFP3AERk8v5jhopGL/l6VI5f+6ce5ppGR0RiobxJJdTs d34XoGd6zgdwCHBYOmY3G1urlCOs9cFwqTIdQLt5xHriLriNlyjOS3xx6L2mpDNG2grO UeRZdrfAICSypSk4N4ctwvDnjEg8tuzPdnKF0=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=ExxTqBE1ps7Y0DE6uES9LNmihDY42N8NAixa5Z7O1jQJ+zjd9Ejp7H6DEH+o0su8UE gZyMoCovf69Oe3LrvVdRQf7EbFkdkQT0+LB2LnvHNqoyVHUsYgrHXPu3qtk/3rUr9OHp 0uOMqewT75fbF1UmxKB69OGIuI7Pjl7MCXZfY=

2009/6/24 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>: > 2009/6/24 Markus Benjamin Fröb <grey_earl@xxxxxx>: >>> Matrix<float,Dynamic,2> m; >>> m.resize(3); >>> >>> but then we also want this to work: >>> >>> Matrix<float,3,2> m; >>> m.resize(3); >> >> 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." > > Yes, that's what I meant, sorry if I was unclear, we were wondering if > A should be allowed and I said "if we want to allow A then we also > want to allow B", where B is impossible, conclusion: we can't allow A. I see what you mean. You're saying if you have code like this: Matrix<double, Dynamic, 3> m; // ... lots of code ... m.resize(10, 3); And then for some reason later you want to make m fully dynamic then you only have to change the declaration: Matrix<double, Dynamic, Dynamic> m; // ... lots of code ... m.resize(10, 3); // Still works. In which case the trade-off is: Pros: Constructor and resize are more logical, code is less redundant. The code shows that the matrix isn't fully dynamic (i.e. you might accidentally try m.resize(10, 4) in the code above. Cons: Have to change code if you change matrices from partially to fully dynamic. Tim

**Follow-Ups**:**Re: [eigen] How to resize a partially fixed matrix***From:*Benoit Jacob

**References**:**Re: [eigen] How to resize a partially fixed matrix***From:*Markus Fröb

**Re: [eigen] How to resize a partially fixed matrix***From:*Gael Guennebaud

**Re: [eigen] How to resize a partially fixed matrix***From:*Benoit Jacob

**Re: [eigen] How to resize a partially fixed matrix***From:*Markus Benjamin Fröb

**Re: [eigen] How to resize a partially fixed matrix***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] How to resize a partially fixed matrix** - Next by Date:
**Re: [eigen] How to resize a partially fixed matrix** - Previous by thread:
**Re: [eigen] How to resize a partially fixed matrix** - Next by thread:
**Re: [eigen] How to resize a partially fixed matrix**

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