43#ifndef IFPACK_TRIDICONTAINER_H
44#define IFPACK_TRIDICONTAINER_H
46#if defined(Ifpack_SHOW_DEPRECATED_WARNINGS)
48#warning "The Ifpack package is deprecated"
52#include "Ifpack_ConfigDefs.h"
53#include "Ifpack_Container.h"
54#include "Ifpack_SerialTriDiMatrix.h"
55#include "Ifpack_SerialTriDiSolver.h"
56#include "Epetra_IntSerialDenseVector.h"
57#include "Epetra_SerialDenseVector.h"
132 NumRows_(NumRows_in),
133 NumVectors_(NumVectors_in),
134 KeepNonFactoredMatrix_(false),
135 IsInitialized_(false),
139 ApplyInverseFlops_(0.0)
151 if (KeepNonFactoredMatrix_)
176 if (KeepNonFactoredMatrix_)
201 if (NumVectors_ == NumVectors_in)
204 NumVectors_ = NumVectors_in;
205 IFPACK_CHK_ERR(RHS_.
Reshape(NumRows_,NumVectors_));
206 IFPACK_CHK_ERR(LHS_.
Reshape(NumRows_,NumVectors_));
208 for (
int i = 0 ; i < NumRows_ ; ++i)
209 for (
int j = 0 ; j < NumVectors_ ; ++j) {
215 IFPACK_CHK_ERR(Solver_.
SetVectors(LHS_,RHS_));
221 virtual double&
LHS(
const int i,
const int Vector = 0);
224 virtual double&
RHS(
const int i,
const int Vector = 0);
236 virtual int&
ID(
const int i);
251 return(IsInitialized_);
263 return(Label_.c_str());
269 KeepNonFactoredMatrix_ = flag;
276 return(KeepNonFactoredMatrix_);
300 return(NonFactoredMatrix_);
333 return(ComputeFlops_);
343 return(ApplyInverseFlops_);
347 virtual std::ostream&
Print(std::ostream& os)
const;
371 bool KeepNonFactoredMatrix_;
380 double ComputeFlops_;
384 double ApplyInverseFlops_;
int Reshape(int NumRows, int NumCols)
Ifpack_Container: a pure virtual class for creating and solving local linear problems.
Ifpack_SerialTriDiMatrix: A class for constructing and using real double precision general TriDi matr...
Ifpack_SerialTriDiSolver: A class for solving TriDi linear problems.
int SetVectors(Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &B)
Sets the pointers for left and right hand side vector(s).
Ifpack_TriDiContainer: a class to define containers for dense matrices.
virtual double ComputeFlops() const
Returns the flops in Compute().
virtual bool IsInitialized() const
Returns true is the container has been successfully initialized.
virtual int Compute(const Epetra_RowMatrix &Matrix_in)
Finalizes the linear system matrix and prepares for the application of the inverse.
virtual int ApplyInverse()
Apply the inverse of the matrix to RHS, results are stored in LHS.
virtual double & LHS(const int i, const int Vector=0)
Returns the i-th component of the vector Vector of LHS.
virtual const char * Label() const
Returns the label of this container.
virtual const Ifpack_SerialTriDiMatrix & NonFactoredMatrix() const
Returns the non-factored dense matrix (only if stored).
virtual double & RHS(const int i, const int Vector=0)
Returns the i-th component of the vector Vector of RHS.
virtual const Epetra_SerialDenseMatrix & RHS() const
Returns the dense vector containing the RHS.
virtual int Initialize()
Initialize the container.
Ifpack_TriDiContainer(const Ifpack_TriDiContainer &rhs)
Copy constructor.
virtual int Apply()
Apply the matrix to RHS, results are stored in LHS.
virtual double ApplyInverseFlops() const
Returns the flops in ApplyInverse().
virtual int SetKeepNonFactoredMatrix(const bool flag)
If flag is true, keeps a copy of the non-factored matrix.
Ifpack_TriDiContainer(const int NumRows_in, const int NumVectors_in=1)
Default constructor.
virtual double ApplyFlops() const
Returns the flops in Apply().
virtual int SetMatrixElement(const int row, const int col, const double value)
Set the matrix element (row,col) to value.
virtual int SetParameters(Teuchos::ParameterList &)
Sets all necessary parameters.
virtual const Epetra_IntSerialDenseVector & ID() const
Returns the integer dense vector of IDs.
Ifpack_TriDiContainer & operator=(const Ifpack_TriDiContainer &rhs)
Operator=.
virtual const Ifpack_SerialTriDiMatrix & Matrix() const
Returns the dense matrix or its factors.
virtual int NumRows() const
Returns the number of rows of the matrix and LHS/RHS.
virtual int SetNumVectors(const int NumVectors_in)
Sets the number of vectors for LHS/RHS.
virtual bool KeepNonFactoredMatrix() const
Returns KeepNonFactoredMatrix_.
virtual bool IsComputed() const
Returns true is the container has been successfully computed.
virtual int & ID(const int i)
Returns the ID associated to local row i.
virtual double InitializeFlops() const
Returns the flops in Initialize().
virtual const Epetra_SerialDenseMatrix & LHS() const
Returns the dense vector containing the LHS.
virtual ~Ifpack_TriDiContainer()
Destructor.
virtual std::ostream & Print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
virtual int NumVectors() const
Returns the number of vectors in LHS/RHS.