Re: [eigen] How to resize a partially fixed matrix

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


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 = {};

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





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