16 static LoggerPtr logger(Logger::getLogger(
"pz.matrix.tpzsspmatrix"));
63 if ( this->
Dim() != A.
Dim() )
79 if ( this->
Dim() != A.
Dim() )
96 if ( this->
Dim() != A.
Dim() )
113 if ( this->
Dim() != A.
Dim() )
147 res.
fMat.fMult( value );
192 for ( int64_t k = 0; k < this->
Dim(); k++, row_k++ )
199 for (; row_k->
Get( &node_k ) && (node_k.
col < k);
206 if ( (node_k.
col != k) || (node_k.
elem < 1.e-10) )
210 if ( node_k.
elem < 1.e-10 )
220 for ( ; row_i != row_end; row_i++ )
224 sum =
ProdEsc( row_k, row_i, k );
229 row_i->
Get( &node_i );
230 if ( node_i.
col != k )
232 node_i.
elem = -sum / pivot;
238 node_i.
elem = (node_i.
elem - sum) / pivot;
273 for ( int64_t k = 0; k < this->
Dim(); k++, row_k++ )
279 for ( ; row_k->
Get( &node_k ) && (node_k.
col < k);
283 if ( node_k.
elem!=REAL(0.0) )
289 TVar sum =
ProdEsc( row_k, &row_aux, k );
295 row_k->
Get( &node_k );
296 if ( node_k.
col != k )
313 TVar pivot = node_k.
elem;
319 for ( ; row_i != row_end; row_i++ )
323 sum =
ProdEsc( row_i, &row_aux, k );
328 row_i->
Get( &node_i );
329 if ( node_i.
col != k )
332 node_i.
elem = -sum / pivot;
337 node_i.
elem = (node_i.
elem - sum) / pivot;
363 for ( int64_t k = 0; k < this->
Dim(); k++, row_k++ )
364 for ( int64_t j = 0; j < B->
Cols(); j++ )
371 for ( ; row_k->
Get( &ni ) && (ni.
col < k ); row_k->
Next() )
403 for ( int64_t k = 0; k < this->
Dim(); k++, row_k++ )
404 for ( int64_t j = 0; j < B->
Cols(); j++ )
411 for ( ; row_k->
Get( &ni ) && (ni.
col < k ); row_k->
Next() )
443 for ( int64_t k = 0; k < this->
Dim(); k++, row_k++ )
446 for ( int64_t j = 0; j < B->
Cols(); j++ )
488 int64_t again_i = row_i->Get( &node_i ) && (node_i.
col < k);
489 int64_t again_j = row_j->Get( &node_j ) && (node_j.
col < k);
491 while ( again_i && again_j )
493 if ( node_i.
col > node_j.
col )
496 again_j = row_j->Get( &node_j ) && (node_j.
col < k);
498 else if ( node_i.
col < node_j.
col )
501 again_i = row_i->Get( &node_i ) && (node_i.
col < k);
503 else if ( node_i.
col == node_j.
col )
508 again_i = row_i->Get( &node_i ) && (node_i.
col < k);
509 again_j = row_j->Get( &node_j ) && (node_j.
col < k);
517 again_i = row_i->Get( &node_i ) && (node_i.
col < k);
524 again_j = row_j->Get( &node_j ) && (node_j.
col < k);
534 TSimMatrix::Unpack(buf);
536 buf->UpkLong(&class_id);
552 TSimMatrix::Pack(buf);
559 return TSimMatrix::DerivedFrom(Classid);
564 if(!strcmp(ClassName(),classname))
return 1;
565 return TSimMatrix::DerivedFrom(classname);
int Update(ElemType &elem)
Updates the current list.
TPZSSpMatrix operator+(const TPZSSpMatrix< TVar > &A) const
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
static int Error(const char *msg, const char *msg2=0)
Returns error messages.
TPZSSpMatrix & operator*=(const TVar v)
Contains TPZSSpMatrix class which implements sparse symmetric matrix using a linked list of elements...
int64_t fRow
Number of rows in matrix.
int Next()
Moves to the next element on list.
TVar ProdEsc(TPZLink< TPZSpMatrix< REAL >::TPZNode > *row_i, TPZLink< TPZSpMatrix< REAL >::TPZNode > *row_j, int64_t k)
Calcula o produto escalar entre as linhas 'row_i' e 'row_j' usando apenas os elementos pertencentes '...
char fDecomposed
Decomposition type used to decompose the current matrix.
int Insert(ElemType &elem)
Inserts a element on the list.
int Subst_Diag(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is diagonal matrix.
char fDefPositive
Definite Posistiveness of current matrix.
Implements a linked list of ElemType elements. Matrix utility.
const TVar & GetVal(const int64_t row, const int64_t col) const
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
TPZSSpMatrix & operator+=(const TPZSSpMatrix< TVar > &A)
Implements sparce symmetric matrix using a linked list of elements. Matrix.
int Get(ElemType *pElem)
Returns an element from the list.
int Subst_Forward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular.
TPZSSpMatrix & operator-=(const TPZSSpMatrix< TVar > &A)
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
int Subst_LForward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular with A(i,i)=1.
int64_t Rows() const
Returns number of rows.
static TPZSavable * CreateInstance(const int &classId)
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
int GetLast(ElemType *pElem)
Returns the last element on the list.
Full matrix class. Matrix.
virtual int64_t Dim() const
Returns the dimension of the matrix if the matrix is square.
int Decompose_LDLt()
Decomposes the current matrix using LDLt.
int64_t fCol
Number of cols in matrix.
TPZSSpMatrix & operator=(const TPZSSpMatrix< TVar > &A)
Operators with SYMMETRIC sparse matrices.
TPZSSpMatrix operator-(const TPZSSpMatrix< TVar > &A) const
int Clear()
Clears the entire list.
int64_t Cols() const
Returns number of cols.
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")
int PutVal(const int64_t row, const int64_t col, const TVar &value) override
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
int Head()
Returns to the head of the list.
int Decompose_Cholesky()
Decomposes the current matrix using Cholesky method. The current matrix has to be symmetric...
int Append(ElemType &elem)
Appends an element to the list.
TPZSSpMatrix operator*(const TVar v) const
Operators with numeric values.
Root matrix class (abstract). Matrix.