[eigen] Transform products |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Transform products
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 19 Feb 2009 13:04:53 +0100
- 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=exwFJHFNV0sBK8Hg9TizgkPSee+fGpcsk0fF0WjmsDs=; b=U3+Ge5lAglUwvpBE+cH3iBb89JhpF15NN2kylRz+bw2UlsYyB4/5dlI4frz7ncN15G CYWK+tcoVrmuTFpw3dehN9gxZXWsV8ZLHqvbiryp+TmeG/wcwoO3N4+gb1Jvd0c0egy1 4IzocmT8T9J5tG0x6LVObn/f/A82NOcMSevo4=
- 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=uWbQUQ6QjNG3YL428Vrlcyd9FmikXLIktget/bQBTKIicqk3+Nh/q68nO++KZnTCD3 2GFHOltBARiuPMrii7wJeSkrcbOZKaQb4iP99j1MKe6h11qvKhx+lXXJOCGjL6aq0Zy7 Mwrca3qzvNv5lNp8PS0riF3Zx+/i7bQBzCvgw=
Hi list,
there still remains a few issues with the product: Transform * matrix_expression
Let d be the dimension of the ambient space (so that the Transform
object actually correspond to a d+1 x d+1 matrix). Currently we allow:
1 - Transform * [d x d] => Transform
2 - Transform * [d+1 x d+1] => trivial product expression
3 - Transform * [d+1 x 1] => trivial product expression
4 - Transform * [d x 1] => complex [d x 1] expression including the
homogeneous normalization
Issues:
a) the 4-th case is not plenty satisfactory:
a1 - should it returns an homogeneous vector ?
a2 - or automatically does the normalization as it currently does ?
a3 - or should we offer a way to skip the normalization assuming the
transformation is affine (last row = [0 ... 0 1]) ?
Well, these questions are more complementary and I guess the answer is
yes for all, the problem is rather how to expose all these variants ?
a proposal:
for a3 let's add "t.affine() * v" where affine() would return a
kind of [d x d+1] proxy with overloaded operator *.
for a1 and a2, two options:
p1) keep the default as it because it is safe
and for a1... well I don't know, anyway the user can still
build and homogeneous one for the rhs.
p2) let's return a "homogeneous" object which would
automatically be converted to a [d x 1] vector if needed
(ideally would have to be done in MatrixBase)
b) second issue: We want to be able to perform a batch transformation
of a set of N vectors. Again two cases:
b1 - Transform * [d+1 x N] => this is trivial, we just have to merge
the above cases 1 and 2 into a more generic one. DONE
b2 - Transform * [d x N] => same issues than the ones discussed
above excepted that the involved expressions are much more complicated
! For instance the affine case would be:
t.matrix().linear() * [d x N] + t.matrix().translation() *
Matrix<Scalar,d,N>::Ones(N);
This last example also shows that maybe it would be useful to have a
"replicate" expression mapping a vector to a matrix with constant rows
or constant columns ? This would be simpler than using a matrix
product for that.
And of course all the above discussion also holds for the transpose
cases, i.e., matrix_expression * Transform.
opinion, idea ?
thanks,
Gael.