52 ShouldEquilibrate_(false),
53 A_Equilibrated_(false),
54 B_Equilibrated_(false),
57 EstimateSolutionErrors_(false),
58 SolutionErrorsEstimated_(false),
61 ReciprocalConditionEstimated_(false),
62 RefineSolution_(false),
63 SolutionRefined_(false),
132 if (
R_ != 0 &&
R_ !=
C_) {
delete []
R_;
R_ = 0;}
134 if (
C_ != 0) {
delete []
C_;
C_ = 0;}
282 double DNRHS =
NRHS_;
321 double DNRHS =
NRHS_;
350 if (
R_!=0)
return(0);
381 for (j=0; j<
N_; j++) {
384 for (i=0; i<
M_; i++) {
385 *ptr = *ptr*s1*
R_[i];
394 for (j=0; j<
N_; j++) {
398 for (i=0; i<
M_; i++) {
399 *ptr = *ptr*s1*
R_[i];
401 *ptr1 = *ptr1*s1*
R_[i];
427 for (j=0; j<
NRHS_; j++) {
429 for (i=0; i<
M_; i++) {
430 *ptr = *ptr*R_tmp[i];
453 for (j=0; j<
NRHS_; j++) {
455 for (i=0; i<
N_; i++) {
456 *ptr = *ptr*C_tmp[i];
524 if (
Matrix_!=0) os <<
"Solver Matrix" << std::endl << *
Matrix_ << std::endl;
525 if (
Factor_!=0) os <<
"Solver Factored Matrix" << std::endl << *
Factor_ << std::endl;
526 if (
LHS_ !=0) os <<
"Solver LHS" << std::endl << *
LHS_ << std::endl;
527 if (
RHS_ !=0) os <<
"Solver RHS" << std::endl << *
RHS_ << std::endl;
const double Epetra_Overflow
#define EPETRA_CHK_ERR(a)
Epetra_BLAS: The Epetra BLAS Wrapper Class.
void GEMM(const char TRANSA, const char TRANSB, const int M, const int N, const int K, const float ALPHA, const float *A, const int LDA, const float *B, const int LDB, const float BETA, float *C, const int LDC) const
Epetra_BLAS matrix-matrix multiply function (SGEMM)
Epetra_CompObject: Functionality and data that is common to all computational classes.
void UpdateFlops(int Flops_in) const
Increment Flop count for this object.
Epetra_LAPACK: The Epetra LAPACK Wrapper Class.
void GEEQU(const int M, const int N, const float *A, const int LDA, float *R, float *C, float *ROWCND, float *COLCND, float *AMAX, int *INFO) const
Epetra_LAPACK equilibration for general matrix (SGEEQU)
void GECON(const char NORM, const int N, const float *A, const int LDA, const float ANORM, float *RCOND, float *WORK, int *IWORK, int *INFO) const
Epetra_LAPACK condition number estimator for general matrix (SGECON)
void GERFS(const char TRANS, const int N, const int NRHS, const float *A, const int LDA, const float *AF, const int LDAF, const int *IPIV, const float *B, const int LDB, float *X, const int LDX, float *FERR, float *BERR, float *WORK, int *IWORK, int *INFO) const
Epetra_LAPACK Refine solution (GERFS)
void GETRF(const int M, const int N, float *A, const int LDA, int *IPIV, int *INFO) const
Epetra_LAPACK factorization for general matrix (SGETRF)
void GETRI(const int N, float *A, const int LDA, int *IPIV, float *WORK, const int *LWORK, int *INFO) const
Epetra_LAPACK inversion for general matrix (SGETRI)
void GETRS(const char TRANS, const int N, const int NRHS, const float *A, const int LDA, const int *IPIV, float *X, const int LDX, int *INFO) const
Epetra_LAPACK solve (after factorization) for general matrix (SGETRS)
Epetra_SerialDenseMatrix: A class for constructing and using real double precision general dense matr...
double * A() const
Returns pointer to the this matrix.
int LDA() const
Returns the leading dimension of the this matrix.
virtual double OneNorm() const
Computes the 1-Norm of the this matrix (identical to NormOne() method).
int M() const
Returns row dimension of system.
int N() const
Returns column dimension of system.
bool ReciprocalConditionEstimated()
Returns true if the condition number of the this matrix has been computed (value available via Recipr...
virtual int Solve(void)
Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()....
int EquilibrateRHS(void)
Equilibrates the current RHS.
Epetra_SerialDenseMatrix * Factor_
virtual void Print(std::ostream &os) const
Print service methods; defines behavior of ostream << operator.
int SetMatrix(Epetra_SerialDenseMatrix &A)
Sets the pointers for coefficient matrix.
Epetra_SerialDenseMatrix * Matrix_
bool ReciprocalConditionEstimated_
virtual int ReciprocalConditionEstimate(double &Value)
Returns the reciprocal of the 1-norm condition number of the this matrix.
virtual int ApplyRefinement(void)
Apply Iterative Refinement.
void EstimateSolutionErrors(bool Flag)
Causes all solves to estimate the forward and backward solution error.
virtual ~Epetra_SerialDenseSolver()
Epetra_SerialDenseSolver destructor.
Epetra_SerialDenseMatrix * RHS_
bool SolutionErrorsEstimated_
int UnequilibrateLHS(void)
Unscales the solution vectors if equilibration was used to solve the system.
bool EstimateSolutionErrors_
virtual int ComputeEquilibrateScaling(void)
Computes the scaling vector S(i) = 1/sqrt(A(i,i)) of the this matrix.
virtual bool ShouldEquilibrate()
Returns true if the LAPACK general rules for equilibration suggest you should equilibrate the system.
virtual int Factor(void)
Computes the in-place LU factorization of the matrix using the LAPACK routine DGETRF.
bool Factored()
Returns true if matrix is factored (factor available via AF() and LDAF()).
bool Inverted()
Returns true if matrix inverse has been computed (inverse available via AF() and LDAF()).
Epetra_SerialDenseSolver()
Default constructor; matrix should be set using SetMatrix(), LHS and RHS set with SetVectors().
Epetra_SerialDenseMatrix * LHS_
virtual int EquilibrateMatrix(void)
Equilibrates the this matrix.
virtual int Invert(void)
Inverts the this matrix.
bool Solved()
Returns true if the current set of vectors has been solved.
int SetVectors(Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &B)
Sets the pointers for left and right hand side vector(s).