Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_FastCrsMatrix.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_FASTCRSMATRIX_H
45 #define EPETRA_FASTCRSMATRIX_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 #include "Epetra_Operator.h"
56 #include "Epetra_CrsMatrix.h"
57 class Epetra_Vector;
58 class Epetra_MultiVector;
59 
61 
68 
69  public:
70 
72 
73  Epetra_FastCrsOperator(const Epetra_CrsMatrix & Matrix, bool UseFloats = false);
75 
77  virtual ~Epetra_FastCrsOperator();
79 
81 
82  /* Updates the values only using a matrix that has exactly the same structure as
84  the matrix used to construct this Epetra_FastCrsOperator object.
85  */
86  int UpdateValues(const Epetra_CrsMatrix & Matrix);
88 
90 
91 
93  char * Label() const {return(CrsMatrix_.Label());};
94 
96 
106 
108  /* Returns the quantity \f$ \| A \|_\infty\f$ such that
109  \f[\| A \|_\infty = \max_{1\lei\lem} \sum_{j=1}^n |a_{ij}| \f].
110  */
111  double NormInf() const {return(CrsMatrix_.NormInf());};
112 
114  const Epetra_Comm & Comm() const {return(CrsMatrix_.Comm());};
115 
117 
123  int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
124 
126 
133  int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
134 
136  bool HasNormInf() const {return(CrsMatrix_.HasNormInf());};
137 
139  bool UseTranspose() const {return(CrsMatrix_.UseTranspose());};
140 
143 
146 
148 
149 
150  protected:
151  int Allocate(bool UseFloats);
155  double *Values_;
156  float * FloatValues_;
157  int * Indices_;
158  unsigned short * ShortIndices_;
159 
163 
164 
167 
168 };
169 #endif /* EPETRA_FASTCRSMATRIX_H */
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
Epetra_Map: A class for partitioning vectors and matrices.
Definition: Epetra_Map.h:127
bool HasNormInf() const
Returns true because this class can compute an Inf-norm.
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y...
Epetra_MultiVector * ExportVector_
bool HasNormInf() const
Returns true because this class can compute an Inf-norm.
bool UseTranspose() const
Returns the current UseTranspose setting.
int Allocate(bool UseFloats)
double NormInf() const
Returns the infinity norm of the global matrix.
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator. ...
bool UseTranspose() const
Returns the current UseTranspose setting.
virtual ~Epetra_FastCrsOperator()
Epetra_FastCrsOperator Destructor.
Epetra_MultiVector * ImportVector_
double NormInf() const
Returns the infinity norm of the global matrix.
int UpdateValues(const Epetra_CrsMatrix &Matrix)
Update values using a matrix with identical structure.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
Epetra_Comm: The Epetra Communication Abstract Base Class.
Definition: Epetra_Comm.h:81
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
Epetra_FastCrsOperator: A class for constructing matrix objects optimized for common kernels...
const char * Label() const
Returns a character string describing the operator.
Epetra_CompObject: Functionality and data that is common to all computational classes.
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator. ...
unsigned short * ShortIndices_
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
Epetra_Operator: A pure virtual class for using real-valued double-precision operators.
int SetUseTranspose(bool UseTranspose)
If set true, transpose of this operator will be applied.
Epetra_FastCrsOperator(const Epetra_CrsMatrix &Matrix, bool UseFloats=false)
Epetra_FastCrsOperator constuctor.
const Epetra_CrsMatrix & CrsMatrix_
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.
char * Label() const
Returns a character string describing the operator.