[eigen] API addition: resizeLike(const Mat & other); |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] API addition: resizeLike(const Mat & other);
- From: Keir Mierle <mierle@xxxxxxxxx>
- Date: Sun, 1 Feb 2009 16:18:10 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=m5oK5tIl+aFOds2KMztB8ON/6S4vTQpBlLSf6WG2Fvk=; b=rJKexJTYTcXlDSmaRRW3LpZkjAYChzo7XiQXmHj+OScdmCIDmP4EdDnb/tRAdJX0FR HunOdlrYB87f7dmf1C9RFQEnK8oLo5KxvgIrGTIodNvLVtTS5ADEjMQzRRewfZOTUYFJ ZT8+h8X0sxiMsJTS7kqq2N9SvIi619lMJyPBc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=mGd5RWiV+O1xErh+3qGvLXJeE9lbSMkM9O79uSmv9eNXU9GcQxg50tXO7lArWyN6Oi 6nZDChyo8EViToI6Dl01HLsNZ3mUF4dk64PFM3dssCOK1u631PbUi/VEOMLjHD73RFik Zhbz8qNYoASk2s11gJnEG8oJCnsSlmpkTnSt0=
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.
Keir