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 #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 
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.