Amesos Package Browser (Single Doxygen Collection)  Development
Amesos_TestRowMatrix.h
Go to the documentation of this file.
1 #ifndef IFPACK_ROWMATRIX_H
2 #define IFPACK_ROWMATRIX_H
3 
4 #include "Amesos_ConfigDefs.h"
5 #ifdef HAVE_MPI
6 #include "Epetra_MpiComm.h"
7 #else
8 #include "Epetra_SerialComm.h"
9 #endif
10 #include "Epetra_RowMatrix.h"
11 class Epetra_Map;
12 class Epetra_MultiVector;
13 class Epetra_Import;
14 class Epetra_BlockMap;
15 
17 
30 class Amesos_TestRowMatrix : public virtual Epetra_RowMatrix {
31 
32 public:
36  Matrix_(Matrix_in)
37  {}
38 
40 
41  virtual ~Amesos_TestRowMatrix()
43  {}
44 
46 
48 
50 
58  virtual int NumMyRowEntries(int MyRow, int & NumEntries) const
59  {
60  return(Matrix().NumMyRowEntries(MyRow,NumEntries));
61  }
62 
64  virtual int MaxNumEntries() const
65  {
66  return(Matrix().MaxNumEntries());
67  }
68 
70 
84  virtual int ExtractMyRowCopy(int MyRow, int Length, int & NumEntries, double *Values, int * Indices) const
85  {
86  return(Matrix().ExtractMyRowCopy(MyRow,Length, NumEntries,
87  Values, Indices));
88  }
89 
91 
97  virtual int ExtractDiagonalCopy(Epetra_Vector & Diagonal) const
98  {
99  return(Matrix().ExtractDiagonalCopy(Diagonal));
100  }
102 
104 
106 
116  virtual int Multiply(bool TransA, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const
117  {
118  return(Matrix().Multiply(TransA,X,Y));
119  }
120 
122  virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector& X,
123  Epetra_MultiVector& Y) const
124  {
125  return(Matrix().Solve(Upper,Trans,UnitDiagonal,X,Y));
126  }
127 
128  virtual int Apply(const Epetra_MultiVector& X,
129  Epetra_MultiVector& Y) const
130  {
131  return(Matrix().Apply(X,Y));
132  }
133 
134  virtual int ApplyInverse(const Epetra_MultiVector& X,
135  Epetra_MultiVector& Y) const
136  {
137  return(Matrix().ApplyInverse(X,Y));
138  }
140  virtual int InvRowSums(Epetra_Vector& x) const
141  {
142  return(Matrix().InvRowSums(x));
143  }
144 
146  virtual int LeftScale(const Epetra_Vector& x)
147  {
148  return(Matrix().LeftScale(x));
149  }
150 
152  virtual int InvColSums(Epetra_Vector& x) const
153  {
154  return(Matrix().InvColSums(x));
155  }
156 
157 
159  virtual int RightScale(const Epetra_Vector& x)
160  {
161  return(Matrix().RightScale(x));
162  }
163 
165 
167 
169  virtual bool Filled() const
170  {
171  return(Matrix().Filled());
172  }
173 
175  /* Returns the quantity \f$ \| A \|_\infty\f$ such that
176  \f[\| A \|_\infty = \max_{1\lei\len} \sum_{i=1}^m |a_{ij}| \f].
177  */
178  virtual double NormInf() const
179  {
180  return(Matrix().NormInf());
181  }
182 
184  /* Returns the quantity \f$ \| A \|_1\f$ such that
185  \f[\| A \|_1= \max_{1\lej\len} \sum_{j=1}^n |a_{ij}| \f].
186  */
187  virtual double NormOne() const
188  {
189  return(Matrix().NormOne());
190  }
191 
192 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
193  virtual int NumGlobalNonzeros() const
195  {
196  return(Matrix().NumGlobalNonzeros());
197  }
198 
200  virtual int NumGlobalRows() const
201  {
202  return(Matrix().NumGlobalRows());
203  }
204 
206  virtual int NumGlobalCols() const
207  {
208  return(Matrix().NumGlobalCols());
209  }
210 
212  virtual int NumGlobalDiagonals() const
213  {
214  return(Matrix().NumGlobalDiagonals());
215  }
216 #endif
217 
219  virtual long long NumGlobalNonzeros64() const
220  {
221  return(Matrix().NumGlobalNonzeros64());
222  }
223 
225  virtual long long NumGlobalRows64() const
226  {
227  return(Matrix().NumGlobalRows64());
228  }
229 
231  virtual long long NumGlobalCols64() const
232  {
233  return(Matrix().NumGlobalCols64());
234  }
235 
237  virtual long long NumGlobalDiagonals64() const
238  {
239  return(Matrix().NumGlobalDiagonals64());
240  }
241 
243  virtual int NumMyNonzeros() const
244  {
245  return(Matrix().NumMyNonzeros());
246  }
247 
249  virtual int NumMyRows() const
250  {
251  return(Matrix().NumMyRows());
252  }
253 
255  virtual int NumMyCols() const
256  {
257  return(Matrix().NumMyCols());
258  }
259 
261  virtual int NumMyDiagonals() const
262  {
263  return(Matrix().NumMyDiagonals());
264  }
265 
267  virtual bool LowerTriangular() const
268  {
269  return(Matrix_->LowerTriangular());
270  }
271 
273  virtual bool UpperTriangular() const
274  {
275  return(Matrix_->UpperTriangular());
276  }
277 
279  virtual const Epetra_Map & RowMatrixRowMap() const
280  {
281  return(Matrix().RowMatrixRowMap());
282  }
284  virtual const Epetra_Map & RowMatrixColMap() const
285  {
286  return(Matrix().RowMatrixColMap());
287  }
288 
290  virtual const Epetra_Import * RowMatrixImporter() const
291  {
292  return(Matrix().RowMatrixImporter());
293  }
295 
296  // following functions are required to derive Epetra_RowMatrix objects.
297 
298 #ifdef FIXME
299  int SetOwnership(bool ownership)
301  {
302  return(Matrix().SetOwnership(ownership));
303  }
304 #endif
305 
307  int SetUseTranspose(bool UseTranspose_in)
308  {
309  return(Matrix().SetUseTranspose(UseTranspose_in));
310  }
311 
313  bool UseTranspose() const
314  {
315  return(Matrix().UseTranspose());
316  }
317 
319  bool HasNormInf() const
320  {
321  return(Matrix().HasNormInf());
322  }
323 
325  const Epetra_Comm & Comm() const
326  {
327  return(Matrix().Comm());
328  }
329 
331  const Epetra_Map & OperatorDomainMap() const
332  {
333  return(Matrix().OperatorDomainMap());
334  }
335 
337  const Epetra_Map & OperatorRangeMap() const
338  {
339  return(Matrix().OperatorRangeMap());
340  }
342 
343  const Epetra_BlockMap& Map() const
344  {
345  return(Matrix().Map());
346  }
347 
348  const char* Label() const
349  {
350  return(Matrix().Label());
351  }
352 
353 
354 private:
355 
357  {
358  return(*Matrix_);
359  }
360 
361  const Epetra_RowMatrix& Matrix() const
362  {
363  return(*Matrix_);
364  }
365 
368 
369 };
370 
371 #endif /* IFPACK_ROWMATRIX_H */
372 
Amesos_TestRowMatrix::Matrix_
Epetra_RowMatrix * Matrix_
Pointer to the matrix to be preconditioned.
Definition: Amesos_TestRowMatrix.h:367
Epetra_RowMatrix::UpperTriangular
virtual bool UpperTriangular() const=0
Amesos_TestRowMatrix::NumGlobalRows
virtual int NumGlobalRows() const
Returns the number of global matrix rows.
Definition: Amesos_TestRowMatrix.h:200
Amesos_TestRowMatrix::Solve
virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns result of a local-only solve using a triangular Epetra_RowMatrix with Epetra_MultiVectors X a...
Definition: Amesos_TestRowMatrix.h:122
Amesos_TestRowMatrix::NumMyRowEntries
virtual int NumMyRowEntries(int MyRow, int &NumEntries) const
Returns the number of nonzero entries in MyRow.
Definition: Amesos_TestRowMatrix.h:58
Amesos_TestRowMatrix::UpperTriangular
virtual bool UpperTriangular() const
If matrix is upper triangular in local index space, this query returns true, otherwise it returns fal...
Definition: Amesos_TestRowMatrix.h:273
Epetra_RowMatrix.h
Amesos_TestRowMatrix::InvColSums
virtual int InvColSums(Epetra_Vector &x) const
Computes the sum of absolute values of the columns of the Epetra_RowMatrix, results returned in x (NO...
Definition: Amesos_TestRowMatrix.h:152
Amesos_TestRowMatrix::NormInf
virtual double NormInf() const
Returns the infinity norm of the global matrix.
Definition: Amesos_TestRowMatrix.h:178
Amesos_TestRowMatrix::Label
const char * Label() const
Definition: Amesos_TestRowMatrix.h:348
Amesos_TestRowMatrix::Amesos_TestRowMatrix
Amesos_TestRowMatrix(Epetra_RowMatrix *Matrix_in)
Constructor.
Definition: Amesos_TestRowMatrix.h:35
Amesos_TestRowMatrix::Map
const Epetra_BlockMap & Map() const
Definition: Amesos_TestRowMatrix.h:343
Amesos_TestRowMatrix::NumGlobalDiagonals64
virtual long long NumGlobalDiagonals64() const
Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
Definition: Amesos_TestRowMatrix.h:237
Amesos_TestRowMatrix::NumGlobalDiagonals
virtual int NumGlobalDiagonals() const
Returns the number of global nonzero diagonal entries, based on global row/column index comparisons.
Definition: Amesos_TestRowMatrix.h:212
Epetra_Comm
Epetra_SerialComm.h
Amesos_TestRowMatrix::NumMyDiagonals
virtual int NumMyDiagonals() const
Returns the number of local nonzero diagonal entries, based on global row/column index comparisons.
Definition: Amesos_TestRowMatrix.h:261
Epetra_MpiComm.h
Amesos_TestRowMatrix::LeftScale
virtual int LeftScale(const Epetra_Vector &x)
Scales the Epetra_RowMatrix on the left with a Epetra_Vector x (NOT IMPLEMENTED).
Definition: Amesos_TestRowMatrix.h:146
Amesos_TestRowMatrix
Amesos_TestRowMatrix: a class to test Epetra_RowMatrix based codes.
Definition: Amesos_TestRowMatrix.h:30
Amesos_TestRowMatrix::NumGlobalCols64
virtual long long NumGlobalCols64() const
Returns the number of global matrix columns.
Definition: Amesos_TestRowMatrix.h:231
Amesos_TestRowMatrix::Multiply
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_RowMatrix multiplied by a Epetra_MultiVector X in Y.
Definition: Amesos_TestRowMatrix.h:116
Amesos_TestRowMatrix::NumMyNonzeros
virtual int NumMyNonzeros() const
Returns the number of nonzero entries in the calling processor's portion of the matrix.
Definition: Amesos_TestRowMatrix.h:243
Amesos_TestRowMatrix::Matrix
const Epetra_RowMatrix & Matrix() const
Definition: Amesos_TestRowMatrix.h:361
Epetra_RowMatrix
Amesos_TestRowMatrix::RowMatrixRowMap
virtual const Epetra_Map & RowMatrixRowMap() const
Returns the Epetra_Map object associated with the rows of this matrix.
Definition: Amesos_TestRowMatrix.h:279
Amesos_TestRowMatrix::SetUseTranspose
int SetUseTranspose(bool UseTranspose_in)
Sets use transpose (not implemented).
Definition: Amesos_TestRowMatrix.h:307
Amesos_TestRowMatrix::Filled
virtual bool Filled() const
If FillComplete() has been called, this query returns true, otherwise it returns false.
Definition: Amesos_TestRowMatrix.h:169
Amesos_TestRowMatrix::NumGlobalCols
virtual int NumGlobalCols() const
Returns the number of global matrix columns.
Definition: Amesos_TestRowMatrix.h:206
Amesos_TestRowMatrix::Matrix
Epetra_RowMatrix & Matrix()
Definition: Amesos_TestRowMatrix.h:356
Amesos_TestRowMatrix::UseTranspose
bool UseTranspose() const
Returns the current UseTranspose setting.
Definition: Amesos_TestRowMatrix.h:313
Epetra_BlockMap
Epetra_RowMatrix::LowerTriangular
virtual bool LowerTriangular() const=0
Epetra_Vector
Amesos_TestRowMatrix::NumGlobalRows64
virtual long long NumGlobalRows64() const
Returns the number of global matrix rows.
Definition: Amesos_TestRowMatrix.h:225
Amesos_TestRowMatrix::HasNormInf
bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Definition: Amesos_TestRowMatrix.h:319
Amesos_TestRowMatrix::ExtractMyRowCopy
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
Returns a copy of the specified local row in user-provided arrays.
Definition: Amesos_TestRowMatrix.h:84
Amesos_TestRowMatrix::OperatorDomainMap
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
Definition: Amesos_TestRowMatrix.h:331
Amesos_TestRowMatrix::MaxNumEntries
virtual int MaxNumEntries() const
Returns the maximum of NumMyRowEntries() over all rows.
Definition: Amesos_TestRowMatrix.h:64
Amesos_TestRowMatrix::~Amesos_TestRowMatrix
virtual ~Amesos_TestRowMatrix()
Destructor.
Definition: Amesos_TestRowMatrix.h:42
Amesos_TestRowMatrix::NumMyRows
virtual int NumMyRows() const
Returns the number of matrix rows owned by the calling processor.
Definition: Amesos_TestRowMatrix.h:249
Amesos_ConfigDefs.h
Amesos_TestRowMatrix::NumGlobalNonzeros64
virtual long long NumGlobalNonzeros64() const
Returns the number of nonzero entries in the global matrix.
Definition: Amesos_TestRowMatrix.h:219
Amesos_TestRowMatrix::RowMatrixColMap
virtual const Epetra_Map & RowMatrixColMap() const
Returns the Epetra_Map object associated with the columns of this matrix.
Definition: Amesos_TestRowMatrix.h:284
Amesos_TestRowMatrix::Comm
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
Definition: Amesos_TestRowMatrix.h:325
Epetra_MultiVector
Amesos_TestRowMatrix::LowerTriangular
virtual bool LowerTriangular() const
If matrix is lower triangular in local index space, this query returns true, otherwise it returns fal...
Definition: Amesos_TestRowMatrix.h:267
Amesos_TestRowMatrix::NormOne
virtual double NormOne() const
Returns the one norm of the global matrix.
Definition: Amesos_TestRowMatrix.h:187
Amesos_TestRowMatrix::RowMatrixImporter
virtual const Epetra_Import * RowMatrixImporter() const
Returns the Epetra_Import object that contains the import operations for distributed operations.
Definition: Amesos_TestRowMatrix.h:290
Amesos_TestRowMatrix::RightScale
virtual int RightScale(const Epetra_Vector &x)
Scales the Epetra_RowMatrix on the right with a Epetra_Vector x (NOT IMPLEMENTED).
Definition: Amesos_TestRowMatrix.h:159
Amesos_TestRowMatrix::InvRowSums
virtual int InvRowSums(Epetra_Vector &x) const
Computes the sum of absolute values of the rows of the Epetra_RowMatrix, results returned in x (NOT I...
Definition: Amesos_TestRowMatrix.h:140
Amesos_TestRowMatrix::Apply
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Definition: Amesos_TestRowMatrix.h:128
Amesos_TestRowMatrix::OperatorRangeMap
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
Definition: Amesos_TestRowMatrix.h:337
Amesos_TestRowMatrix::ExtractDiagonalCopy
virtual int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
Returns a copy of the main diagonal in a user-provided vector.
Definition: Amesos_TestRowMatrix.h:97
Amesos_TestRowMatrix::ApplyInverse
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Definition: Amesos_TestRowMatrix.h:134
Epetra_Map
Amesos_TestRowMatrix::NumGlobalNonzeros
virtual int NumGlobalNonzeros() const
Returns the number of nonzero entries in the global matrix.
Definition: Amesos_TestRowMatrix.h:194
Epetra_Import
Amesos_TestRowMatrix::NumMyCols
virtual int NumMyCols() const
Returns the number of matrix columns owned by the calling processor.
Definition: Amesos_TestRowMatrix.h:255