Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_InversePreconditioner.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef STOKHOS_INVERSEPRECONDITIONER_HPP
11 #define STOKHOS_INVERSEPRECONDITIONER_HPP
12 
13 #include "Teuchos_RCP.hpp"
14 #include "Stokhos_Operator.hpp"
17 
18 namespace Stokhos {
19 
20  template <typename ordinal_type, typename value_type>
22  public Stokhos::Operator<ordinal_type,double> {
23  public:
24 
28 
31 
35  ordinal_type m) const {
40 
41  // Setup solver
43  solver.setMatrix(AA);
44  solver.setVectors(UU, RR);
45  //Solve A*Result=Input
46  if (solver.shouldEquilibrate()) {
47  solver.factorWithEquilibration(true);
48  solver.equilibrateMatrix();
49  }
50  solver.solve();
51 
52  for (ordinal_type i=0; i<A.numRows(); i++)
53  Result(i,0)=(*UU)(i,0);
54 
55  return 0;
56  }
57 
58  protected:
60  }; // class InversePreconditioner
61 
62 } // namespace Stokhos
63 
64 #endif // STOKHOS_INVERSEPRECONDITIONER_HPP
65 
const Teuchos::SerialDenseMatrix< ordinal_type, value_type > & A
InversePreconditioner(const Teuchos::SerialDenseMatrix< ordinal_type, double > &A_)
Constructor.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void factorWithEquilibration(bool flag)
int setVectors(const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &X, const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &B)
int setMatrix(const RCP< SerialDenseMatrix< OrdinalType, ScalarType > > &A)
virtual ordinal_type ApplyInverse(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Input, Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Result, ordinal_type m) const