inline LDLPivot BunchParlett( const DistMatrix<F>& A, Base<F> gamma ) { DEBUG_CSE typedef Base<F> Real; if( gamma == Real(0) ) gamma = LDLPivotConstant<Real>( BUNCH_PARLETT ); const ValueInt<Real> diagMax = VectorMaxAbsLoc( GetDiagonal(A) ); const Entry<Real> offDiagMax = SymmetricMaxAbsLoc( LOWER, A ); LDLPivot pivot; if( diagMax.value >= gamma*offDiagMax.value ) { pivot.nb = 1; pivot.from[0] = diagMax.index; return pivot; } else { pivot.nb = 2; pivot.from[0] = offDiagMax.i; pivot.from[1] = offDiagMax.j; return pivot; } }
http://opensource.org/licenses/BSD-2-Clause */ #ifndef EL_CHOLESKY_LVAR3PIVOTED_HPP #define EL_CHOLESKY_LVAR3PIVOTED_HPP namespace El { namespace cholesky { namespace pivot { template<typename F> inline LDLPivot Full( const Matrix<F>& A ) { DEBUG_ONLY(CSE cse("cholesky::pivot::Full")) const auto diagMax = VectorMaxAbsLoc( GetDiagonal(A) ); LDLPivot pivot; pivot.nb = 1; pivot.from[0] = diagMax.index; return pivot; } template<typename F> inline LDLPivot Full( const DistMatrix<F>& A ) { DEBUG_ONLY(CSE cse("cholesky::pivot::Full")) const auto diagMax = VectorMaxAbsLoc( GetDiagonal(A) ); LDLPivot pivot; pivot.nb = 1; pivot.from[0] = diagMax.index;