Re: [eigen] Defining a custom procedurally defined matrix type (circular rotation of an existing matrix) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Defining a custom procedurally defined matrix type (circular rotation of an existing matrix)
- From: Jitse Niesen <jitseniesen@xxxxxxxxx>
- Date: Tue, 27 May 2014 09:54:03 +0100 (BST)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1401180838; bh=a5JOFAfv7Vs2rQg/8+K3HNt2Kn7r7hqFtaYF2t587ak=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Date:From:X-X-Sender:To:Subject:In-Reply-To:Message-ID:References:User-Agent:MIME-Version:Content-Type; b=guGmdLGhvNBlrRWdnAbE2TKWNNQHKGTdvah039SvLo4iXUZfQDT1D9cwR/BawxyCI5mjShy4hyFwX/d2B97bBomEheZ0v7tqQ8sEM5jywKIwRZ1FT6BGc8uicYP+aC07fXDh7UGXoUqRDhTyq0yTarKB6q0HIggQVlya/b9SM7k=
On Mon, 26 May 2014, Wenzel Jakob wrote:
I'm wondering if it is possible to define a custom new matrix type in Eigen
that is evaluated procedurally (i.e. not directly backed by an array)?
In particular I'm looking to define a new matrix type that's defined as the
circular shift (in rows and columns) of another (dense) matrix. This means
that an access to coeff() entails two modulo operations before evaluating the
original matrix.
If there is some existing example of such an a procedurally defined matrix,
it would be great if you could point me to it.
Yes, this is possible. I think the .reverse() method is a good example for
this; see the file Reverse.h and the documentation at
http://eigen.tuxfamily.org/dox-devel/classEigen_1_1DenseBase.html#a6e354bb81f0c7b6888c6a0ce4b4649e2
I should warn you however that this does require an understanding of the
internals of Eigen which are not documented as well as I would like. We
are working on a rewrite which will hopefully help with this issue (the
so-called evaluators, see http://eigen.tuxfamily.org/bz/show_bug.cgi?id=99 ).
Jitse