diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2011-01-27 12:04:26 -0500 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2011-01-27 12:04:26 -0500 |
commit | b2b8c6a89ca051e87b0e6da3c685f68f617662d2 (patch) | |
tree | 0864c591b0c3fc8d09d2ddbda62b80e9616fbf79 /test/eigen2 | |
parent | e761ba68f7828cef0cb647b959a0ef9f80f00fb3 (diff) |
dot() now always uses eigen3 convention, even in eigen2 support mode, even stage 10. Didn't have a choice as lots of eigen code is using it.
Diffstat (limited to 'test/eigen2')
-rw-r--r-- | test/eigen2/eigen2_adjoint.cpp | 12 | ||||
-rw-r--r-- | test/eigen2/eigen2_geometry.cpp | 8 | ||||
-rw-r--r-- | test/eigen2/eigen2_hyperplane.cpp | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_mixingtypes.cpp | 6 | ||||
-rw-r--r-- | test/eigen2/eigen2_sparse_basic.cpp | 2 | ||||
-rw-r--r-- | test/eigen2/eigen2_sparse_vector.cpp | 4 | ||||
-rw-r--r-- | test/eigen2/eigen2_submatrices.cpp | 6 |
7 files changed, 20 insertions, 20 deletions
diff --git a/test/eigen2/eigen2_adjoint.cpp b/test/eigen2/eigen2_adjoint.cpp index c090b9650..7828b7efa 100644 --- a/test/eigen2/eigen2_adjoint.cpp +++ b/test/eigen2/eigen2_adjoint.cpp @@ -65,18 +65,18 @@ template<typename MatrixType> void adjoint(const MatrixType& m) // check basic properties of dot, norm, norm2 typedef typename NumTraits<Scalar>::Real RealScalar; - VERIFY(ei_isApprox((s1 * v1 + s2 * v2).dot(v3), s1 * v1.dot(v3) + s2 * v2.dot(v3), largerEps)); - VERIFY(ei_isApprox(v3.dot(s1 * v1 + s2 * v2), ei_conj(s1)*v3.dot(v1)+ei_conj(s2)*v3.dot(v2), largerEps)); - VERIFY_IS_APPROX(ei_conj(v1.dot(v2)), v2.dot(v1)); - VERIFY_IS_APPROX(ei_abs(v1.dot(v1)), v1.squaredNorm()); + VERIFY(ei_isApprox((s1 * v1 + s2 * v2).eigen2_dot(v3), s1 * v1.eigen2_dot(v3) + s2 * v2.eigen2_dot(v3), largerEps)); + VERIFY(ei_isApprox(v3.eigen2_dot(s1 * v1 + s2 * v2), ei_conj(s1)*v3.eigen2_dot(v1)+ei_conj(s2)*v3.eigen2_dot(v2), largerEps)); + VERIFY_IS_APPROX(ei_conj(v1.eigen2_dot(v2)), v2.eigen2_dot(v1)); + VERIFY_IS_APPROX(ei_abs(v1.eigen2_dot(v1)), v1.squaredNorm()); if(NumTraits<Scalar>::HasFloatingPoint) VERIFY_IS_APPROX(v1.squaredNorm(), v1.norm() * v1.norm()); - VERIFY_IS_MUCH_SMALLER_THAN(ei_abs(vzero.dot(v1)), static_cast<RealScalar>(1)); + VERIFY_IS_MUCH_SMALLER_THAN(ei_abs(vzero.eigen2_dot(v1)), static_cast<RealScalar>(1)); if(NumTraits<Scalar>::HasFloatingPoint) VERIFY_IS_MUCH_SMALLER_THAN(vzero.norm(), static_cast<RealScalar>(1)); // check compatibility of dot and adjoint - VERIFY(ei_isApprox(v1.dot(square * v2), (square.adjoint() * v1).dot(v2), largerEps)); + VERIFY(ei_isApprox(v1.eigen2_dot(square * v2), (square.adjoint() * v1).eigen2_dot(v2), largerEps)); // like in testBasicStuff, test operator() to check const-qualification int r = ei_random<int>(0, rows-1), diff --git a/test/eigen2/eigen2_geometry.cpp b/test/eigen2/eigen2_geometry.cpp index cec413a9b..8b9ffd186 100644 --- a/test/eigen2/eigen2_geometry.cpp +++ b/test/eigen2/eigen2_geometry.cpp @@ -61,7 +61,7 @@ template<typename Scalar> void geometry(void) Scalar a = ei_random<Scalar>(-Scalar(M_PI), Scalar(M_PI)); // cross product - VERIFY_IS_MUCH_SMALLER_THAN(v1.cross(v2).dot(v1), Scalar(1)); + VERIFY_IS_MUCH_SMALLER_THAN(v1.cross(v2).eigen2_dot(v1), Scalar(1)); Matrix3 m; m << v0.normalized(), (v0.cross(v1)).normalized(), @@ -76,15 +76,15 @@ template<typename Scalar> void geometry(void) VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs()); // unitOrthogonal - VERIFY_IS_MUCH_SMALLER_THAN(u0.unitOrthogonal().dot(u0), Scalar(1)); - VERIFY_IS_MUCH_SMALLER_THAN(v0.unitOrthogonal().dot(v0), Scalar(1)); + VERIFY_IS_MUCH_SMALLER_THAN(u0.unitOrthogonal().eigen2_dot(u0), Scalar(1)); + VERIFY_IS_MUCH_SMALLER_THAN(v0.unitOrthogonal().eigen2_dot(v0), Scalar(1)); VERIFY_IS_APPROX(u0.unitOrthogonal().norm(), Scalar(1)); VERIFY_IS_APPROX(v0.unitOrthogonal().norm(), Scalar(1)); VERIFY_IS_APPROX(v0, AngleAxisx(a, v0.normalized()) * v0); VERIFY_IS_APPROX(-v0, AngleAxisx(Scalar(M_PI), v0.unitOrthogonal()) * v0); - VERIFY_IS_APPROX(ei_cos(a)*v0.squaredNorm(), v0.dot(AngleAxisx(a, v0.unitOrthogonal()) * v0)); + VERIFY_IS_APPROX(ei_cos(a)*v0.squaredNorm(), v0.eigen2_dot(AngleAxisx(a, v0.unitOrthogonal()) * v0)); m = AngleAxisx(a, v0.normalized()).toRotationMatrix().adjoint(); VERIFY_IS_APPROX(Matrix3::Identity(), m * AngleAxisx(a, v0.normalized())); VERIFY_IS_APPROX(Matrix3::Identity(), AngleAxisx(a, v0.normalized()) * m); diff --git a/test/eigen2/eigen2_hyperplane.cpp b/test/eigen2/eigen2_hyperplane.cpp index de6265ec0..63febc557 100644 --- a/test/eigen2/eigen2_hyperplane.cpp +++ b/test/eigen2/eigen2_hyperplane.cpp @@ -54,7 +54,7 @@ template<typename HyperplaneType> void hyperplane(const HyperplaneType& _plane) Scalar s0 = ei_random<Scalar>(); Scalar s1 = ei_random<Scalar>(); - VERIFY_IS_APPROX( n1.dot(n1), Scalar(1) ); + VERIFY_IS_APPROX( n1.eigen2_dot(n1), Scalar(1) ); VERIFY_IS_MUCH_SMALLER_THAN( pl0.absDistance(p0), Scalar(1) ); VERIFY_IS_APPROX( pl1.signedDistance(p1 + n1 * s0), s0 ); diff --git a/test/eigen2/eigen2_mixingtypes.cpp b/test/eigen2/eigen2_mixingtypes.cpp index 3721a0047..1349cb67c 100644 --- a/test/eigen2/eigen2_mixingtypes.cpp +++ b/test/eigen2/eigen2_mixingtypes.cpp @@ -74,9 +74,9 @@ template<int SizeAtCompileType> void mixingtypes(int size = SizeAtCompileType) VERIFY_RAISES_ASSERT(mcf*vcd); VERIFY_RAISES_ASSERT(vcf = mf*vf); - vf.dot(vf); - VERIFY_RAISES_ASSERT(vd.dot(vf)); - VERIFY_RAISES_ASSERT(vcf.dot(vf)); // yeah eventually we should allow this but i'm too lazy to make that change now in Dot.h + vf.eigen2_dot(vf); + VERIFY_RAISES_ASSERT(vd.eigen2_dot(vf)); + VERIFY_RAISES_ASSERT(vcf.eigen2_dot(vf)); // yeah eventually we should allow this but i'm too lazy to make that change now in Dot.h } // especially as that might be rewritten as cwise product .sum() which would make that automatic. void test_eigen2_mixingtypes() diff --git a/test/eigen2/eigen2_sparse_basic.cpp b/test/eigen2/eigen2_sparse_basic.cpp index 4e9f8e9f2..d9acbc8d6 100644 --- a/test/eigen2/eigen2_sparse_basic.cpp +++ b/test/eigen2/eigen2_sparse_basic.cpp @@ -238,7 +238,7 @@ template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& re VERIFY_IS_APPROX(m1+=m2, refM1+=refM2); VERIFY_IS_APPROX(m1-=m2, refM1-=refM2); - VERIFY_IS_APPROX(m1.col(0).dot(refM2.row(0)), refM1.col(0).dot(refM2.row(0))); + VERIFY_IS_APPROX(m1.col(0).eigen2_dot(refM2.row(0)), refM1.col(0).eigen2_dot(refM2.row(0))); refM4.setRandom(); // sparse cwise* dense diff --git a/test/eigen2/eigen2_sparse_vector.cpp b/test/eigen2/eigen2_sparse_vector.cpp index 3289cbd20..2047c3f76 100644 --- a/test/eigen2/eigen2_sparse_vector.cpp +++ b/test/eigen2/eigen2_sparse_vector.cpp @@ -83,8 +83,8 @@ template<typename Scalar> void sparse_vector(int rows, int cols) VERIFY_IS_APPROX(v1+=v2, refV1+=refV2); VERIFY_IS_APPROX(v1-=v2, refV1-=refV2); - VERIFY_IS_APPROX(v1.dot(v2), refV1.dot(refV2)); - VERIFY_IS_APPROX(v1.dot(refV2), refV1.dot(refV2)); + VERIFY_IS_APPROX(v1.eigen2_dot(v2), refV1.eigen2_dot(refV2)); + VERIFY_IS_APPROX(v1.eigen2_dot(refV2), refV1.eigen2_dot(refV2)); } diff --git a/test/eigen2/eigen2_submatrices.cpp b/test/eigen2/eigen2_submatrices.cpp index 37a084286..a86c71358 100644 --- a/test/eigen2/eigen2_submatrices.cpp +++ b/test/eigen2/eigen2_submatrices.cpp @@ -86,7 +86,7 @@ template<typename MatrixType> void submatrices(const MatrixType& m) //check row() and col() VERIFY_IS_APPROX(m1.col(c1).transpose(), m1.transpose().row(c1)); - VERIFY_IS_APPROX(square.row(r1).dot(m1.col(c1)), (square.lazy() * m1.conjugate())(r1,c1)); + VERIFY_IS_APPROX(square.row(r1).eigen2_dot(m1.col(c1)), (square.lazy() * m1.conjugate())(r1,c1)); //check operator(), both constant and non-constant, on row() and col() m1.row(r1) += s1 * m1.row(r2); m1.col(c1) += s1 * m1.col(c2); @@ -146,8 +146,8 @@ template<typename MatrixType> void submatrices(const MatrixType& m) VERIFY(ei_real(ones.col(c1).sum()) == RealScalar(rows)); VERIFY(ei_real(ones.row(r1).sum()) == RealScalar(cols)); - VERIFY(ei_real(ones.col(c1).dot(ones.col(c2))) == RealScalar(rows)); - VERIFY(ei_real(ones.row(r1).dot(ones.row(r2))) == RealScalar(cols)); + VERIFY(ei_real(ones.col(c1).eigen2_dot(ones.col(c2))) == RealScalar(rows)); + VERIFY(ei_real(ones.row(r1).eigen2_dot(ones.row(r2))) == RealScalar(cols)); } void test_eigen2_submatrices() |