44 #ifndef IFPACK_SERIALTRIDIMATRIX_H
45 #define IFPACK_SERIALTRIDIMATRIX_H
47 #if defined(Ifpack_SHOW_DEPRECATED_WARNINGS)
49 #warning "The Ifpack package is deprecated"
53 #include "Epetra_ConfigDefs.h"
54 #include "Epetra_Object.h"
55 #include "Epetra_CompObject.h"
56 #include "Epetra_BLAS.h"
151 bool set_object_label=
true);
174 int Shape(
int NumRowCol);
201 int Multiply(
char TransA,
char TransB,
double ScalarAB,
244 int Scale(
double ScalarA);
250 virtual double NormOne()
const;
253 virtual double NormInf()
const;
279 {
return !(*
this == rhs); }
312 const double&
operator () (
int RowIndex,
int ColIndex)
const;
350 int N()
const {
return(
N_);};
355 double*
A()
const {
return(
A_);};
362 double*
D() {
return D_;};
363 double*
D()
const {
return D_;};
375 virtual void Print(std::ostream& os)
const;
425 virtual const char *
Label()
const {
return Epetra_Object::Label(); }
439 void CopyMat(
const double* Source,
int NumRowCol,
440 double* Target,
int NRC2,
bool add=
false);
468 int diff = ColIndex - RowIndex;
470 #ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
471 if (ColIndex >=
N_ || ColIndex < 0)
472 throw ReportError(
"Column index = " +
toString(ColIndex) +
474 if (RowIndex >=
N_ || RowIndex < 0)
475 throw ReportError(
"Row index = " +
toString(RowIndex) +
478 if ( diff > 1 || diff < -1 )
479 throw ReportError(
"Row index = " +
toString(RowIndex) +
" differs from Col_Index " +
toString(ColIndex) +
480 " Out of Range -1 to 1",-2);
486 return DL_[ColIndex];
492 return DU_[RowIndex];
495 throw ReportError(
"Row index = " +
toString(RowIndex) +
" differs from Col_Index " +
toString(ColIndex) +
" Out of Range -1 to 1",1);
503 int diff = ColIndex - RowIndex;
505 #ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
506 if (ColIndex >=
N_ || ColIndex < 0)
507 throw ReportError(
"Column index = " +
toString(ColIndex) +
509 if (RowIndex >=
N_ || RowIndex < 0)
510 throw ReportError(
"Row index = " +
toString(RowIndex) +
512 if ( diff > 1 || diff < -1 )
513 throw ReportError(
"Row index = " +
toString(RowIndex) +
" differs from Col_Index " +
toString(ColIndex) +
" Out of Range -1 to 1",-2);
518 return DL_[ColIndex];
524 return DU_[RowIndex];
527 throw ReportError(
"Row index = " +
toString(RowIndex) +
" differs from Col_Index " +
toString(ColIndex) +
" Out of Range -1 to 1",-2);
int Shape(int NumRowCol)
Set dimensions of a Ifpack_SerialTriDiMatrix object; init values to zero.
bool operator==(const Ifpack_SerialTriDiMatrix &rhs) const
Comparison operator.
void CopyMat(const double *Source, int NumRowCol, double *Target, int NRC2, bool add=false)
std::string toString(const int &x)
virtual double NormOne() const
Computes the 1-Norm of the this matrix.
bool operator!=(const Ifpack_SerialTriDiMatrix &rhs) const
Inequality operator.
virtual int SetUseTranspose(bool UseTranspose_in)
If set true, transpose of this operator will be applied.
Epetra_DataAccess CV() const
Returns the data access mode of the this matrix.
virtual double OneNorm() const
Computes the 1-Norm of the this matrix (identical to NormOne() method).
double * DL()
Returns pointer to the this matrix.
double * A() const
Returns pointer to the this matrix.
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 double InfNorm() const
Computes the Infinity-Norm of the this matrix (identical to NormInf() method).
double & operator()(int RowIndex, int ColIndex)
Element access function.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Ifpack_SerialTriDiMatrix & operator+=(const Ifpack_SerialTriDiMatrix &Source)
Add one matrix to another.
virtual double NormInf() const
Computes the Infinity-Norm of the this matrix.
int N() const
Returns column dimension of system.
virtual void Print(std::ostream &os) const
Print service methods; defines behavior of ostream << operator.
Ifpack_SerialTriDiMatrix: A class for constructing and using real double precision general TriDi matr...
virtual const char * Label() const
Returns a character string describing the operator.
Ifpack_SerialTriDiMatrix & operator=(const Ifpack_SerialTriDiMatrix &Source)
Value copy from one matrix to another.
int Random()
Column access function.
int Scale(double ScalarA)
Matrix-Vector multiplication, y = A*x, where 'this' == A.
Ifpack_SerialTriDiMatrix(bool set_object_label=true)
Default constructor; defines a zero size object.
virtual ~Ifpack_SerialTriDiMatrix()
Ifpack_SerialTriDiMatrix destructor.
int Multiply(char TransA, char TransB, double ScalarAB, const Ifpack_SerialTriDiMatrix &A, const Ifpack_SerialTriDiMatrix &B, double ScalarThis)
Matrix-Matrix multiplication, this = ScalarThis*this + ScalarAB*A*B.
virtual int RowColDim() const
Returns the column dimension of operator.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.