109 if ((row < 0) || (row >=
NumRows())) {
113 if ((col < 0) || (col >=
NumRows())) {
134#ifdef IFPACK_FLOPCOUNTERS
151 for (
int j = 0 ; j <
NumRows_ ; ++j) {
156 if (
ID(j) > Matrix_in.NumMyRows())
161 int Length = Matrix_in.MaxNumEntries();
162 std::vector<double> Values;
163 Values.resize(Length);
164 std::vector<int> Indices;
165 Indices.resize(Length);
167 for (
int j = 0 ; j <
NumRows_ ; ++j) {
174 Matrix_in.ExtractMyRowCopy(LRID, Length, NumEntries,
175 &Values[0], &Indices[0]);
178 for (
int k = 0 ; k < NumEntries ; ++k) {
180 int LCID = Indices[k];
183 if (LCID >= Matrix_in.NumMyRows())
190 for (
int kk = 0 ; kk <
NumRows_ ; ++kk)
224 Label_ =
"Ifpack_DenseContainer";
227#ifdef IFPACK_FLOPCOUNTERS
247#ifdef IFPACK_FLOPCOUNTERS
258 os <<
"================================================================================" << endl;
259 os <<
"Ifpack_DenseContainer" << endl;
260 os <<
"Number of rows = " <<
NumRows() << endl;
261 os <<
"Number of vectors = " <<
NumVectors() << endl;
263 os <<
"IsComputed() = " <<
IsComputed() << endl;
264#ifdef IFPACK_FLOPCOUNTERS
265 os <<
"Flops in Compute() = " <<
ComputeFlops() << endl;
268 os <<
"================================================================================" << endl;
#define IFPACK_CHK_ERR(ifpack_err)
int Reshape(int NumRows, int NumCols)
int Multiply(char TransA, char TransB, double ScalarAB, const Epetra_SerialDenseMatrix &A, const Epetra_SerialDenseMatrix &B, double ScalarThis)
int Reshape(int NumRows, int NumCols)
int SetMatrix(Epetra_SerialDenseMatrix &A)
int SetVectors(Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &B)
int NumRows_
Number of rows in the container.
std::string Label_
Label for this object.
virtual int NumRows() const
Returns the number of rows of the matrix and LHS/RHS.
virtual int NumVectors() const
Returns the number of vectors in LHS/RHS.
virtual int ApplyInverse()
Apply the inverse of the matrix to RHS, results are stored in LHS.
virtual bool IsInitialized() const
Returns true is the container has been successfully initialized.
virtual int Apply()
Apply the matrix to RHS, results are stored in LHS.
virtual int SetMatrixElement(const int row, const int col, const double value)
Set the matrix element (row,col) to value.
Epetra_SerialDenseMatrix Matrix_
Dense matrix.
bool IsComputed_
If true, the container has been successfully computed.
virtual double ApplyInverseFlops() const
Returns the flops in ApplyInverse().
bool KeepNonFactoredMatrix_
If true, keeps a copy of the non-factored matrix.
virtual int Compute(const Epetra_RowMatrix &Matrix_in)
Finalizes the linear system matrix and prepares for the application of the inverse.
double ApplyFlops_
Flops in Apply().
Epetra_SerialDenseMatrix LHS_
Dense vector representing the LHS.
virtual int Initialize()
Initialize the container.
virtual bool IsComputed() const
Returns true is the container has been successfully computed.
virtual int Extract(const Epetra_RowMatrix &Matrix_in)
Extract the submatrices identified by the ID set int ID().
virtual double ComputeFlops() const
Returns the flops in Compute().
virtual const Epetra_SerialDenseMatrix & LHS() const
Returns the dense vector containing the LHS.
bool IsInitialized_
If true, the container has been successfully initialized.
int NumVectors_
Number of vectors in the container.
virtual std::ostream & Print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
virtual int & ID(const int i)
Returns the ID associated to local row i.
Epetra_IntSerialDenseVector ID_
Sets of local rows.
Epetra_SerialDenseSolver Solver_
Dense solver (solution will be get using LAPACK).
Epetra_SerialDenseMatrix RHS_
Dense vector representing the RHS.
virtual const Epetra_SerialDenseMatrix & RHS() const
Returns the dense vector containing the RHS.
double ComputeFlops_
Flops in Compute().
Epetra_SerialDenseMatrix NonFactoredMatrix_
Dense matrix, that contains the non-factored matrix.
double ApplyInverseFlops_
Flops in ApplyInverse().
virtual const Epetra_IntSerialDenseVector & ID() const
Returns the integer dense vector of IDs.