Re: [eigen] API addition: resizeLike(const Mat & other);

[ Thread Index | Date Index | More Archives ]

2009/2/2 Keir Mierle <mierle@xxxxxxxxx>:
> I propose adding .resizeLike(const mat &other) which resizes *this to
> be the same size as other. I find this is something I do fairly often,
> and there is precedent in numpy (empty_like(), zeros_like,
> ones_like()).
> Any objections? If not, I'll send a patch.
> Alternately: we could overload .resize() to take a matrix argument.
> That may be misleading; I could be convinced either way.

+1 to the idea, and I also don't know what I prefer.

In either case, please take care of the vector case as we already do
in resize(int).

Actually you could leverage what we already do in resize(int):
    resize(other.rows(), other.cols());


Mail converted by MHonArc 2.6.19+