diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-09-18 15:15:27 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-09-18 15:15:27 +0200 |
commit | 0ca43f7e9a654e32da0066163a8656415961e266 (patch) | |
tree | ed0da1fda3880f825eb8e9715546568deeee667f /Eigen/src/SparseCore/TriangularSolver.h | |
parent | 8b3be4907da2cbf47ec15734b7f364e6e66bf4c3 (diff) |
Remove deprecated code not used by evaluators
Diffstat (limited to 'Eigen/src/SparseCore/TriangularSolver.h')
-rw-r--r-- | Eigen/src/SparseCore/TriangularSolver.h | 156 |
1 files changed, 0 insertions, 156 deletions
diff --git a/Eigen/src/SparseCore/TriangularSolver.h b/Eigen/src/SparseCore/TriangularSolver.h index 012a1bb75..98062e9c6 100644 --- a/Eigen/src/SparseCore/TriangularSolver.h +++ b/Eigen/src/SparseCore/TriangularSolver.h @@ -23,149 +23,6 @@ template<typename Lhs, typename Rhs, int Mode, int StorageOrder = int(traits<Lhs>::Flags) & RowMajorBit> struct sparse_solve_triangular_selector; -#ifndef EIGEN_TEST_EVALUATORS -// forward substitution, row-major -template<typename Lhs, typename Rhs, int Mode> -struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Lower,RowMajor> -{ - typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; - static void run(const Lhs& lhs, Rhs& other) - { - for(Index col=0 ; col<other.cols() ; ++col) - { - for(Index i=0; i<lhs.rows(); ++i) - { - Scalar tmp = other.coeff(i,col); - Scalar lastVal(0); - Index lastIndex = 0; - for(typename Lhs::InnerIterator it(lhs, i); it; ++it) - { - lastVal = it.value(); - lastIndex = it.index(); - if(lastIndex==i) - break; - tmp -= lastVal * other.coeff(lastIndex,col); - } - if (Mode & UnitDiag) - other.coeffRef(i,col) = tmp; - else - { - eigen_assert(lastIndex==i); - other.coeffRef(i,col) = tmp/lastVal; - } - } - } - } -}; - -// backward substitution, row-major -template<typename Lhs, typename Rhs, int Mode> -struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Upper,RowMajor> -{ - typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; - static void run(const Lhs& lhs, Rhs& other) - { - for(Index col=0 ; col<other.cols() ; ++col) - { - for(Index i=lhs.rows()-1 ; i>=0 ; --i) - { - Scalar tmp = other.coeff(i,col); - Scalar l_ii = 0; - typename Lhs::InnerIterator it(lhs, i); - while(it && it.index()<i) - ++it; - if(!(Mode & UnitDiag)) - { - eigen_assert(it && it.index()==i); - l_ii = it.value(); - ++it; - } - else if (it && it.index() == i) - ++it; - for(; it; ++it) - { - tmp -= it.value() * other.coeff(it.index(),col); - } - - if (Mode & UnitDiag) - other.coeffRef(i,col) = tmp; - else - other.coeffRef(i,col) = tmp/l_ii; - } - } - } -}; - -// forward substitution, col-major -template<typename Lhs, typename Rhs, int Mode> -struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Lower,ColMajor> -{ - typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; - static void run(const Lhs& lhs, Rhs& other) - { - for(Index col=0 ; col<other.cols() ; ++col) - { - for(Index i=0; i<lhs.cols(); ++i) - { - Scalar& tmp = other.coeffRef(i,col); - if (tmp!=Scalar(0)) // optimization when other is actually sparse - { - typename Lhs::InnerIterator it(lhs, i); - while(it && it.index()<i) - ++it; - if(!(Mode & UnitDiag)) - { - eigen_assert(it && it.index()==i); - tmp /= it.value(); - } - if (it && it.index()==i) - ++it; - for(; it; ++it) - other.coeffRef(it.index(), col) -= tmp * it.value(); - } - } - } - } -}; - -// backward substitution, col-major -template<typename Lhs, typename Rhs, int Mode> -struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Upper,ColMajor> -{ - typedef typename Rhs::Scalar Scalar; - typedef typename Lhs::Index Index; - static void run(const Lhs& lhs, Rhs& other) - { - for(Index col=0 ; col<other.cols() ; ++col) - { - for(Index i=lhs.cols()-1; i>=0; --i) - { - Scalar& tmp = other.coeffRef(i,col); - if (tmp!=Scalar(0)) // optimization when other is actually sparse - { - if(!(Mode & UnitDiag)) - { - // TODO replace this by a binary search. make sure the binary search is safe for partially sorted elements - typename Lhs::ReverseInnerIterator it(lhs, i); - while(it && it.index()!=i) - --it; - eigen_assert(it && it.index()==i); - other.coeffRef(i,col) /= it.value(); - } - typename Lhs::InnerIterator it(lhs, i); - for(; it && it.index()<i; ++it) - other.coeffRef(it.index(), col) -= tmp * it.value(); - } - } - } - } -}; - -#else // EIGEN_TEST_EVALUATORS - // forward substitution, row-major template<typename Lhs, typename Rhs, int Mode> struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Lower,RowMajor> @@ -316,7 +173,6 @@ struct sparse_solve_triangular_selector<Lhs,Rhs,Mode,Upper,ColMajor> } }; -#endif // EIGEN_TEST_EVALUATORS } // end namespace internal template<typename ExpressionType,unsigned int Mode> @@ -338,18 +194,6 @@ void TriangularViewImpl<ExpressionType,Mode,Sparse>::solveInPlace(MatrixBase<Oth other = otherCopy; } -#ifndef EIGEN_TEST_EVALUATORS -template<typename ExpressionType,unsigned int Mode> -template<typename OtherDerived> -typename internal::plain_matrix_type_column_major<OtherDerived>::type -TriangularViewImpl<ExpressionType,Mode,Sparse>::solve(const MatrixBase<OtherDerived>& other) const -{ - typename internal::plain_matrix_type_column_major<OtherDerived>::type res(other); - solveInPlace(res); - return res; -} -#endif - // pure sparse path namespace internal { |