diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-12-17 10:43:46 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-12-17 10:43:46 +0100 |
commit | 30d47860ddcc3974bbe8869f0a6ed31a670052b0 (patch) | |
tree | 3486bf01c28165e859fe2ee003f56417649f2c1c | |
parent | 34c95029cad15201efb161a59d72f36cbf997f16 (diff) |
more fixes
-rw-r--r-- | Eigen/src/Sparse/SparseLDLT.h | 2 | ||||
-rw-r--r-- | test/sparse_solvers.cpp | 8 | ||||
-rw-r--r-- | test/triangular.cpp | 4 | ||||
-rw-r--r-- | test/umeyama.cpp | 6 | ||||
-rw-r--r-- | test/vectorization_logic.cpp | 6 |
5 files changed, 13 insertions, 13 deletions
diff --git a/Eigen/src/Sparse/SparseLDLT.h b/Eigen/src/Sparse/SparseLDLT.h index ea5d345f5..a30bd5ccd 100644 --- a/Eigen/src/Sparse/SparseLDLT.h +++ b/Eigen/src/Sparse/SparseLDLT.h @@ -334,7 +334,7 @@ bool SparseLDLT<MatrixType, Backend>::solveInPlace(MatrixBase<Derived> &b) const if (m_matrix.nonZeros()>0) // otherwise L==I m_matrix.template triangularView<UnitLowerTriangular>().solveInPlace(b); - b = b.cwise() / m_diag; + b = b.cwiseQuotient(m_diag); // FIXME should be .adjoint() but it fails to compile... if (m_matrix.nonZeros()>0) // otherwise L==I diff --git a/test/sparse_solvers.cpp b/test/sparse_solvers.cpp index b88fa1cc9..059747c3d 100644 --- a/test/sparse_solvers.cpp +++ b/test/sparse_solvers.cpp @@ -75,13 +75,13 @@ template<typename Scalar> void sparse_solvers(int rows, int cols) // lower - transpose initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeLowerTriangular, &zeroCoords, &nonzeroCoords); - VERIFY_IS_APPROX(refMat2.template marked<LowerTriangular>().transpose().solveTriangular(vec2), - m2.template marked<LowerTriangular>().transpose().solveTriangular(vec3)); + VERIFY_IS_APPROX(refMat2.transpose().template triangularView<UpperTriangular>().solve(vec2), + m2.transpose().template triangularView<UpperTriangular>().solve(vec3)); // upper - transpose initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeUpperTriangular, &zeroCoords, &nonzeroCoords); - VERIFY_IS_APPROX(refMat2.template marked<UpperTriangular>().transpose().solveTriangular(vec2), - m2.template marked<UpperTriangular>().transpose().solveTriangular(vec3)); + VERIFY_IS_APPROX(refMat2.transpose().template triangularView<LowerTriangular>().solve(vec2), + m2.transpose().template triangularView<LowerTriangular>().solve(vec3)); SparseMatrix<Scalar> matB(rows, rows); DenseMatrix refMatB = DenseMatrix::Zero(rows, rows); diff --git a/test/triangular.cpp b/test/triangular.cpp index ee02c0022..2a583710d 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -109,13 +109,13 @@ template<typename MatrixType> void triangular(const MatrixType& m) // check M * inv(L) using in place API m4 = m3; m3.transpose().template triangularView<Eigen::UpperTriangular>().solveInPlace(trm4); - VERIFY(m4.cwise().abs().isIdentity(test_precision<RealScalar>())); + VERIFY(m4.cwiseAbs().isIdentity(test_precision<RealScalar>())); // check M * inv(U) using in place API m3 = m1.template triangularView<Eigen::UpperTriangular>(); m4 = m3; m3.transpose().template triangularView<Eigen::LowerTriangular>().solveInPlace(trm4); - VERIFY(m4.cwise().abs().isIdentity(test_precision<RealScalar>())); + VERIFY(m4.cwiseAbs().isIdentity(test_precision<RealScalar>())); // check solve with unit diagonal m3 = m1.template triangularView<Eigen::UnitUpperTriangular>(); diff --git a/test/umeyama.cpp b/test/umeyama.cpp index 09db27c1b..75dd64b5c 100644 --- a/test/umeyama.cpp +++ b/test/umeyama.cpp @@ -64,7 +64,7 @@ Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> randMatrixUnitary(int size) Q.col(col) = colVec.normalized(); } - // this additional orthogonalization is not necessary in theory but should enhance + // this additional orthogonalization is not necessary in theory but should enhance // the numerical orthogonality of the matrix for (int row = 0; row < size; ++row) { @@ -131,7 +131,7 @@ void run_test(int dim, int num_elements) MatrixX cR_t_umeyama = umeyama(src.block(0,0,dim,num_elements), dst.block(0,0,dim,num_elements)); - const Scalar error = ( cR_t_umeyama*src - dst ).cwise().square().sum(); + const Scalar error = ( cR_t_umeyama*src - dst ).array().square().sum(); VERIFY(error < Scalar(10)*std::numeric_limits<Scalar>::epsilon()); } @@ -167,7 +167,7 @@ void run_fixed_size_test(int num_elements) HomMatrix cR_t_umeyama = umeyama(src_block, dst_block); - const Scalar error = ( cR_t_umeyama*src - dst ).cwise().square().sum(); + const Scalar error = ( cR_t_umeyama*src - dst ).array().square().sum(); VERIFY(error < Scalar(10)*std::numeric_limits<Scalar>::epsilon()); } diff --git a/test/vectorization_logic.cpp b/test/vectorization_logic.cpp index 680adeb45..71214485c 100644 --- a/test/vectorization_logic.cpp +++ b/test/vectorization_logic.cpp @@ -48,7 +48,7 @@ void test_vectorization_logic() InnerVectorization,CompleteUnrolling)); VERIFY(test_assign(Vector4f(),Vector4f()+Vector4f(), InnerVectorization,CompleteUnrolling)); - VERIFY(test_assign(Vector4f(),Vector4f().cwise() * Vector4f(), + VERIFY(test_assign(Vector4f(),Vector4f().cwiseProduct(Vector4f()), InnerVectorization,CompleteUnrolling)); VERIFY(test_assign(Vector4f(),Vector4f().cast<float>(), InnerVectorization,CompleteUnrolling)); @@ -58,7 +58,7 @@ void test_vectorization_logic() InnerVectorization,CompleteUnrolling)); VERIFY(test_assign(Matrix4f(),Matrix4f()+Matrix4f(), InnerVectorization,CompleteUnrolling)); - VERIFY(test_assign(Matrix4f(),Matrix4f().cwise() * Matrix4f(), + VERIFY(test_assign(Matrix4f(),Matrix4f().cwiseProduct(Matrix4f()), InnerVectorization,CompleteUnrolling)); VERIFY(test_assign(Matrix<float,16,16>(),Matrix<float,16,16>()+Matrix<float,16,16>(), @@ -67,7 +67,7 @@ void test_vectorization_logic() VERIFY(test_assign(Matrix<float,16,16,DontAlign>(),Matrix<float,16,16>()+Matrix<float,16,16>(), NoVectorization,InnerUnrolling)); - VERIFY(test_assign(Matrix<float,6,2>(),Matrix<float,6,2>().cwise() / Matrix<float,6,2>(), + VERIFY(test_assign(Matrix<float,6,2>(),Matrix<float,6,2>().cwiseQuotient(Matrix<float,6,2>()), LinearVectorization,CompleteUnrolling)); VERIFY(test_assign(Matrix<float,17,17>(),Matrix<float,17,17>()+Matrix<float,17,17>(), |