Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_InvOperator.h
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ************************************************************************
4 //
5 // Epetra: Linear Algebra Services 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 //@HEADER
42 */
43 
44 #ifndef EPETRA_INVOPERATOR_H
45 #define EPETRA_INVOPERATOR_H
46 
47 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
48 #ifdef __GNUC__
49 #warning "The Epetra package is deprecated"
50 #endif
51 #endif
52 
53 
54 
55 class Epetra_MultiVector;
56 class Epetra_BlockMap;
57 class Epetra_Comm;
58 #include <string>
59 #include "Epetra_Operator.h"
60 
62 
67 class Epetra_InvOperator: public virtual Epetra_Operator {
68 
69  public:
70 
72 
73 
78  operator_ = operatorIn;
79  Label_ = "Inverse of " + std::string(operatorIn->Label());
80  return;
81  }
83  virtual ~Epetra_InvOperator(){}
85 
87 
88 
90 
99  int SetUseTranspose(bool UseTranspose_in){EPETRA_CHK_ERR(operator_->SetUseTranspose(UseTranspose_in)); return(0);}
101 
103 
104 
106 
115 
117 
126 
128  /* Returns the quantity \f$ \| A \|_\infty\f$ such that
129  \f[\| A \|_\infty = \max_{1\lei\lem} \sum_{j=1}^n |a_{ij}| \f].
130 
131  \warning This method must not be called unless HasNormInf() returns true.
132  */
133  double NormInf() const {return(operator_->NormInf());}
134 
136 
137 
139  const char * Label() const {return(Label_.c_str());}
140 
142  Epetra_Operator * Operator() const {return(operator_);}
143 
144 
146  bool UseTranspose() const {return(operator_->UseTranspose());}
147 
149  bool HasNormInf() const {return(operator_->HasNormInf());};
150 
152  const Epetra_Comm & Comm() const {return(operator_->Comm());}
153 
156  {
157  if (!UseTranspose()) return(operator_->OperatorRangeMap());
158  else return(operator_->OperatorDomainMap());
159  }
160 
162  const Epetra_Map & OperatorRangeMap() const
163  {
164  if (!UseTranspose()) return(operator_->OperatorDomainMap());
165  else return(operator_->OperatorRangeMap());
166  }
168 
169  protected:
170 
172  std::string Label_;
173 };
174 
175 #endif /* EPETRA_INVOPERATOR_H */
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
Epetra_InvOperator(Epetra_Operator *operatorIn)
Uses an Epetra_Operator instance to implement the Epetra_Operator interface.
Epetra_Map: A class for partitioning vectors and matrices.
Definition: Epetra_Map.h:127
virtual int SetUseTranspose(bool UseTranspose)=0
If set true, transpose of this operator will be applied.
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_InvOperator inverse applied to an Epetra_MultiVector X in Y...
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y...
#define EPETRA_CHK_ERR(a)
virtual const Epetra_Map & OperatorDomainMap() const =0
Returns the Epetra_Map object associated with the domain of this operator.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
virtual const char * Label() const =0
Returns a character string describing the operator.
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_BlockMap object associated with the range of this matrix operator.
Epetra_InvOperator: An implementation of the Epetra_Operator class that reverses the role of Apply() ...
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_InvOperator applied to a Epetra_MultiVector X in Y.
bool UseTranspose() const
Returns the current UseTranspose setting.
Epetra_Operator * Operator() const
Returns a pointer to the Epetra_Operator operator object that was used to create this Epetra_InvOpera...
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const =0
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.
virtual const Epetra_Map & OperatorRangeMap() const =0
Returns the Epetra_Map object associated with the range of this operator.
virtual const Epetra_Comm & Comm() const =0
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Epetra_Comm: The Epetra Communication Abstract Base Class.
Definition: Epetra_Comm.h:81
virtual bool UseTranspose() const =0
Returns the current UseTranspose setting.
Epetra_Operator * operator_
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_BlockMap object associated with the domain of this matrix operator.
bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
const char * Label() const
Returns a character std::string describing the operator.
virtual bool HasNormInf() const =0
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
virtual ~Epetra_InvOperator()
Destructor.
double NormInf() const
Returns the infinity norm of the global matrix.
virtual double NormInf() const =0
Returns the infinity norm of the global matrix.
Epetra_Operator: A pure virtual class for using real-valued double-precision operators.
int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied.