mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-10 23:21:29 +08:00
Update geo_homogeneous
test, add eval() to PermutationMatrix.
This commit is contained in:
parent
5c1029be1a
commit
4916887f2c
@ -109,6 +109,9 @@ class PermutationBase : public EigenBase<Derived> {
|
||||
*/
|
||||
DenseMatrixType toDenseMatrix() const { return derived(); }
|
||||
|
||||
/** \returns the plain matrix representation of the permutation. */
|
||||
DenseMatrixType eval() const { return toDenseMatrix(); }
|
||||
|
||||
/** const version of indices(). */
|
||||
const IndicesType& indices() const { return derived().indices(); }
|
||||
/** \returns a reference to the stored array representing the permutation. */
|
||||
|
@ -127,8 +127,8 @@ void homogeneous(void) {
|
||||
|
||||
{
|
||||
const Eigen::PermutationMatrix<Size> P{Eigen::Vector<int, Size>::EqualSpaced(0, 1)};
|
||||
const auto right = Eigen::Vector<Scalar, Size - 1>::Random().homogeneous();
|
||||
const auto left = Eigen::RowVector<Scalar, Size - 1>::Random().homogeneous();
|
||||
const auto right = Eigen::Vector<Scalar, Size - 1>::Random().eval().homogeneous();
|
||||
const auto left = Eigen::RowVector<Scalar, Size - 1>::Random().eval().homogeneous();
|
||||
|
||||
VERIFY_IS_APPROX(P * right, P * right.eval());
|
||||
VERIFY_IS_APPROX(left * P, left.eval() * P);
|
||||
|
Loading…
x
Reference in New Issue
Block a user