Epetra Package Browser (Single Doxygen Collection)
Development
Toggle main menu visibility
Loading...
Searching...
No Matches
src
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
#include "
Epetra_Operator.h
"
48
#include "
Epetra_CrsMatrix.h
"
49
class
Epetra_Vector
;
50
class
Epetra_MultiVector
;
51
53
58
59
class
Epetra_FastCrsOperator
:
public
Epetra_CompObject
,
public
virtual
Epetra_Operator
{
60
61
public
:
62
64
65
66
Epetra_FastCrsOperator
(
const
Epetra_CrsMatrix
& Matrix,
bool
UseFloats =
false
);
67
69
virtual
~Epetra_FastCrsOperator
();
71
73
74
75
/* Updates the values only using a matrix that has exactly the same structure as
76
the matrix used to construct this Epetra_FastCrsOperator object.
77
*/
78
int
UpdateValues
(
const
Epetra_CrsMatrix
& Matrix);
80
82
83
85
char
*
Label
()
const
{
return
(
CrsMatrix_
.Label());};
86
88
97
int
SetUseTranspose
(
bool
UseTranspose
) {
return
(
CrsMatrix_
.SetUseTranspose());};
98
100
/* Returns the quantity \f$ \| A \|_\infty\f$ such that
101
\f[\| A \|_\infty = \max_{1\lei\lem} \sum_{j=1}^n |a_{ij}| \f].
102
*/
103
double
NormInf
()
const
{
return
(
CrsMatrix_
.NormInf());};
104
106
const
Epetra_Comm
&
Comm
()
const
{
return
(
CrsMatrix_
.Comm());};
107
109
115
int
Apply
(
const
Epetra_MultiVector
& X,
Epetra_MultiVector
& Y)
const
;
116
118
125
int
ApplyInverse
(
const
Epetra_MultiVector
& X,
Epetra_MultiVector
& Y)
const
;
126
128
bool
HasNormInf
()
const
{
return
(
CrsMatrix_
.HasNormInf());};
129
131
bool
UseTranspose
()
const
{
return
(
CrsMatrix_
.UseTranspose());};
132
134
const
Epetra_Map
&
OperatorDomainMap
()
const
{
return
(
CrsMatrix_
.OperatorDomainMap());};
135
137
const
Epetra_Map
&
OperatorRangeMap
()
const
{
return
(
CrsMatrix_
.OperatorRangeMap());};
138
140
141
142
protected
:
143
int
Allocate
(
bool
UseFloats);
144
const
Epetra_CrsMatrix
&
CrsMatrix_
;
145
int
NumMyRows_
;
146
int
NumMyNonzeros_
;
147
double
*
Values_
;
148
float
*
FloatValues_
;
149
int
*
Indices_
;
150
unsigned
short
*
ShortIndices_
;
151
152
bool
UsingFloats_
;
153
bool
UsingShorts_
;
154
bool
ValuesAllocated_
;
155
156
157
mutable
Epetra_MultiVector
*
ImportVector_
;
158
mutable
Epetra_MultiVector
*
ExportVector_
;
159
160
};
161
#endif
/* EPETRA_FASTCRSMATRIX_H */
Epetra_CrsMatrix.h
Epetra_Operator.h
Epetra_Comm
Epetra_Comm: The Epetra Communication Abstract Base Class.
Definition
Epetra_Comm.h:73
Epetra_CompObject::Epetra_CompObject
Epetra_CompObject()
Basic Epetra_CompObject constuctor.
Definition
Epetra_CompObject.cpp:52
Epetra_CrsMatrix
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
Definition
Epetra_CrsMatrix.h:173
Epetra_FastCrsOperator::ImportVector_
Epetra_MultiVector * ImportVector_
Definition
Epetra_FastCrsMatrix.h:157
Epetra_FastCrsOperator::CrsMatrix_
const Epetra_CrsMatrix & CrsMatrix_
Definition
Epetra_FastCrsMatrix.h:144
Epetra_FastCrsOperator::Apply
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.
Epetra_FastCrsOperator::Values_
double * Values_
Definition
Epetra_FastCrsMatrix.h:147
Epetra_FastCrsOperator::Indices_
int * Indices_
Definition
Epetra_FastCrsMatrix.h:149
Epetra_FastCrsOperator::HasNormInf
bool HasNormInf() const
Returns true because this class can compute an Inf-norm.
Definition
Epetra_FastCrsMatrix.h:128
Epetra_FastCrsOperator::OperatorRangeMap
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
Definition
Epetra_FastCrsMatrix.h:137
Epetra_FastCrsOperator::UseTranspose
bool UseTranspose() const
Returns the current UseTranspose setting.
Definition
Epetra_FastCrsMatrix.h:131
Epetra_FastCrsOperator::Label
char * Label() const
Returns a character string describing the operator.
Definition
Epetra_FastCrsMatrix.h:85
Epetra_FastCrsOperator::ApplyInverse
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_FastCrsOperator::UpdateValues
int UpdateValues(const Epetra_CrsMatrix &Matrix)
Update values using a matrix with identical structure.
Epetra_FastCrsOperator::SetUseTranspose
int SetUseTranspose(bool UseTranspose)
If set true, transpose of this operator will be applied.
Definition
Epetra_FastCrsMatrix.h:97
Epetra_FastCrsOperator::NumMyNonzeros_
int NumMyNonzeros_
Definition
Epetra_FastCrsMatrix.h:146
Epetra_FastCrsOperator::Epetra_FastCrsOperator
Epetra_FastCrsOperator(const Epetra_CrsMatrix &Matrix, bool UseFloats=false)
Epetra_FastCrsOperator constuctor.
Epetra_FastCrsOperator::FloatValues_
float * FloatValues_
Definition
Epetra_FastCrsMatrix.h:148
Epetra_FastCrsOperator::Allocate
int Allocate(bool UseFloats)
Epetra_FastCrsOperator::OperatorDomainMap
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator.
Definition
Epetra_FastCrsMatrix.h:134
Epetra_FastCrsOperator::UsingShorts_
bool UsingShorts_
Definition
Epetra_FastCrsMatrix.h:153
Epetra_FastCrsOperator::ShortIndices_
unsigned short * ShortIndices_
Definition
Epetra_FastCrsMatrix.h:150
Epetra_FastCrsOperator::NumMyRows_
int NumMyRows_
Definition
Epetra_FastCrsMatrix.h:145
Epetra_FastCrsOperator::ExportVector_
Epetra_MultiVector * ExportVector_
Definition
Epetra_FastCrsMatrix.h:158
Epetra_FastCrsOperator::~Epetra_FastCrsOperator
virtual ~Epetra_FastCrsOperator()
Epetra_FastCrsOperator Destructor.
Epetra_FastCrsOperator::NormInf
double NormInf() const
Returns the infinity norm of the global matrix.
Definition
Epetra_FastCrsMatrix.h:103
Epetra_FastCrsOperator::UsingFloats_
bool UsingFloats_
Definition
Epetra_FastCrsMatrix.h:152
Epetra_FastCrsOperator::ValuesAllocated_
bool ValuesAllocated_
Definition
Epetra_FastCrsMatrix.h:154
Epetra_FastCrsOperator::Comm
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this matrix.
Definition
Epetra_FastCrsMatrix.h:106
Epetra_Map
Epetra_Map: A class for partitioning vectors and matrices.
Definition
Epetra_Map.h:119
Epetra_MultiVector
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
Definition
Epetra_MultiVector.h:184
Epetra_Operator
Epetra_Operator: A pure virtual class for using real-valued double-precision operators.
Definition
Epetra_Operator.h:60
Epetra_Vector
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.
Definition
Epetra_Vector.h:142
Generated by
1.17.0