From 4716040703be1ee906439385d20475dcddad5ce3 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 25 Oct 2010 10:15:22 -0400 Subject: bug #86 : use internal:: namespace instead of ei_ prefix --- Eigen/src/Core/SolveTriangular.h | 70 +++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 33 deletions(-) (limited to 'Eigen/src/Core/SolveTriangular.h') diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h index 960da31f3..0b9d3db9d 100644 --- a/Eigen/src/Core/SolveTriangular.h +++ b/Eigen/src/Core/SolveTriangular.h @@ -25,8 +25,10 @@ #ifndef EIGEN_SOLVETRIANGULAR_H #define EIGEN_SOLVETRIANGULAR_H +namespace internal { + template -class ei_trsolve_traits +class trsolve_traits { private: enum { @@ -43,19 +45,19 @@ class ei_trsolve_traits template::Unrolling, + int Unrolling = trsolve_traits::Unrolling, int StorageOrder = (int(Lhs::Flags) & RowMajorBit) ? RowMajor : ColMajor, - int RhsVectors = ei_trsolve_traits::RhsVectors + int RhsVectors = trsolve_traits::RhsVectors > -struct ei_triangular_solver_selector; +struct triangular_solver_selector; // forward and backward substitution, row-major, rhs is a vector template -struct ei_triangular_solver_selector +struct triangular_solver_selector { typedef typename Lhs::Scalar LhsScalar; typedef typename Rhs::Scalar RhsScalar; - typedef ei_blas_traits LhsProductTraits; + typedef blas_traits LhsProductTraits; typedef typename LhsProductTraits::ExtractType ActualLhsType; typedef typename Lhs::Index Index; enum { @@ -82,7 +84,7 @@ struct ei_triangular_solver_selector::run( + general_matrix_vector_product::run( actualPanelWidth, r, &(actualLhs.const_cast_derived().coeffRef(startRow,startCol)), actualLhs.outerStride(), &(other.coeffRef(startCol)), other.innerStride(), @@ -106,11 +108,11 @@ struct ei_triangular_solver_selector -struct ei_triangular_solver_selector +struct triangular_solver_selector { typedef typename Lhs::Scalar LhsScalar; typedef typename Rhs::Scalar RhsScalar; - typedef ei_blas_traits LhsProductTraits; + typedef blas_traits LhsProductTraits; typedef typename LhsProductTraits::ExtractType ActualLhsType; typedef typename Lhs::Index Index; enum { @@ -148,7 +150,7 @@ struct ei_triangular_solver_selector::run( + general_matrix_vector_product::run( r, actualPanelWidth, &(actualLhs.const_cast_derived().coeffRef(endBlock,startBlock)), actualLhs.outerStride(), &other.coeff(startBlock), other.innerStride(), @@ -160,31 +162,31 @@ struct ei_triangular_solver_selector -struct ei_triangular_solver_selector +struct triangular_solver_selector { static void run(const Lhs& lhs, Rhs& rhs) { Transpose rhsTr(rhs); Transpose lhsTr(lhs); - ei_triangular_solver_selector,Transpose,OnTheLeft,TriangularView::TransposeMode>::run(lhsTr,rhsTr); + triangular_solver_selector,Transpose,OnTheLeft,TriangularView::TransposeMode>::run(lhsTr,rhsTr); } }; template -struct ei_triangular_solve_matrix; +struct triangular_solve_matrix; // the rhs is a matrix template -struct ei_triangular_solver_selector +struct triangular_solver_selector { typedef typename Rhs::Scalar Scalar; typedef typename Rhs::Index Index; - typedef ei_blas_traits LhsProductTraits; + typedef blas_traits LhsProductTraits; typedef typename LhsProductTraits::DirectLinearAccessType ActualLhsType; static void run(const Lhs& lhs, Rhs& rhs) { const ActualLhsType actualLhs = LhsProductTraits::extract(lhs); - ei_triangular_solve_matrix ::run(lhs.rows(), Side==OnTheLeft? rhs.cols() : rhs.rows(), &actualLhs.coeff(0,0), actualLhs.outerStride(), &rhs.coeffRef(0,0), rhs.outerStride()); } @@ -196,10 +198,10 @@ struct ei_triangular_solver_selector -struct ei_triangular_solver_unroller; +struct triangular_solver_unroller; template -struct ei_triangular_solver_unroller { +struct triangular_solver_unroller { enum { IsLower = ((Mode&Lower)==Lower), I = IsLower ? Index : Size - Index - 1, @@ -213,21 +215,23 @@ struct ei_triangular_solver_unroller { if(!(Mode & UnitDiag)) rhs.coeffRef(I) /= lhs.coeff(I,I); - ei_triangular_solver_unroller::run(lhs,rhs); + triangular_solver_unroller::run(lhs,rhs); } }; template -struct ei_triangular_solver_unroller { +struct triangular_solver_unroller { static void run(const Lhs&, Rhs&) {} }; template -struct ei_triangular_solver_selector { +struct triangular_solver_selector { static void run(const Lhs& lhs, Rhs& rhs) - { ei_triangular_solver_unroller::run(lhs,rhs); } + { triangular_solver_unroller::run(lhs,rhs); } }; +} // end namespace internal + /*************************************************************************** * TriangularView methods ***************************************************************************/ @@ -246,17 +250,17 @@ template void TriangularView::solveInPlace(const MatrixBase& _other) const { OtherDerived& other = _other.const_cast_derived(); - ei_assert(cols() == rows()); - ei_assert( (Side==OnTheLeft && cols() == other.rows()) || (Side==OnTheRight && cols() == other.cols()) ); - ei_assert(!(Mode & ZeroDiag)); - ei_assert(Mode & (Upper|Lower)); - - enum { copy = ei_traits::Flags & RowMajorBit && OtherDerived::IsVectorAtCompileTime }; - typedef typename ei_meta_if::type, OtherDerived&>::ret OtherCopy; + eigen_assert(cols() == rows()); + eigen_assert( (Side==OnTheLeft && cols() == other.rows()) || (Side==OnTheRight && cols() == other.cols()) ); + eigen_assert(!(Mode & ZeroDiag)); + eigen_assert(Mode & (Upper|Lower)); + + enum { copy = internal::traits::Flags & RowMajorBit && OtherDerived::IsVectorAtCompileTime }; + typedef typename internal::meta_if::type, OtherDerived&>::ret OtherCopy; OtherCopy otherCopy(other); - ei_triangular_solver_selector::type, + internal::triangular_solver_selector::type, Side, Mode>::run(nestedExpression(), otherCopy); if (copy) @@ -296,10 +300,10 @@ void TriangularView::solveInPlace(const MatrixBase template -typename ei_plain_matrix_type_column_major::type +typename internal::plain_matrix_type_column_major::type TriangularView::solve(const MatrixBase& rhs) const { - typename ei_plain_matrix_type_column_major::type res(rhs); + typename internal::plain_matrix_type_column_major::type res(rhs); solveInPlace(res); return res; } -- cgit v1.2.3