|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: Thu, 25 Jun 2009 00:49:42 +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=Tn8kfDGPjb4g61/FljialCaFqEM2XYiCffPGiXTwZac=; b=F0+9/h1NjqWWzXaa6hZhwtGYE2kf4Ut7jHU6PN1AABQhWQteBD/8GNu1wK69lMWvno mA0zmCZYIRXnIWD+FjMs4n2CAJ46sVwSRGzrcFb+e6FO1i++4t2ymt2C2e3XzAZLX4Fx ibMu4niI8agqU0kw5LcBCokkwDgkhHwG4orck=
- 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=fbNtOu5Vajfdwbju08hZ85DvB+D1hbmxe/QoKEmLH/hVkaCMxhA+yXekeSct06OZu2 m80GJvYzCJr+lyEQB7Rguf1Xsg4ekN0472dYvgLVTtVHtURWVkeih5uTBzHk11zIdNDu APigq2pDw2TiTPZtHxhyJyyWc6AK96jKQhT3E=
2009/6/24 Markus <grey_earl@xxxxxx>:
> 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);
> Does this also work for fully dynamic matrices now?
> So if I have
> Matrix<double, Dynamic, Dynamic> mat;
> mat.resize(NoChange, 5);
> does this work? If yes, everything fine with me.
Yes, this works. note that resize(NoChange,int) is very very trivial:
code from Matrix.h:
inline void resize(NoChange_t, int cols)