44 #ifndef IFPACK_SERIALTRIDIMATRIX_H 45 #define IFPACK_SERIALTRIDIMATRIX_H 47 #include "Epetra_ConfigDefs.h" 48 #include "Epetra_Object.h" 49 #include "Epetra_CompObject.h" 50 #include "Epetra_BLAS.h" 145 bool set_object_label=
true);
168 int Shape(
int NumRowCol);
170 int Reshape(
int,
int);
195 int Multiply(
char TransA,
char TransB,
double ScalarAB,
238 int Scale(
double ScalarA);
244 virtual double NormOne()
const;
247 virtual double NormInf()
const;
273 {
return !(*
this == rhs); }
294 double& operator () (
int RowIndex,
int ColIndex);
306 const double& operator () (
int RowIndex,
int ColIndex)
const;
344 int N()
const {
return(N_);};
346 int LDA()
const {
return(LDA_);};
349 double*
A()
const {
return(A_);};
354 double*
DL() {
return DL_;};
355 double* DL()
const {
return DL_;};
356 double* D() {
return D_;};
357 double* D()
const {
return D_;};
358 double* DU() {
return DU_;};
359 double* DU()
const {
return DU_;};
360 double* DU2() {
return DU2_;};
361 double* DU2()
const {
return DU2_;};
369 virtual void Print(std::ostream& os)
const;
380 virtual double OneNorm()
const {
return(NormOne());};
383 virtual double InfNorm()
const {
return(NormInf());};
399 virtual int SetUseTranspose(
bool UseTranspose_in) { UseTranspose_ = UseTranspose_in;
return (0); }
433 void CopyMat(
const double* Source,
int NumRowCol,
434 double* Target,
int NRC2,
bool add=
false);
462 int diff = ColIndex - RowIndex;
464 #ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK 465 if (ColIndex >= N_ || ColIndex < 0)
466 throw ReportError(
"Column index = " +toString(ColIndex) +
467 " Out of Range 0 - " + toString(N_-1),-2);
468 if (RowIndex >= N_ || RowIndex < 0)
469 throw ReportError(
"Row index = " +toString(RowIndex) +
470 " Out of Range 0 - " + toString(N_-1),-2);
472 if ( diff > 1 || diff < -1 )
473 throw ReportError(
"Row index = " +toString(RowIndex) +
" differs from Col_Index " + toString(ColIndex) +
474 " Out of Range -1 to 1",-2);
480 return DL_[ColIndex];
486 return DU_[RowIndex];
489 throw ReportError(
"Row index = " +toString(RowIndex) +
" differs from Col_Index " + toString(ColIndex) +
" Out of Range -1 to 1",1);
492 throw ReportError(
"Row index = " +toString(RowIndex) +
" differs from Col_Index " + toString(ColIndex) +
" Out of Range -1 to 1",1);
497 int diff = ColIndex - RowIndex;
499 #ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK 500 if (ColIndex >= N_ || ColIndex < 0)
501 throw ReportError(
"Column index = " +toString(ColIndex) +
502 " Out of Range 0 - " + toString(N_-1),-2);
503 if (RowIndex >= N_ || RowIndex < 0)
504 throw ReportError(
"Row index = " +toString(RowIndex) +
505 " Out of Range 0 - " + toString(N_-1),-2);
506 if ( diff > 1 || diff < -1 )
507 throw ReportError(
"Row index = " +toString(RowIndex) +
" differs from Col_Index " + toString(ColIndex) +
" Out of Range -1 to 1",-2);
512 return DL_[ColIndex];
518 return DU_[RowIndex];
521 throw ReportError(
"Row index = " +toString(RowIndex) +
" differs from Col_Index " + toString(ColIndex) +
" Out of Range -1 to 1",-2);
Epetra_DataAccess CV() const
Returns the data access mode of the this matrix.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
int N() const
Returns column dimension of system.
virtual void Print(std::ostream &os) const
virtual int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied.
double * A() const
Returns pointer to the this matrix.
double * DL()
Returns pointer to the this matrix.
virtual double InfNorm() const
Computes the Infinity-Norm of the this matrix (identical to NormInf() method).
virtual int ApplyInverse(const Ifpack_SerialTriDiMatrix &X, Ifpack_SerialTriDiMatrix &Y)
Returns the result of a Ifpack_SerialTriDiOperator inverse applied to an Ifpack_SerialTriDiMatrix X i...
virtual const char * Label() const
double & operator()(int RowIndex, int ColIndex)
Element access function.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual int RowColDim() const
Returns the column dimension of operator.
virtual double OneNorm() const
Computes the 1-Norm of the this matrix (identical to NormOne() method).
Ifpack_SerialTriDiMatrix: A class for constructing and using real double precision general TriDi matr...
virtual int ReportError(const std::string Message, int ErrorCode) const
virtual const char * Label() const
Returns a character string describing the operator.
bool operator!=(const Ifpack_SerialTriDiMatrix &rhs) const
Inequality operator.