10 #ifndef MUELU_STEEPESTDESCENTSOLVER_DEF_HPP
11 #define MUELU_STEEPESTDESCENTSOLVER_DEF_HPP
14 #include <Xpetra_CrsMatrixWrap.hpp>
17 #include "MueLu_Constraint.hpp"
19 #include "MueLu_Utilities.hpp"
25 using Teuchos::rcp_const_cast;
27 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 , stepLength_(StepLength) {}
32 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
44 Ptmp_->fillComplete(P0.getDomainMap(), P0.getRangeMap());
48 P = rcp_const_cast<Matrix>(rcpFromRef(P0));
50 for (
size_t k = 0; k < nIts_; k++) {
54 SC stepLength = 2*stepLength_;
59 SC stepLength = stepLength_;
65 Xpetra::MatrixMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::TwoMatrixAdd(*Ptmp,
false, -stepLength, *P,
false,
Teuchos::ScalarTraits<Scalar>::one(), newP, mmfancy);
66 newP->fillComplete(P->getDomainMap(), P->getRangeMap());
72 #endif // ifndef MUELU_STEEPESTDESCENTSOLVER_DECL_HPP
static void MyOldScaleMatrix(Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Op, const Teuchos::ArrayRCP< const Scalar > &scalingVector, bool doInverse=true, bool doFillComplete=true, bool doOptimizeStorage=true)
Constraint space information for the potential prolongator.
RCP< const CrsGraph > GetPattern() const
Print even more statistics.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
static Teuchos::ArrayRCP< Scalar > GetMatrixDiagonal_arcp(const Matrix &A)
Extract Matrix Diagonal.
static void TwoMatrixAdd(const Matrix &A, bool transposeA, SC alpha, Matrix &B, SC beta)
void Apply(const Matrix &P, Matrix &Projected) const
Apply constraint.
static void Multiply(const Matrix &A, bool transposeA, const Matrix &B, bool transposeB, Matrix &C, bool call_FillComplete_on_result=true, bool doOptimizeStorage=true, const std::string &label=std::string(), const RCP< ParameterList > ¶ms=null)
void Iterate(const Matrix &A, const Constraint &C, const Matrix &P0, RCP< Matrix > &P) const
Iterate.
SteepestDescentSolver(size_t Its, SC StepLength=Teuchos::ScalarTraits< Scalar >::one())