Belos Version of the Day
Loading...
Searching...
No Matches
BelosDenseSolver.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Belos: Block Linear Solvers Package
4//
5// Copyright 2004-2016 NTESS and the Belos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9//
10#ifndef BELOS_DENSE_SOLVER_HPP
11#define BELOS_DENSE_SOLVER_HPP
12
17#include "Teuchos_RCP.hpp"
18#include "Teuchos_BLAS_types.hpp"
19
20namespace Belos {
21
22 template<class ScalarType, class DM>
24 {
25 public:
26
28
29
31 : spd_(false),
33 TRANS_(Teuchos::NO_TRANS),
35 {}
36
38 virtual ~DenseSolver() {}
40
42
43
45 virtual int setMatrix(const Teuchos::RCP<DM>& A) { A_ = A; newMatrix_ = true; return 0; }
46
48
51 virtual int setVectors(const Teuchos::RCP<DM>& X, const Teuchos::RCP<DM>& B) { X_ = X; B_ = B; return 0; }
53
55
56
59 void setSPD(bool flag) {spd_ = flag; return;}
60
62
65
67
69 void solveWithTransposeFlag(Teuchos::ETransp trans) {TRANS_ = trans; return;}
71
73
74
76
79 virtual int factor() = 0;
80
82
85 virtual int solve() = 0;
87
88 protected:
89
91 Teuchos::ETransp TRANS_;
92
94 Teuchos::RCP<DM> A_, X_, B_;
95 };
96
97} // namespace Belos
98
99#endif // end file BELOS_DENSE_SOLVER_HPP
void setSPD(bool flag)
Set if dense matrix is symmetric positive definite.
void solveWithTransposeFlag(Teuchos::ETransp trans)
All subsequent function calls will work with the transpose-type set by this method (Teuchos::NO_TRANS...
virtual int solve()=0
Computes the solution X to AX = B for the this matrix and the B provided.
virtual int setMatrix(const Teuchos::RCP< DM > &A)
Sets the pointers for coefficient matrix.
Teuchos::RCP< DM > B_
virtual ~DenseSolver()
SerialDenseSolver destructor.
virtual int setVectors(const Teuchos::RCP< DM > &X, const Teuchos::RCP< DM > &B)
Sets the pointers for left and right hand side vector(s).
Teuchos::RCP< DM > X_
Teuchos::RCP< DM > A_
virtual int factor()=0
Computes the in-place LU factorization of the matrix.
Teuchos::ETransp TRANS_
DenseSolver()
Default constructor; matrix should be set using setMatrix(), LHS and RHS set with setVectors().
void factorWithEquilibration(bool flag)
Causes equilibration to be called just before the matrix factorization as part of the call to factor.
Alternative run-time polymorphic interface for operators.

Generated for Belos by doxygen 1.9.8