Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BelosOrthoManager.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 
14 #ifndef BELOS_ORTHOMANAGER_HPP
15 #define BELOS_ORTHOMANAGER_HPP
16 
35 #include "BelosConfigDefs.hpp"
36 #include "BelosTypes.hpp"
37 #include "Teuchos_ScalarTraits.hpp"
38 #include "Teuchos_RCP.hpp"
40 #include "Teuchos_Array.hpp"
41 
42 
43 namespace Belos {
44 
45 
47 
48 
51  class OrthoError : public BelosError
52  {public: OrthoError(const std::string& what_arg) : BelosError(what_arg) {}};
53 
55 
56  template <class ScalarType, class MV>
57  class OrthoManager :
59  {
60  public:
62 
63  OrthoManager() {};
65 
67  virtual ~OrthoManager() {};
69 
71 
72 
81  virtual void innerProd( const MV &X, const MV &Y, Teuchos::SerialDenseMatrix<int,ScalarType>& Z ) const = 0;
82 
83 
96  virtual void norm (const MV& X, std::vector<typename Teuchos::ScalarTraits<ScalarType>::magnitudeType>& normvec) const = 0;
97 
132  virtual void
133  project (MV &X,
136 
151  virtual int normalize ( MV &X, Teuchos::RCP<Teuchos::SerialDenseMatrix<int,ScalarType> > B ) const = 0;
152 
153  protected:
154  virtual int
159 
160  public:
161 
216  int
221  {
222  return this->projectAndNormalizeImpl (X, C, B, Q);
223  }
224 
226 
228 
229 
233  orthonormError(const MV &X) const = 0;
234 
238  orthogError(const MV &X1, const MV &X2) const = 0;
239 
241 
242 
244 
245 
248  virtual void setLabel(const std::string& label) = 0;
249 
252  virtual const std::string& getLabel() const = 0;
253 
255 
256  };
257 
258 } // end of Belos namespace
259 
260 
261 #endif
262 
263 // end of file BelosOrthoManager.hpp
Collection of types and exceptions used within the Belos solvers.
OrthoError(const std::string &what_arg)
int projectAndNormalize(MV &X, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
Project X against the Q[i] and normalize X.
virtual void project(MV &X, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const =0
Project X against the (orthogonal) entries of Q.
virtual int projectAndNormalizeImpl(MV &X, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const =0
virtual void setLabel(const std::string &label)=0
This method sets the label used by the timers in the orthogonalization manager.
OrthoManager()
Default constructor.
virtual int normalize(MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B) const =0
This method takes a multivector X and attempts to compute an orthonormal basis for ...
virtual Teuchos::ScalarTraits< ScalarType >::magnitudeType orthogError(const MV &X1, const MV &X2) const =0
This method computes the error in orthogonality of two multivectors.
virtual void innerProd(const MV &X, const MV &Y, Teuchos::SerialDenseMatrix< int, ScalarType > &Z) const =0
Provides the inner product defining the orthogonality concepts.
virtual const std::string & getLabel() const =0
This method returns the label being used by the timers in the orthogonalization manager.
Belos&#39;s templated virtual class for providing routines for orthogonalization and orthonormzalition of...
Exception thrown to signal error in an orthogonalization manager method.
BelosError(const std::string &what_arg)
Definition: BelosTypes.hpp:30
virtual Teuchos::ScalarTraits< ScalarType >::magnitudeType orthonormError(const MV &X) const =0
This method computes the error in orthonormality of a multivector.
virtual ~OrthoManager()
Destructor.
virtual void norm(const MV &X, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec) const =0
Compute the norm(s) of the column(s) of X.
Parent class to all Belos exceptions.
Definition: BelosTypes.hpp:28
Belos header file which uses auto-configuration information to include necessary C++ headers...

Generated on Mon Jul 15 2024 09:24:24 for Belos by doxygen 1.8.5