44 #include "Epetra_SerialDenseVector.h" 49 : Epetra_CompObject(),
53 EstimateSolutionErrors_(
false),
54 SolutionErrorsEstimated_(
false),
57 ReciprocalConditionEstimated_(
false),
58 RefineSolution_(
false),
59 SolutionRefined_(
false),
220 double * DL_ = F->
DL();
221 double * D_ = F->
D();
222 double * DU_ = F->
DU();
223 double * DU2_ = F->
DU2();
229 UpdateFlops( (
N_ == 1)? 1. : 4*(DN-1) );
253 double DNRHS =
NRHS_;
274 double * DL_ = F->
DL();
275 double * D_ = F->
D();
276 double * DU_ = F->
DU();
277 double * DU2_ = F->
DU2();
279 lapack.
GTTRS(
TRANS_,
N_,
NRHS_,DL_,D_,DU_,DU2_,
IPIV_,
X_,
N_,&
INFO_);
282 UpdateFlops(2.0*4*DN*DNRHS);
297 std::cout<<
" SerialTriDiSolver::ApplyRefinement this function is not supported"<<std::endl;
313 UpdateFlops((DN*DN*DN));
340 UpdateFlops(2*
N_*
N_);
347 if (
Matrix_!=0) os <<
"Solver Matrix" << std::endl << *
Matrix_ << std::endl;
348 if (
Factor_!=0) os <<
"Solver Factored Matrix" << std::endl << *
Factor_ << std::endl;
349 if (
LHS_ !=0) os <<
"Solver LHS" << std::endl << *
LHS_ << std::endl;
350 if (
RHS_ !=0) os <<
"Solver RHS" << std::endl << *
RHS_ << std::endl;
void GETRI(const OrdinalType n, ScalarType *A, const OrdinalType lda, const OrdinalType *IPIV, ScalarType *WORK, const OrdinalType lwork, OrdinalType *info) const
virtual void Print(std::ostream &os) const
Print service methods; defines behavior of ostream << operator.
virtual int Invert(void)
Inverts the this matrix.
Epetra_SerialDenseMatrix * RHS_
Ifpack_SerialTriDiSolver()
Default constructor; matrix should be set using SetMatrix(), LHS and RHS set with SetVectors()...
bool ReciprocalConditionEstimated_
virtual int Solve(void)
Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()..
virtual int ApplyRefinement(void)
Apply Iterative Refinement.
virtual int Factor(void)
Computes the in-place LU factorization of the matrix using the LAPACK routine DGETRF.
int SetMatrix(Ifpack_SerialTriDiMatrix &A)
Sets the pointers for coefficient matrix.
int N() const
Returns column dimension of system.
virtual ~Ifpack_SerialTriDiSolver()
Ifpack_SerialTriDiSolver destructor.
bool Inverted()
Returns true if matrix inverse has been computed (inverse available via AF() and LDAF()).
void EstimateSolutionErrors(bool Flag)
Causes all solves to estimate the forward and backward solution error.
bool Factored()
Returns true if matrix is factored (factor available via AF() and LDAF()).
double * A() const
Returns pointer to the this matrix.
void GECON(const char NORM, const OrdinalType n, const ScalarType *A, const OrdinalType lda, const ScalarType anorm, ScalarType *rcond, ScalarType *WORK, OrdinalType *IWORK, OrdinalType *info) const
bool SolutionErrorsEstimated_
double * DL()
Returns pointer to the this matrix.
Ifpack_SerialTriDiMatrix * Matrix_
virtual int ReciprocalConditionEstimate(double &Value)
Unscales the solution vectors if equilibration was used to solve the system.
bool EstimateSolutionErrors_
bool ReciprocalConditionEstimated()
Returns true if the condition number of the this matrix has been computed (value available via Recipr...
#define EPETRA_CHK_ERR(xxx)
Teuchos::LAPACK< int, double > lapack
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...
Ifpack_SerialTriDiMatrix * Factor_
int SetVectors(Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &B)
Sets the pointers for left and right hand side vector(s).
void GTTRS(const char TRANS, const OrdinalType n, const OrdinalType nrhs, const ScalarType *dl, const ScalarType *d, const ScalarType *du, const ScalarType *du2, const OrdinalType *IPIV, ScalarType *B, const OrdinalType ldb, OrdinalType *info) const
void GTTRF(const OrdinalType n, ScalarType *dl, ScalarType *d, ScalarType *du, ScalarType *du2, OrdinalType *IPIV, OrdinalType *info) const
Epetra_SerialDenseMatrix * LHS_