|
Epetra Package Browser (Single Doxygen Collection)
Development
|
Go to the documentation of this file.
116 if (
U_ !=0) {
delete[]
U_;
U_ = 0;}
117 if (
S_ !=0) {
delete[]
S_;
S_ = 0;}
159 if(
U_ ) {
delete []
U_;
U_ = 0; }
160 if(
S_ ) {
delete []
S_;
S_ = 0; }
229 for(
int i = 0; i <
M_; ++i )
S_[i]=0.0;
230 for(
int i = 0; i <
M_*
N_; ++i )
243 double *work =
new double[lwork];
248 GESVD( job, job,
M_,
N_, tempMat.
A(),
LDA_,
S_,
U_,
N_,
Vt_,
M_, work, &lwork, &
INFO_ );
292 double DNRHS =
NRHS_;
297 GEMM(
TRANS_,
'N',
N_,
NRHS_,
N_, 1.0,
AI_,
LDAI_,
B_,
LDB_, 0.0,
X_,
LDX_);
485 double thresh =
S_[0]*rthresh + athresh;
486 int num_replaced = 0;
487 for(
int i = 0; i <
M_; ++i )
498 for(
int i = 0; i <
N_; ++i )
501 if(
S_[i] ) scale = 1./
S_[i];
502 for(
int j = 0; j <
M_; ++j ) *p++ *= scale;
522 GEMM(
'T',
'T',
M_,
M_,
M_, 1.0,
Vt_,
M_,
U_,
M_, 0.0,
AI_,
M_ );
530 return(num_replaced);
564 if (
S_!=0)
for(
int i = 0; i <
M_; ++i ) std::cout <<
"(" << i <<
"," <<
S_[i] <<
")\n";
Epetra_Object: The base Epetra class.
int M() const
Returns row dimension of system.
Epetra_LAPACK: The Epetra LAPACK Wrapper Class.
int N() const
Returns column dimension of system.
int SetVectors(Epetra_SerialDenseMatrix &X, Epetra_SerialDenseMatrix &B)
Sets the pointers for left and right hand side vector(s).
void UpdateFlops(int Flops_in) const
Increment Flop count for this object.
#define EPETRA_CHK_ERR(a)
int SetMatrix(Epetra_SerialDenseMatrix &A)
Sets the pointers for coefficient matrix.
Epetra_SerialDenseSVD()
Default constructor; matrix should be set using SetMatrix(), LHS and RHS set with SetVectors().
double * A() const
Returns pointer to the this matrix.
virtual int Solve(void)
Computes the solution X to AX = B for the this matrix and the B provided to SetVectors()....
Epetra_SerialDenseMatrix * LHS_
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()).
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)
int Shape(int NumRows, int NumCols)
Set dimensions of a Epetra_SerialDenseMatrix object; init values to zero.
Epetra_BLAS: The Epetra BLAS Wrapper Class.
void GESVD(const char JOBU, const char JOBVT, const int M, const int N, float *A, const int LDA, float *S, float *U, const int LDU, float *VT, const int LDVT, float *WORK, const int *LWORK, int *INFO) const
Epetra_LAPACK wrapper for computing the singular value decomposition (SGESVD)
Epetra_SerialDenseMatrix * Inverse_
int LDA() const
Returns the leading dimension of the this matrix.
Epetra_SerialDenseMatrix * Matrix_
virtual ~Epetra_SerialDenseSVD()
Epetra_SerialDenseSVD destructor.
virtual void Print(std::ostream &os) const
Print service methods; defines behavior of ostream << operator.
Epetra_CompObject: Functionality and data that is common to all computational classes.
virtual int Invert(double rthresh=0.0, double athresh=0.0)
Inverts the this matrix.
virtual double OneNorm() const
Computes the 1-Norm of the this matrix (identical to NormOne() method).
Epetra_SerialDenseMatrix: A class for constructing and using real double precision general dense matr...
Epetra_SerialDenseMatrix * RHS_