22 fPardisoControl.SetMatrix(
this);
26 cerr <<
"TPZSYsmpMatrix(int rows,int cols)\n";
35 fPardisoControl.SetMatrix(
this);
39 cerr <<
"TPZSYsmpMatrix(int rows,int cols)\n";
47 cerr <<
"~TPZSYsmpMatrix()\n";
60 fPardisoControl = copy.fPardisoControl;
61 fPardisoControl.SetMatrix(
this);
76 int64_t row(r),col(c);
82 for(
int ic=
fIA[row] ; ic <
fIA[row+1]; ic++ ) {
83 if (
fJA[ic] == col )
return fA[ic];
95 int64_t row(r),col(c);
101 for(
int ic=
fIA[row] ; ic <
fIA[row+1]; ic++ ) {
102 if (
fJA[ic] == col )
108 if (val != (TVar(0.))) {
125 const TVar alpha,
const TVar beta,
const int opt)
const {
129 int64_t r = (opt) ? this->
Cols() : this->
Rows();
139 int64_t ncols = x.
Cols();
140 for (int64_t col=0; col<ncols; col++)
142 for(int64_t ir=0; ir<this->
Rows(); ir++) {
143 for(int64_t ic=
fIA[ir]; ic<
fIA[ir+1]; ic++) {
144 int64_t jc =
fJA[ic];
145 z(ir,col) += alpha *
fA[ic] * x.
g(jc,col);
148 z(jc,col) += alpha *
fA[ic] * x.
g(ir,col);
165 out <<
"\nTSYsmpMatrix Print: " << title <<
'\n' 166 <<
"\tNon zero elements = " <<
fA.
size() <<
'\n' 167 <<
"\tRows = " << this->
Rows() <<
'\n' 168 <<
"\tColumns = " << this->
Cols() <<
'\n';
170 out <<
"\tIA\tJA\tA\n" 172 for(i=0; i<=this->
Rows(); i++) {
178 for(i=this->
Rows()+1; i<
fIA[this->
Rows()]-1; i++) {
198 for(
int ir=0; ir<this->
Rows(); ir++) {
208 if (!symmetric || nrow != ncol) {
219 for (int64_t row=0; row<nrow; row++) {
220 eqs[row].insert(row);
221 for (int64_t col = 0; col<ncol; col++) {
222 REAL
test = rand()*1./RAND_MAX;
224 eqs[row].insert(col);
226 eqs[col].insert(row);
232 for (int64_t row=0; row< nrow; row++) {
233 for (std::set<int64_t>::iterator col = eqs[row].begin(); col != eqs[row].
end(); col++) {
237 A.
Push(orig(row,*col));
240 IA[row+1] = JA.
size();
275 fPardisoControl.SetMatrixType(TPZPardisoControl<TVar>::ESymmetric,TPZPardisoControl<TVar>::EIndefinite);
276 fPardisoControl.Decompose();
291 fPardisoControl.SetMatrixType(TPZPardisoControl<TVar>::ESymmetric,TPZPardisoControl<TVar>::EPositiveDefinite);
292 fPardisoControl.Decompose();
320 fPardisoControl.Solve(*b,x);
353 fPardisoControl.Solve(*b,x);
int ClassId() const override
Define the class id associated with the class.
virtual int PutVal(const int64_t, const int64_t, const TVar &val) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
void AutoFill(int64_t nrow, int64_t ncol, int symmetric)
Fill matrix storage with randomic values.
virtual void Print(const char *title, std::ostream &out=std::cout, const MatrixOutputFormat=EFormatted) const override
Print the matrix along with a identification title.
virtual void resize(const int64_t newsize)
MatrixOutputFormat
Defines output format.
virtual int Resize(const int64_t newRows, const int64_t newCols)
Redimensions a matriz keeping the previous values.
void SetIsDecomposed(int val)
Sets current matrix to decomposed state.
virtual int Subst_LBackward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is upper triangular with A(i,i)=1.
REAL val(STATE &number)
Returns value of the variable.
virtual int Subst_Forward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular.
static TVar gZero
Initializing value to static variable.
virtual int Decompose_LDLt()
Decomposes the current matrix using LDLt.
TPZVec< TVar > & A()
Access function for the coefficients.
virtual void SetData(const TPZVec< int64_t > &IA, const TPZVec< int64_t > &JA, const TPZVec< TVar > &A)
Sets data to the class.
int Zero() override
Makes Zero all the elements.
int64_t size() const
Returns the number of elements of the vector.
virtual void MultAdd(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha=1., const TVar beta=0., const int opt=0) const override
Computes z = beta * y + alpha * opt(this)*x.
void Push(const T object)
Pushes a copy of the object on the stack.
int IsDecomposed() const
Checks if current matrix is already decomposed.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZSYsmpMatrix()
Constructor based on number of rows and columns.
TPZSYsmpMatrix & operator=(const TPZSYsmpMatrix< TVar > ©)
int64_t Rows() const
Returns number of rows.
virtual int Subst_Diag(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is diagonal matrix.
Full matrix class. Matrix.
virtual int Subst_LForward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular with A(i,i)=1.
int32_t Hash(std::string str)
virtual int Decompose_Cholesky()
Decomposes the current matrix using Cholesky method. The current matrix has to be symmetric...
Implements a symmetric sparse matrix. Matrix.
void AutoFill(int64_t nrow, int64_t ncol, int symmetric)
Fill matrix storage with randomic values.
int64_t Cols() const
Returns number of cols.
virtual void Print(std::ostream &out) const
virtual ~TPZSYsmpMatrix()
Destructor.
virtual const TVar & GetVal(const int64_t row, const int64_t col) const override
Get the matrix entry at (row,col) without bound checking.
T * end() const
Returns a pointer to the last+1 element.
TVar & g(const int64_t row, const int64_t col) const
int ClassId() const override
Define the class id associated with the class.
virtual int Subst_Backward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is upper triangular.
Root matrix class (abstract). Matrix.
Contains TPZSYsmpMatrix class which implements a symmetric sparse matrix. Purpose: Defines operation...