Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_Solver_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Amesos2: Templated Direct Sparse Solver Package
6 // Copyright 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ***********************************************************************
41 //
42 // @HEADER
43 
52 #ifndef AMESOS2_SOLVER_DECL_HPP
53 #define AMESOS2_SOLVER_DECL_HPP
54 
55 #include <Teuchos_Describable.hpp>
56 #include <Teuchos_ParameterList.hpp>
57 #include <Teuchos_RCP.hpp>
58 #include <Teuchos_Comm.hpp>
59 
60 #include "Amesos2_TypeDecl.hpp"
61 #include "Amesos2_Status.hpp"
62 
63 namespace Amesos2 {
64 
65 
77  template <class Matrix, class Vector>
78  class Solver : public Teuchos::Describable {
79 
80  public:
81 
83 
85 
86 
94  virtual type& preOrdering( void ) = 0;
95 
96 
102  virtual type& symbolicFactorization( void ) = 0;
103 
104 
117  virtual type& numericFactorization( void ) = 0;
118 
119 
132  virtual void solve( void ) = 0;
133 
134 
149  virtual void solve(const Teuchos::Ptr<Vector> X,
150  const Teuchos::Ptr<const Vector> B) const = 0;
151 
152 
167  virtual void solve(Vector* X, const Vector* B) const = 0;
168 
170 
187  virtual type& setParameters( const Teuchos::RCP<Teuchos::ParameterList> & parameterList ) = 0;
188 
189 
194  virtual Teuchos::RCP<const Teuchos::ParameterList> getValidParameters( void ) const = 0;
195 
197 
198 
222  virtual void setA( const Teuchos::RCP<const Matrix> a, EPhase keep_phase = CLEAN ) = 0;
223 
243  virtual void setA( const Matrix* a, EPhase keep_phase = CLEAN ) = 0;
244 
245 
247  virtual bool matrixShapeOK( void ) = 0;
248 
249 
251  virtual void setX( const Teuchos::RCP<Vector> x ) = 0;
252 
253 
255  virtual void setX( Vector* x ) = 0;
256 
257 
259  virtual const Teuchos::RCP<Vector> getX( void ) = 0;
260 
261 
263  virtual Vector* getXRaw( void ) = 0;
264 
265 
267  virtual void setB( const Teuchos::RCP<const Vector> b ) = 0;
268 
269 
271  virtual void setB( const Vector* b ) = 0;
272 
273 
275  virtual const Teuchos::RCP<const Vector> getB( void ) = 0;
276 
277 
279  virtual const Vector* getBRaw( void ) = 0;
280 
281 
283  virtual Teuchos::RCP<const Teuchos::Comm<int> > getComm( void ) const = 0;
284 
285 
287  virtual Status& getStatus() const = 0;
288 
289 
291  virtual std::string name( void ) const = 0;
292 
294 
295 
300  virtual std::string description( void ) const = 0;
302 
303 
306  virtual void describe( Teuchos::FancyOStream &out,
307  const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default ) const = 0;
308 
310 
311 
316  virtual void printTiming( Teuchos::FancyOStream &out,
318  const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default ) const = 0;
319 
320 
329  virtual void getTiming( Teuchos::ParameterList& timingParameterList ) const = 0;
330 
332 
333  }; // End class Solver
334 
335 
336 } // end namespace Amesos2
337 
338 #endif // AMESOS2_SOLVER_BASE_DECL_HPP
virtual void setX(const Teuchos::RCP< Vector > x)=0
Sets the LHS vector X.
Holds internal status data about the owning Amesos2 solver.
Definition: Amesos2_Status.hpp:73
EPhase
Used to indicate a phase in the direct solution.
Definition: Amesos2_TypeDecl.hpp:65
virtual Status & getStatus() const =0
Returns a reference to this solver&#39;s internal status object.
virtual type & setParameters(const Teuchos::RCP< Teuchos::ParameterList > &parameterList)=0
Set/update internal variables and solver options.
virtual Teuchos::RCP< const Teuchos::ParameterList > getValidParameters(void) const =0
Return a const parameter list of all of the valid parameters that this-&gt;setParameterList(...) will accept.
virtual void printTiming(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const =0
Prints timing information about the current solver.
virtual std::string name(void) const =0
Return the name of this solver.
virtual std::string description(void) const =0
Returns a short description of this Solver.
virtual void getTiming(Teuchos::ParameterList &timingParameterList) const =0
Extracts timing information from the current solver.
virtual type & preOrdering(void)=0
Pre-orders the matrix.
virtual Vector * getXRaw(void)=0
Returns a raw pointer to the LHS of the linear system.
virtual type & numericFactorization(void)=0
Performs numeric factorization on the matrix.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const =0
virtual void setB(const Teuchos::RCP< const Vector > b)=0
Sets the RHS vector B.
virtual const Vector * getBRaw(void)=0
Returns a raw pointer to the RHS of the linear system.
virtual type & symbolicFactorization(void)=0
Performs symbolic factorization on the matrix.
virtual const Teuchos::RCP< const Vector > getB(void)=0
Returns the vector that is the RHS of the linear system.
Interface to Amesos2 solver objects.
Definition: Amesos2_Solver_decl.hpp:78
Enum and other types declarations for Amesos2.
virtual const Teuchos::RCP< Vector > getX(void)=0
Returns the vector that is the LHS of the linear system.
Container class for status variables.
virtual bool matrixShapeOK(void)=0
Returns true if the solver can handle the matrix shape.
virtual void solve(void)=0
Solves (or )
virtual void setA(const Teuchos::RCP< const Matrix > a, EPhase keep_phase=CLEAN)=0
Sets the matrix A of this solver.
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm(void) const =0
Returns a pointer to the Teuchos::Comm communicator with this matrix.