Debian Codegraph @

packages/muelu/src/Transfers/Energy-Minimization/Solvers/MueLu_SteepestDescentSolver_decl.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef MUELU_STEEPESTDESCENTSOLVER_DECL_HPP
11 #define MUELU_STEEPESTDESCENTSOLVER_DECL_HPP
12
13 #include <Xpetra_Matrix_fwd.hpp>
14 #include <Xpetra_CrsMatrixWrap_fwd.hpp>
15 #include <Xpetra_CrsMatrixFactory_fwd.hpp>
16
17 #include "MueLu_ConfigDefs.hpp"
18 #include "MueLu_Utilities_fwd.hpp"
19 #include "MueLu_SolverBase.hpp"
20 #include "MueLu_Constraint_fwd.hpp"
21
22 namespace MueLu {
23
24 /*!
25 @class SteepestDescentSolver class.
26 @brief Implements steepest descent algorithm for energy-minimization
27 */
28
29 template <class Scalar = DefaultScalar,
30 class LocalOrdinal = DefaultLocalOrdinal,
31 class GlobalOrdinal = DefaultGlobalOrdinal,
32 class Node = DefaultNode>
33 class SteepestDescentSolver : public SolverBase<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
34 #undef MUELU_STEEPESTDESCENTSOLVER_SHORT
35 #include "MueLu_UseShortNames.hpp"
36
37 public:
38 //! @name Constructors / destructors
39 //@{
40
41 /*! Constructor
42 \param Its -- Number of performed iterations
43 \param StepLength -- The modifier of the step length
44 */
45 SteepestDescentSolver(size_t Its, SC StepLength = Teuchos::ScalarTraits<Scalar>::one());
46
47 //@}
48
49 //! @name Iterate methods.
50 //@{
51
52 //! Iterate
53 void Iterate(const Matrix& A, const Constraint& C, const Matrix& P0, RCP<Matrix>& P) const;
54
55 //@}
56
57 private:
58 size_t nIts_; //!< Number of performed iterations
59 SC stepLength_; //!< Modifier of the step length
60 };
61
62 } // namespace MueLu
63
64 #define MUELU_STEEPESTDESCENTSOLVER_SHORT
65 #endif // MUELU_STEEPESTDESCENTSOLVER_DECL_HPP