Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Amesos_TestRowMatrix.h
Go to the documentation of this file.
1 #ifndef IFPACK_ROWMATRIX_H
2 #define IFPACK_ROWMATRIX_H
3 
4 #if defined(Amesos_SHOW_DEPRECATED_WARNINGS)
5 #ifdef __GNUC__
6 #warning "The Amesos package is deprecated"
7 #endif
8 #endif
9 
10 #include "Amesos_ConfigDefs.h"
11 #ifdef HAVE_MPI
12 #include "Epetra_MpiComm.h"
13 #else
14 #include "Epetra_SerialComm.h"
15 #endif
16 #include "Epetra_RowMatrix.h"
17 class Epetra_Map;
18 class Epetra_MultiVector;
19 class Epetra_Import;
20 class Epetra_BlockMap;
21 
23 
36 class Amesos_TestRowMatrix : public virtual Epetra_RowMatrix {
37 
38 public:
42  Matrix_(Matrix_in)
43  {}
44 
46 
47  virtual ~Amesos_TestRowMatrix()
49  {}
50 
52 
54 
56 
64  virtual int NumMyRowEntries(int MyRow, int & NumEntries) const
65  {
66  return(Matrix().NumMyRowEntries(MyRow,NumEntries));
67  }
68 
70  virtual int MaxNumEntries() const
71  {
72  return(Matrix().MaxNumEntries());
73  }
74 
76 
90  virtual int ExtractMyRowCopy(int MyRow, int Length, int & NumEntries, double *Values, int * Indices) const
91  {
92  return(Matrix().ExtractMyRowCopy(MyRow,Length, NumEntries,
93  Values, Indices));
94  }
95 
97 
103  virtual int ExtractDiagonalCopy(Epetra_Vector & Diagonal) const
104  {
105  return(Matrix().ExtractDiagonalCopy(Diagonal));
106  }
108 
110 
112 
122  virtual int Multiply(bool TransA, const Epetra_MultiVector& X, Epetra_MultiVector& Y) const
123  {
124  return(Matrix().Multiply(TransA,X,Y));
125  }
126 
128  virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector& X,
129  Epetra_MultiVector& Y) const
130  {
131  return(Matrix().Solve(Upper,Trans,UnitDiagonal,X,Y));
132  }
133 
134  virtual int Apply(const Epetra_MultiVector& X,
135  Epetra_MultiVector& Y) const
136  {
137  return(Matrix().Apply(X,Y));
138  }
139 
140  virtual int ApplyInverse(const Epetra_MultiVector& X,
141  Epetra_MultiVector& Y) const
142  {
143  return(Matrix().ApplyInverse(X,Y));
144  }
146  virtual int InvRowSums(Epetra_Vector& x) const
147  {
148  return(Matrix().InvRowSums(x));
149  }
150 
152  virtual int LeftScale(const Epetra_Vector& x)
153  {
154  return(Matrix().LeftScale(x));
155  }
156 
158  virtual int InvColSums(Epetra_Vector& x) const
159  {
160  return(Matrix().InvColSums(x));
161  }
162 
163 
165  virtual int RightScale(const Epetra_Vector& x)
166  {
167  return(Matrix().RightScale(x));
168  }
169 
171 
173 
175  virtual bool Filled() const
176  {
177  return(Matrix().Filled());
178  }
179 
181  /* Returns the quantity \f$ \| A \|_\infty\f$ such that
182  \f[\| A \|_\infty = \max_{1\lei\len} \sum_{i=1}^m |a_{ij}| \f].
183  */
184  virtual double NormInf() const
185  {
186  return(Matrix().NormInf());
187  }
188 
190  /* Returns the quantity \f$ \| A \|_1\f$ such that
191  \f[\| A \|_1= \max_{1\lej\len} \sum_{j=1}^n |a_{ij}| \f].
192  */
193  virtual double NormOne() const
194  {
195  return(Matrix().NormOne());
196  }
197 
198 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
199  virtual int NumGlobalNonzeros() const
201  {
202  return(Matrix().NumGlobalNonzeros());
203  }
204 
206  virtual int NumGlobalRows() const
207  {
208  return(Matrix().NumGlobalRows());
209  }
210 
212  virtual int NumGlobalCols() const
213  {
214  return(Matrix().NumGlobalCols());
215  }
216 
218  virtual int NumGlobalDiagonals() const
219  {
220  return(Matrix().NumGlobalDiagonals());
221  }
222 #endif
223 
225  virtual long long NumGlobalNonzeros64() const
226  {
227  return(Matrix().NumGlobalNonzeros64());
228  }
229 
231  virtual long long NumGlobalRows64() const
232  {
233  return(Matrix().NumGlobalRows64());
234  }
235 
237  virtual long long NumGlobalCols64() const
238  {
239  return(Matrix().NumGlobalCols64());
240  }
241 
243  virtual long long NumGlobalDiagonals64() const
244  {
245  return(Matrix().NumGlobalDiagonals64());
246  }
247 
249  virtual int NumMyNonzeros() const
250  {
251  return(Matrix().NumMyNonzeros());
252  }
253 
255  virtual int NumMyRows() const
256  {
257  return(Matrix().NumMyRows());
258  }
259 
261  virtual int NumMyCols() const
262  {
263  return(Matrix().NumMyCols());
264  }
265 
267  virtual int NumMyDiagonals() const
268  {
269  return(Matrix().NumMyDiagonals());
270  }
271 
273  virtual bool LowerTriangular() const
274  {
275  return(Matrix_->LowerTriangular());
276  }
277 
279  virtual bool UpperTriangular() const
280  {
281  return(Matrix_->UpperTriangular());
282  }
283 
285  virtual const Epetra_Map & RowMatrixRowMap() const
286  {
287  return(Matrix().RowMatrixRowMap());
288  }
290  virtual const Epetra_Map & RowMatrixColMap() const
291  {
292  return(Matrix().RowMatrixColMap());
293  }
294 
296  virtual const Epetra_Import * RowMatrixImporter() const
297  {
298  return(Matrix().RowMatrixImporter());
299  }
301 
302  // following functions are required to derive Epetra_RowMatrix objects.
303 
304 #ifdef FIXME
305  int SetOwnership(bool ownership)
307  {
308  return(Matrix().SetOwnership(ownership));
309  }
310 #endif
311 
313  int SetUseTranspose(bool UseTranspose_in)
314  {
315  return(Matrix().SetUseTranspose(UseTranspose_in));
316  }
317 
319  bool UseTranspose() const
320  {
321  return(Matrix().UseTranspose());
322  }
323 
325  bool HasNormInf() const
326  {
327  return(Matrix().HasNormInf());
328  }
329 
331  const Epetra_Comm & Comm() const
332  {
333  return(Matrix().Comm());
334  }
335 
337  const Epetra_Map & OperatorDomainMap() const
338  {
339  return(Matrix().OperatorDomainMap());
340  }
341 
343  const Epetra_Map & OperatorRangeMap() const
344  {
345  return(Matrix().OperatorRangeMap());
346  }
348 
349  const Epetra_BlockMap& Map() const
350  {
351  return(Matrix().Map());
352  }
353 
354  const char* Label() const
355  {
356  return(Matrix().Label());
357  }
358 
359 
360 private:
361 
363  {
364  return(*Matrix_);
365  }
366 
367  const Epetra_RowMatrix& Matrix() const
368  {
369  return(*Matrix_);
370  }
371 
374 
375 };
376 
377 #endif /* IFPACK_ROWMATRIX_H */
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...
virtual int NumGlobalNonzeros() const
Returns the number of nonzero entries in the global matrix.
Epetra_RowMatrix & Matrix()
const char * Label() const
virtual long long NumGlobalRows64() const
Returns the number of global matrix rows.
virtual int MaxNumEntries() const
Returns the maximum of NumMyRowEntries() over all rows.
bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
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...
virtual long long NumGlobalCols64() const
Returns the number of global matrix columns.
virtual int LeftScale(const Epetra_Vector &x)
Scales the Epetra_RowMatrix on the left with a Epetra_Vector x (NOT IMPLEMENTED). ...
virtual int NumMyRows() const
Returns the number of matrix rows owned by the calling processor.
const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
virtual bool Filled() const
If FillComplete() has been called, this query returns true, otherwise it returns false.
virtual const Epetra_Map & RowMatrixColMap() const
Returns the Epetra_Map object associated with the columns of this matrix.
const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
Amesos_TestRowMatrix: a class to test Epetra_RowMatrix based codes.
const Epetra_RowMatrix & Matrix() const
virtual int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
Returns a copy of the main diagonal in a user-provided vector.
virtual bool LowerTriangular() const =0
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.
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.
virtual bool LowerTriangular() const
If matrix is lower triangular in local index space, this query returns true, otherwise it returns fal...
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...
Epetra_RowMatrix * Matrix_
Pointer to the matrix to be preconditioned.
const Epetra_BlockMap & Map() const
virtual int NumMyNonzeros() const
Returns the number of nonzero entries in the calling processor's portion of the matrix.
virtual int NumMyRowEntries(int MyRow, int &NumEntries) const
Returns the number of nonzero entries in MyRow.
virtual ~Amesos_TestRowMatrix()
Destructor.
virtual int NumMyDiagonals() const
Returns the number of local nonzero diagonal entries, based on global row/column index comparisons...
virtual double NormInf() const
Returns the infinity norm of the global matrix.
const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
virtual const Epetra_Map & RowMatrixRowMap() const
Returns the Epetra_Map object associated with the rows of this matrix.
virtual int NumGlobalRows() const
Returns the number of global matrix rows.
virtual const Epetra_Import * RowMatrixImporter() const
Returns the Epetra_Import object that contains the import operations for distributed operations...
virtual int NumMyCols() const
Returns the number of matrix columns owned by the calling processor.
virtual int RightScale(const Epetra_Vector &x)
Scales the Epetra_RowMatrix on the right with a Epetra_Vector x (NOT IMPLEMENTED).
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual long long NumGlobalDiagonals64() const
Returns the number of global nonzero diagonal entries, based on global row/column index comparisons...
virtual int NumGlobalDiagonals() const
Returns the number of global nonzero diagonal entries, based on global row/column index comparisons...
virtual double NormOne() const
Returns the one norm of the global matrix.
virtual bool UpperTriangular() const =0
virtual long long NumGlobalNonzeros64() const
Returns the number of nonzero entries in the global matrix.
int SetUseTranspose(bool UseTranspose_in)
Sets use transpose (not implemented).
bool UseTranspose() const
Returns the current UseTranspose setting.
virtual int NumGlobalCols() const
Returns the number of global matrix columns.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual bool UpperTriangular() const
If matrix is upper triangular in local index space, this query returns true, otherwise it returns fal...
Amesos_TestRowMatrix(Epetra_RowMatrix *Matrix_in)
Constructor.