30 static LoggerPtr logger(Logger::getLogger(
"pz.matrix.tpzmatrix"));
31 static LoggerPtr loggerCheck(Logger::getLogger(
"pz.checkconsistency"));
66 Error(
"Add(TPZMatrix<>&, TPZMatrix) <different dimensions>" );
71 for ( int64_t r = 0; r <
Rows(); r++ )
78 Error(
"Add(TPZMatrix<>&, TPZMatrix<>&) <different dimensions>" );
82 for ( int64_t r = 0; r <
Rows(); r++ ) {
83 for ( int64_t c = 0; c <
Cols(); c++ ) {
93 Error(
"Simetrize only work for square matrices" );
98 for(row=0; row<
fDim1; row++) {
99 for(col=row+1; col<
fDim1; col++) {
100 this->
s(col,row) = this->
s(row,col);
137 int64_t numeq = (opt) ?
Cols() :
Rows();
138 int64_t xcols = y.
Cols();
140 if(!z.
Rows())
return;
141 for (ic = 0; ic < xcols; ic++)
143 TVar *zp = &z(0,ic), *zlast = zp+numeq;
146 const TVar *yp = &y.
g(0,ic);
149 memcpy((
void *)(zp),(
void *)(yp),numeq*
sizeof(TVar));
151 for (int64_t i=0; i<numeq; i++) {
168 Error(
"Operator* <matrixs with incompatible dimensions>" );
170 Error (
"TPZFMatrix::MultiplyAdd incompatible dimensions\n");
172 int64_t rows =
Rows();
173 int64_t cols =
Cols();
174 int64_t xcols = x.
Cols();
178 for (ic = 0; ic < xcols; ic++) {
180 for ( c = 0; c<cols; c++) {
181 for ( r = 0; r < rows; r++ ) {
187 for (r = 0; r<rows; r++) {
189 for(c = 0; c<cols; c++) {
202 Error(
"identity (TPZMatrix<>*) <TPZMatrix<>must be square>" );
204 for ( int64_t row = 0; row <
Rows(); row++) {
205 for ( int64_t col = 0; col <
Cols(); col++ ) {
230 int64_t newRow, newCol;
233 Redim( newRow, newCol );
236 for(i=0;i<
Rows();i++)
237 for(j=0;j<
Cols();j++)
259 out << name << std::endl;
260 for (int64_t i=0; i<
fRow; i++) {
261 for (int64_t j=0; j<
fCol; j++) {
262 out <<
"i = " << i <<
" j = " << j <<
" val " <<
Get(i, j) << std::endl;
273 out <<
"Writing matrix '";
274 if(name) out << name;
275 out <<
"' (" <<
Rows() <<
" x " <<
Cols() <<
"):\n";
277 for ( int64_t row = 0; row <
Rows(); row++) {
279 for ( int64_t col = 0; col <
Cols(); col++ ) {
280 out <<
Get( row, col) <<
" ";
286 out <<
Rows() <<
" " <<
Cols() << endl;
287 for ( int64_t row = 0; row <
Rows(); row++) {
288 for ( int64_t col = 0; col <
Cols(); col++ ) {
289 TVar
val =
Get (row, col);
290 if(val != (TVar)0.) out << row <<
' ' << col <<
' ' << val << std::endl;
297 out << name <<
"\n{ ";
298 for ( int64_t row = 0; row <
Rows(); row++) {
300 for ( int64_t col = 0; col <
Cols(); col++ ) {
301 TVar
val =
Get (row, col);
303 sprintf(number,
"%16.16Lf",(
long double)
fabs(val));
310 if((col+1) % 6 == 0)out << std::endl;
322 for ( int64_t row = 0; row <
Rows(); row++) {
324 for ( int64_t col = 0; col <
Cols(); col++ )
338 int64_t nrow =
Rows();
339 for ( int64_t row = 0; row <
Rows(); row++) {
340 int64_t colmax = nrow;
341 if (sym) colmax = row+1;
342 for (int64_t col = 0; col < colmax; col++ )
345 if (val != (TVar)0.) {
350 out <<
"%%"<< name << std::endl;
351 out <<
Rows() <<
' ' <<
Cols() <<
' ' << numzero << std::endl;
352 for ( int64_t row = 0; row <
Rows(); row++) {
353 int64_t colmax = nrow;
354 if (sym) colmax = row+1;
355 for (int64_t col = 0; col < colmax; col++ )
358 if (val != (TVar)0.) {
359 out << row+1 <<
' ' << col+1 <<
' ' << val << std::endl;
369 out <<
"Writing matrix '";
370 if(name) out << name;
371 out <<
"' (" <<
Rows() <<
" x " <<
Cols() <<
"):\n";
373 for ( int64_t row = 0; row <
Rows(); row++) {
375 for ( int64_t col = 0; col <
Cols(); col++ ) {
376 out <<
Get( row, col).real() <<
" " <<
Get(row, col).imag() <<
" ";
382 out <<
Rows() <<
" " <<
Cols() << endl;
383 for ( int64_t row = 0; row <
Rows(); row++) {
384 for ( int64_t col = 0; col <
Cols(); col++ ) {
385 std::complex<double>
val =
Get (row, col);
386 if(val != 0.) out << row <<
' ' << col <<
' ' << val.real() <<
" " << val.imag() << std::endl;
393 out << name <<
"\n{ ";
394 for ( int64_t row = 0; row <
Rows(); row++) {
396 for ( int64_t col = 0; col <
Cols(); col++ ) {
397 std::complex<double>
val =
Get (row, col);
399 sprintf(number,
"%16.16lf + I %16.16lf", val.real(), val.imag());
405 if((col+1) % 6 == 0)out << std::endl;
417 for ( int64_t row = 0; row <
Rows(); row++) {
419 for ( int64_t col = 0; col <
Cols(); col++ )
436 out <<
"Writing matrix '";
437 if(name) out << name;
438 out <<
"' (" <<
Rows() <<
" x " <<
Cols() <<
"):\n";
440 for ( int64_t row = 0; row <
Rows(); row++) {
442 for ( int64_t col = 0; col <
Cols(); col++ ) {
443 out <<
Get( row, col).real() <<
" " <<
Get(row, col).imag() <<
" ";
449 out <<
Rows() <<
" " <<
Cols() << endl;
450 for ( int64_t row = 0; row <
Rows(); row++) {
451 for ( int64_t col = 0; col <
Cols(); col++ ) {
452 std::complex<double>
val =
Get (row, col);
453 if(val != 0.) out << row <<
' ' << col <<
' ' << val.real() <<
" " << val.imag() << std::endl;
460 out << name <<
"\n{ ";
461 for ( int64_t row = 0; row <
Rows(); row++) {
463 for ( int64_t col = 0; col <
Cols(); col++ ) {
464 std::complex<double>
val =
Get (row, col);
466 sprintf(number,
"%16.16lf + I %16.16lf", val.real(), val.imag());
472 if((col+1) % 6 == 0)out << std::endl;
484 for ( int64_t row = 0; row <
Rows(); row++) {
486 for ( int64_t col = 0; col <
Cols(); col++ )
501 std::cout << __PRETTY_FUNCTION__ <<
" please implement me!\n";
508 int64_t nelem = elmat.
Rows();
509 int64_t icoef,jcoef,ieq,jeq;
511 for(icoef=0; icoef<nelem; icoef++) {
512 ieq = destinationindex[icoef];
513 for(jcoef=icoef; jcoef<nelem; jcoef++) {
514 jeq = destinationindex[jcoef];
515 TVar prevval =
GetVal(ieq,jeq);
516 prevval += elmat(icoef,jcoef);
521 for(icoef=0; icoef<nelem; icoef++) {
522 ieq = destinationindex[icoef];
523 for(jcoef=0; jcoef<nelem; jcoef++) {
524 jeq = destinationindex[jcoef];
525 TVar prevval =
GetVal(ieq,jeq);
526 prevval += elmat(icoef,jcoef);
537 int64_t icoef,jcoef,ieq,jeq,ieqs,jeqs;
540 for(icoef=0; icoef<nelem; icoef++) {
541 ieq = destinationindex[icoef];
542 ieqs = source[icoef];
543 for(jcoef=icoef; jcoef<nelem; jcoef++) {
544 jeq = destinationindex[jcoef];
545 jeqs = source[jcoef];
546 prevval =
GetVal(ieq,jeq);
547 prevval += elmat(ieqs,jeqs);
552 for(icoef=0; icoef<nelem; icoef++) {
553 ieq = destinationindex[icoef];
554 ieqs = source[icoef];
555 for(jcoef=0; jcoef<nelem; jcoef++) {
556 jeq = destinationindex[jcoef];
557 jeqs = source[jcoef];
558 prevval =
GetVal(ieq,jeq);
559 prevval += elmat(ieqs,jeqs);
575 if(sRow >= this->
Rows()){
584 for ( int64_t r = 0; r < minRow; r++, row++ ) {
586 for ( int64_t c = 0; c < minCol; c++, col++ ) {
604 if ( ((sRow + rowSize) >
Rows()) || ((sCol + colSize) >
Cols()) ) {
605 return(
Error(
"GetSub <t.he sub-matrix is too big>" ) );
607 A.
Resize( rowSize, colSize );
609 for ( int64_t r = 0; r < rowSize; r++, row++ ) {
611 for ( int64_t c = 0; c < colSize; c++, col++ ) {
632 for ( int64_t r = 0; r < minRow; r++, row++ ) {
634 for ( int64_t c = 0; c < minCol; c++, col++ ) {
648 const int64_t colSize,
const int64_t pRow,
const int64_t pCol,
TPZMatrix<TVar> *pA )
const {
651 if ( ((pRow + rowSize) > pA->
Rows()) || ((pCol + colSize) > pA->
Cols())) {
652 return(
Error(
"InsertSub <the sub-matrix is too big that target>" ) );
655 int64_t NewRowSize = rowSize+pRow;
656 int64_t NewColSize = colSize+pCol;
660 for ( int64_t r = pRow; r < NewRowSize; r++, row++ ) {
662 for ( int64_t c = pCol ; c < NewColSize; c++, col++ ) {
677 const int64_t colSize,
const int64_t pRow,
const int64_t pCol,
TPZMatrix<TVar> *pA )
const {
678 if ( ((pRow + rowSize) > pA->
Rows()) || ((pCol + colSize) > pA->
Cols())) {
679 Error(
"AddSub <the sub-matrix is too big that target>" );
681 int64_t NewRowSize = rowSize+pRow;
682 int64_t NewColSize = colSize+pCol;
685 for ( int64_t r = pRow; r < NewRowSize; r++, row++ ) {
687 for ( int64_t c = pCol ; c < NewColSize; c++, col++ ) {
700 for ( int64_t r = 0; r <
Rows(); r++ ) {
701 for ( int64_t c = 0; c <
Cols(); c++ ) {
720 Error(
"Solve < Unknow decomposition type >" );
736 Error(
"Solve < Unknow decomposition type >" );
756 int64_t c = F.
Cols();
757 for(int64_t it=0; it<numiterations && (fabs(res)) >
tol; it++) {
758 for(int64_t ic=0; ic<c; ic++) {
759 for(int64_t i=0; i<r; i++) {
760 result(i,ic) += (scratch)(i,ic)/
GetVal(i,i);
766 if(residual) *residual = scratch;
773 REAL &
tol,
const int FromCurrent,
const int direction) {
779 REAL &tol,
const int FromCurrent,
const int direction) {
787 REAL &tol,
const int FromCurrent,
const int direction) {
790 cout <<
"TPZMatrix::SolveSOR called with residual and F equal, no solution\n";
793 TVar
res = (TVar)2*(TVar)tol+(TVar)1.;
794 if(residual) res =
Norm(*residual);
799 int64_t c = F.
Cols();
800 int64_t i,ifirst = 0, ilast = r, iinc = 1;
802 if(direction == -1) {
808 for(it=0; it<numiterations && (REAL)(fabs(res)) >
fabs(tol); it++) {
810 for(int64_t ic=0; ic<c; ic++) {
811 for(i=ifirst; i!=ilast; i+= iinc) {
813 for(int64_t j=0; j<r; j++) {
814 eqres -=
GetVal(i,j)*result(j,ic);
817 result(i,ic) += (TVar)overrelax*eqres/
GetVal(i,i);
822 if(residual)
Residual(result,F,*residual);
827 template <
class TVar>
830 REAL &tol,
const int FromCurrent) {
831 REAL
res = tol*2.+1.;
833 int fromcurrent = FromCurrent;
834 for(i=0; i<numiterations && fabs(res) >
fabs(tol); i++) {
837 SolveSOR(one,F,result,residual,scratch,overrelax,res,fromcurrent,1);
841 SolveSOR(one,F,result,residual,scratch,overrelax,res,fromcurrent,-1);
849 template <
class TVar>
853 CG(*
this, result, F, preconditioner, residual, numiterations, tol, FromCurrent);
875 TPZFMatrix< std::complex<float> > *residual, REAL &tol,
const int FromCurrent) {
882 TPZFMatrix< std::complex<double> > *residual, REAL &tol,
const int FromCurrent) {
888 const TPZFMatrix< std::complex<long double> > &F,
TPZFMatrix< std::complex<long double> > &result,
889 TPZFMatrix< std::complex<long double> > *residual, REAL &tol,
const int FromCurrent) {
895 template <
class TVar>
903 int64_t locnumiter = numiterations;
905 int64_t nrow = F.
Rows();
906 int64_t ncol = F.
Cols();
909 for (col=0; col<ncol; col++) {
911 numiterations = locnumiter;
914 memcpy((
void *)(&FCol(0,0)), (
void *)(&F.
GetVal(0,col)), nrow*
sizeof(REAL));
916 GMRES(*
this,resultCol,FCol,preconditioner,H,numvectors,numiterations,tol,residual,FromCurrent);
921 GMRES(*
this,result,F,preconditioner,H,numvectors,numiterations,tol,residual,FromCurrent);
946 TPZFMatrix< std::complex<float> > &H,
int &numvectors,
948 TPZFMatrix< std::complex<float> > *residual, REAL &tol,
const int FromCurrent)
955 TPZFMatrix< std::complex<double> > &H,
int &numvectors,
957 TPZFMatrix< std::complex<double> > *residual, REAL &tol,
const int FromCurrent)
964 TPZFMatrix< std::complex<long double> > &H,
int &numvectors,
965 const TPZFMatrix< std::complex<long double> > &F,
TPZFMatrix< std::complex<long double> > &result,
966 TPZFMatrix< std::complex<long double> > *residual, REAL &tol,
const int FromCurrent)
978 BiCG (*
this, result,F,preconditioner,numiterations,tol);
1016 const TPZFMatrix< std::complex<long double> > &F,
1017 TPZFMatrix< std::complex<long double> > &result,
1023 template <
class TVar>
1027 BiCGSTAB(*
this,result,F,preconditioner,numiterations,tol,residual,FromCurrent);
1048 TPZFMatrix< std::complex<float> > *residual, REAL &tol,
const int FromCurrent) {
1055 TPZFMatrix< std::complex<double> > *residual, REAL &tol,
const int FromCurrent) {
1061 const TPZFMatrix< std::complex<long double> > &F,
TPZFMatrix< std::complex<long double> > &result,
1062 TPZFMatrix< std::complex<long double> > *residual, REAL &tol,
const int FromCurrent) {
1069 template <
class TVar>
1073 const int FromCurrent) {
1074 IR(*
this,result,F,preconditioner,residual,numiterations,tol,FromCurrent);
1082 const int FromCurrent) {
1089 const int FromCurrent) {
1097 TPZFMatrix< std::complex<float> > *residual, REAL &tol,
1098 const int FromCurrent) {
1105 TPZFMatrix< std::complex<double> > *residual, REAL &tol,
1106 const int FromCurrent) {
1112 const TPZFMatrix< std::complex<long double> > &F,
TPZFMatrix< std::complex<long double> > &result,
1113 TPZFMatrix< std::complex<long double> > *residual, REAL &tol,
1114 const int FromCurrent) {
1121 template <
class TVar>
1125 template <
class TVar>
1134 for ( int64_t k = 0; k < min ; k++ ) {
1135 if (
IsZero( pivot =
GetVal(k, k)))
Error(
"Decompose_LU <matrix is singular>" );
1136 for ( int64_t i = k+1; i <
Rows(); i++ ) {
1137 nn =
GetVal( i, k ) / pivot;
1150 template <
class TVar>
1153 int64_t rowb = B->
Rows();
1154 int64_t colb = B->
Cols();
1155 if ( rowb !=
Rows() )
1156 Error(
"SubstitutionLU <incompatible dimensions>" );
1158 for ( i = 0; i < rowb; i++ ) {
1159 for ( int64_t col = 0; col < colb; col++ ) {
1160 for ( int64_t j = 0; j < i; j++ ) {
1165 for (int64_t col=0; col<colb; col++) {
1166 for ( i = rowb-1; i >= 0; i-- ) {
1167 for ( int64_t j = i+1; j < rowb ; j++ ) {
1172 Error(
"BackSub( SubstitutionLU ) <Matrix is singular" );
1179 template <
class TVar>
1183 template <
class TVar>
1187 Error(
"Decompose_LDLt <Matrix already Decomposed with other scheme> " );
1191 if (
Rows()!=
Cols() )
Error(
"Decompose_LDLt <Matrix must be square>" );
1193 int64_t j,k,l,dim=
Rows();
1195 for ( j = 0; j < dim; j++ ) {
1196 for ( k=0; k<j; k++) {
1199 for ( k=0; k<j; k++) {
1200 for( l=j+1; l<dim;l++) {
1206 if (
IsZero(tmp) )
Error(
"Decompose_LDLt <Zero on diagonal>" );
1207 for( l=j+1; l<dim;l++) {
1216 template <
class TVar>
1220 if (
Rows()!=
Cols() )
Error(
"Decompose_Cholesky <Matrix must be square>" );
1224 for (int64_t i=0 ; i<dim; i++) {
1225 for(int64_t k=0; k<i; k++) {
1230 singular.push_back(i);
1235 for (int64_t j=i+1;j<dim; j++) {
1236 for(int64_t k=0; k<i; k++) {
1241 Error(
"Decompose_Cholesky <Zero on diagonal>" );
1251 template <
class TVar>
1255 if (
Rows()!=
Cols() )
Error(
"Decompose_Cholesky <Matrix must be square>" );
1259 for (int64_t i=0 ; i<dim; i++) {
1260 for(int64_t k=0; k<i; k++) {
1265 for (int64_t j=i+1;j<dim; j++) {
1266 for(int64_t k=0; k<i; k++) {
1271 Error(
"Decompose_Cholesky <Zero on diagonal>" );
1283 template <
class TVar>
1287 for ( int64_t r = 0; r <
Dim(); r++ ) {
1288 TVar pivot =
GetVal( r, r );
1289 for ( int64_t c = 0; c < B->
Cols(); c++ ) {
1293 for ( int64_t i = 0; i < r; i++ ) sum +=
GetVal(r, i) * B->
GetVal(i, c);
1308 template <
class TVar>
1312 for ( int64_t r =
Dim()-1; r >= 0; r-- ) {
1313 TVar pivot =
GetVal( r, r );
1314 for ( int64_t c = 0; c < B->
Cols(); c++ ) {
1318 for ( int64_t i =
Dim()-1; i > r; i-- ) sum +=
GetVal(r, i) * B->
GetVal(i, c);
1332 template <
class TVar>
1335 Error(
"TPZMatrix::Subst_LForward incompatible dimensions\n");
1337 for ( int64_t r = 0; r <
Dim(); r++ ) {
1338 for ( int64_t c = 0; c < B->
Cols(); c++ ) {
1342 for ( int64_t i = 0; i < r; i++ ) sum +=
GetVal(r, i) * B->
GetVal(i, c);
1357 template <
class TVar>
1360 Error(
"TPZMatrix::Subst_LBackward incompatible dimensions \n");
1363 for ( int64_t r =
Dim()-1; r >= 0; r-- ) {
1364 for ( int64_t c = 0; c < B->
Cols(); c++ ) {
1368 for ( int64_t i =
Dim()-1; i > r; i-- ) sum +=
GetVal(r, i) * B->
GetVal(i, c);
1383 template <
class TVar>
1386 Error(
"TPZMatrix::Subst_Diag incompatible dimensions\n");
1388 for ( int64_t r = 0; r <
Dim(); r++ ) {
1389 TVar pivot =
GetVal( r, r );
1390 for ( int64_t c = 0; c < B->
Cols(); c++ ) {
1401 template <
class TVar>
1404 out <<
"TPZMatrix::" << msg;
1405 if(msg2) out << msg2;
1409 std::bad_exception myex;
1412 template <
class TVar>
1419 template <
class TVar>
1432 template <
class TVar>
1436 if(!copmat)
return false;
1441 std::stringstream sout;
1442 sout << __PRETTY_FUNCTION__ <<
" did not compare ";
1445 if(
override && !result)
1447 this->operator=(*copmat);
1457 template <
class TVar>
1461 if(!copmat)
return false;
1466 std::stringstream sout;
1467 sout << __PRETTY_FUNCTION__ <<
" did not compare ";
1470 if(
override && !result)
1477 template <
class TVar>
1482 for(iel=0; iel<nel; iel++)
1484 for(jel=0; jel<nel; jel++)
1486 block(iel,jel) =
GetVal(indices[iel],indices[jel]);
1500 template <
class TVar>
1502 int64_t nrows = this->
Rows();
1503 int64_t ncols = this->
Cols();
1504 if (nrows != ncols)
return 0;
1506 for( int64_t i = 0; i < nrows; i++){
1507 for(int64_t j = 0; j <= i; j++){
1508 TVar
exp = this->
Get(i,j) - this->
Get(j,i);
1509 if ( (REAL)(
fabs( exp )) > tol ) {
1510 #ifdef STATE_COMPLEX 1511 cout <<
"Elemento: " << i <<
", " << j <<
" -> " <<
fabs( exp ) <<
"/" <<
1512 this->
Get(i,j) << endl;
1514 cout <<
"Elemento: " << i <<
", " << j <<
" -> " << exp <<
"/" <<
1515 this->
Get(i,j) << endl;
1531 template <
class TVar>
1534 int64_t nrows = this->
Rows();
1535 int64_t ncols = this->
Cols();
1536 if ( (M.
Rows() != nrows) || (M.
Cols() != ncols) )
return false;
1539 for( int64_t i = 0; i < nrows; i++)
1540 for( int64_t j = 0; j < ncols; j++){
1541 TVar exps = this->
Get(i,j) - M.
Get(i,j);
1542 diff =
fabs( exps );
1543 if (diff >
fabs(tol))
return false;
1559 template <
class TVar>
1562 TVar exps = val - (TVar)Vec[0];
1563 TVar diff0 =
fabs(exps) >=
fabs(tol) ? (val - (TVar)Vec[0]) : (TVar)1.E10;
1564 TVar diff1,
res = (TVar)Vec[0];
1565 for(int64_t i = 1; i < Vec.
NElements(); i++)
1567 diff1 = val - (TVar)Vec[i];
1568 diff0 = (
fabs(diff1) >=
fabs(tol) &&
fabs(diff1) <
fabs(diff0) ) ? res = Vec[i],diff1 : diff0;
1582 template <
class TVar>
1585 int64_t NumIt = numiterations;
1591 PZError << __PRETTY_FUNCTION__ <<
1592 " - Jacobi method of computing eigensystem requires a symmetric square matrix. this->Rows = " << this->
Rows() <<
" - this->Cols() = " << this->
Cols() << endl;
1598 PZError << __PRETTY_FUNCTION__ <<
1599 " - Jacobi method of computing eigensystem requires a symmetric square matrix. This matrix is not symmetric." << endl;
1604 const int64_t size = this->
Rows();
1608 for(int64_t i = 0; i < size; i++)
for(int64_t j = 0; j < size; j++) Matrix(i,j) = this->
Get(i,j);
1612 if (result ==
false)
return false;
1617 Eigenvectors.
Resize(size, size);
1618 Eigenvectors.
Zero();
1619 for(int64_t eigen = 0; eigen < size; eigen++)
1621 for(int64_t i = 0; i < size; i++) VecIni.PutVal(i,0,rand());
1626 TVar
exp = answ - Eigenvalues[eigen];
1627 if((REAL)(
fabs(exp)) > 1.E-5)
1629 for(int64_t i = 0; i < size; i++) Matrix.
PutVal(i,i, this->GetVal(i,i) - (TVar)(Eigenvalues[eigen] - (TVar)(0.01 *
fabs(exp))) );
1633 for(int64_t i = 0; i < size; i++) Matrix.
PutVal(i,i, this->GetVal(i,i) - (Eigenvalues[eigen] - TVar(0.01)) );
1638 for(int64_t i = 0; i < size; i++) norm1 +=
fabs(VecIni(i,0)) *
fabs(VecIni(i,0)); norm1 =
sqrt(norm1);
1639 for(int64_t i = 0; i < size; i++) VecIni(i,0) = VecIni(i,0)/(TVar)norm1;
1642 double dif = 10., difTemp = 0.;
1644 while(dif > tolerance && count <= NumIt)
1646 for(int64_t i = 0; i < size; i++) VecIni_cp(i,0) = VecIni(i,0);
1653 for(int64_t i = 0; i < size; i++) norm2 +=
fabs(VecIni(i,0)) *
fabs(VecIni(i,0));
1654 norm2 =
sqrt(norm2);
1657 for(int64_t i = 0; i < size; i++)
1659 VecIni(i,0) = VecIni(i,0)/(TVar)norm2;
1660 TVar exp = (VecIni_cp(i,0) - VecIni(i,0)) * (VecIni_cp(i,0) - VecIni(i,0));
1661 difTemp +=
fabs(exp);
1663 dif =
sqrt(difTemp);
1668 for(int64_t i = 0; i < size; i++)
1670 TVar val = VecIni(i,0);
1671 if((REAL)(
fabs(val)) < 1.E-5) val = 0.;
1672 Eigenvectors(eigen,i) =
val;
1677 for(int64_t i = 0; i < size; i++) norm +=
fabs(VecIni(i,0)) *
fabs(VecIni(i,0));
1678 if (
fabs(norm - 1.) > 1.e-10)
1680 PZError << __PRETTY_FUNCTION__ << endl;
1684 PZError << __PRETTY_FUNCTION__ << endl;
1687 std::stringstream sout;
1688 Print(
"Matrix for SolveEigensystemJacobi did not converge",sout);
1726 template <
class TVar>
1731 PZError << __PRETTY_FUNCTION__ <<
" - Jacobi method of computing eigenvalues requires a symmetric square matrix. this->Rows = " << this->
Rows() <<
" - this->Cols() = " << this->
Cols() << endl;
1736 PZError << __PRETTY_FUNCTION__ <<
" - Jacobi method of computing eigenvalues requires a symmetric square matrix. This matrix is not symmetric." << endl;
1742 TVar
res = (TVar)2. * (TVar)
tol;
1743 const int64_t size = this->
Rows();
1745 int64_t p = -1, q = -1;
1746 TVar maxval, theta, cost, sint, aux, aux2, Spp, Sqq, Spq;
1747 while (iter < numiterations){
1750 for(i = 0; i < size; i++){
1751 for(j = 0; j < i; j++) {
1752 if(
fabs(this->
operator ( )(i,j) ) >
fabs(maxval) ) {
1755 maxval =
fabs( this->
operator ( )(i,j) );
1762 if ((REAL)(
fabs(res)) < tol)
break;
1765 theta = 0.5 *
atan((TVar)2. * this->
operator ( )(p,q) / (this->
operator ( )(q,q) - this->
operator ( )(p,p) ) );
1770 for(i = 0; i < size; i++){
1771 if (i != p && i != q){
1773 aux = this->operator ( )(i,p) * (TVar)cost - this->operator ( )(i,q) * (TVar)sint;
1774 aux2 = this->operator ( )(i,p) * (TVar)sint + this->operator ( )(i,q) * (TVar)cost;
1776 this->operator ( )(i,p) = aux;
1777 this->operator ( )(p,i) = aux;
1779 this->operator ( )(i,q) = aux2;
1780 this->operator ( )(q,i) = aux2;
1785 Spp = this->operator ( )(p,p) * cost * cost -(TVar)2. * this->operator ( )(p,q) * sint * cost + this->
operator ( )(q,q) * sint * sint;
1786 Sqq = this->operator ( )(p,p) * sint * sint +(TVar)2. * this->operator ( )(p,q) * sint * cost + this->
operator ( )(q,q) * cost * cost;
1787 Spq = ( this->operator ( )(p,p) - this->
operator ( )(q,q) ) * cost * sint + this->operator ( )(p,q)*( cost*cost - sint*sint );
1789 this->operator ( )(p,p) = Spp;
1790 this->operator ( )(q,q) = Sqq;
1791 this->operator ( )(p,q) = Spq;
1792 this->operator ( )(q,p) = Spq;
1799 multiset< REAL > myset;
1800 for(i = 0; i < size; i++)
1801 { TVar exps = this->operator ( )(i,i);
1806 if ((int64_t)myset.size() != size)
PZError << __PRETTY_FUNCTION__ <<
" - ERROR!" << endl;
1810 multiset< REAL >::iterator w, e = myset.end();
1811 for(i = size - 1, w = myset.begin(); w != e; w++, i--){
1812 Sort->operator [ ](i) = *w;
1817 if ((REAL)(
fabs(res)) < tol){
1819 numiterations = iter;
1824 numiterations = iter;
1838 template <
class TVar>
1840 const int64_t n = this->
Rows();
1842 if (n != this->
Cols()){
1843 PZError << __PRETTY_FUNCTION__
1844 <<
" - matrix must be square - Rows() = " 1845 << this->
Rows() <<
" - Cols() = " 1846 << this->
Cols() << std::endl;
1852 for(i = 0; i < n; i++){
1854 for(j = 0; j < n; j++) sum +=
fabs( this->
Get(i,j) );
1855 if (sum >
fabs(max)) max = sum;
1862 for(i = 0; i < n; i++){
1864 for(j = 0; j < n; j++) sum +=
fabs( this->
Get(j,i) );
1865 if (sum >
fabs(max)) max = sum;
1873 for(i = 0; i < n; i++)
for(j = 0; j < n; j++) transp(i,j) = this->
Get(j,i);
1876 for(i = 0; i < n; i++){
1877 for(j = 0; j < n; j++) ROW[j] = transp(i,j);
1878 for(j = 0; j < n; j++){
1880 for(k = 0; k < n; k++){
1881 sum += ROW[k] * this->
Get(k,j);
1889 if (result ==
false)
PZError << __PRETTY_FUNCTION__
1890 <<
" - it was not possible to find Eigenvalues. Iterations = " 1891 << numiter <<
" - error found = " << tol << std::endl;
1892 return sqrt(EigenVal[0]);
1895 PZError << __PRETTY_FUNCTION__ <<
" p = " << p <<
" is not a correct option" << std::endl;
1901 template <
class TVar>
1903 int64_t localnumiter = numiter;
1904 REAL localtol =
tol;
1906 TVar thisnorm = this->
MatrixNorm(p, localnumiter, localtol);
1908 PZError << __PRETTY_FUNCTION__ <<
" - it was not possible to compute the inverse matrix." << std:: endl;
1911 TVar invnorm = Inv.
MatrixNorm(p, numiter, tol);
1912 return thisnorm * invnorm;
1915 template<
class TVar>
1918 Error(
"Multiply (TPZMatrix<>&,TPZMatrix<TVar> &) <incompatible dimensions>" );
1925 MultAdd( A, B, B, 1.0, 0.0, opt);
1928 template<
class TVar>
1930 const int64_t n = this->
Rows();
1932 if (n != this->
Cols()){
1933 PZError << __PRETTY_FUNCTION__
1934 <<
" - matrix must be square - Rows() = " 1935 << this->
Rows() <<
" - Cols() = " 1936 << this->
Cols() << std::endl;
1943 for(i = 0; i < n; i++) Inv(i,i) = 1.;
1959 template <
class TVar>
1966 for(i=0;i<
Rows();i++) {
1970 for (j=0; j<i; j++) {
1975 for(;j<
Cols();j++) {
1976 val = ((TVar)rand())/((TVar)RAND_MAX);
1978 Error(
"AutoFill (TPZMatrix) failed.");
1979 if(i!=j) sum +=
fabs(val);
1984 PutVal(i,i,sum+(TVar)1.);
1992 template<
class TVar>
2000 if (logger->isDebugEnabled())
2002 std::stringstream sout;
2003 B->
Print(
"On input " , sout);
2009 if (logger->isDebugEnabled())
2011 std::stringstream sout;
2012 B->
Print(
"Only forward " , sout);
2018 if (logger->isDebugEnabled())
2020 std::stringstream sout;
2021 B->
Print(
"After forward and diagonal " , sout);
2027 if (logger->isDebugEnabled())
2029 std::stringstream sout;
2030 B->
Print(
"Final result " , sout);
2057 template<
class TVar>
2058 std::ostream &operator<<(std::ostream& out,const TPZMatrix<TVar> &A) {
2059 A.
Print(
"operator << ",out);
2063 template std::ostream &operator<<(std::ostream &out, const TPZMatrix<int> &A);
2064 template std::ostream &operator<<(std::ostream &out, const TPZMatrix<float> &A);
2065 template std::ostream &operator<<(std::ostream &out, const TPZMatrix<double> &A);
2066 template std::ostream &operator<<(std::ostream &out, const TPZMatrix<long double> &A);
2067 template std::ostream &operator<<(std::ostream &out, const TPZMatrix<std::complex<float> > &A);
2068 template std::ostream &operator<<(std::ostream &out, const TPZMatrix<std::complex<double> > &A);
virtual void SolveSOR(int64_t &numiterations, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, TPZFMatrix< TVar > &scratch, const REAL overrelax, REAL &tol, const int FromCurrent=0, const int direction=1)
Solves the linear system using Successive Over Relaxation method (Gauss Seidel). ...
virtual int AddSub(const int64_t sRow, const int64_t sCol, const TPZFMatrix< TVar > &Source)
It adds Source matrix on current matrix from position (sRow, sCol)
virtual bool SolveEigenvaluesJacobi(int64_t &numiterations, REAL &tol, TPZVec< TVar > *Sort=0)
Transforms this matrix in a diagonal matrix, where the diagonal values are its eigenvalues. This method is efficient only for small matrices.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
int GMRES(Operator &A, Vector &x, const Vector &b, Preconditioner &M, Matrix &H, int &m, int64_t &max_iter, Real &tol, Vector *residual, const int FromCurrent)
GMRES solves the unsymmetric linear system Ax = b using the Generalized Minimum Residual method...
virtual void Transpose(TPZMatrix< TVar > *const T) const
It makes *T the transpose of current matrix.
virtual int PutSub(const int64_t sRow, const int64_t sCol, const TPZFMatrix< TVar > &Source)
It puts submatrix Source on actual matrix structure.
virtual void Residual(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &rhs, TPZFMatrix< TVar > &res)
Computes res = rhs - this * x.
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
int Solve_LU(TPZFMatrix< TVar > *B, std::list< int64_t > &singular)
Solves the linear system using LU method .
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.
bool CompareValues(TPZMatrix< TVar > &M, TVar tol)
Compare values of this to B, with a precision tolerance tol.
virtual void SolveSSOR(int64_t &numiterations, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, TPZFMatrix< TVar > &scratch, const REAL overrelax, REAL &tol, const int FromCurrent=0)
Solves the linear system using Symmetric Successive Over Relaxation method (Gauss Seidel)...
void Write(TPZStream &buf, int withclassid) const override
Packs the object structure in a stream of bytes.
const double tolerance
Tolerance value (Is zero)
static TVar ReturnNearestValue(TVar val, TPZVec< TVar > &Vec, TVar tol)
Retorna o valor mais proximo a "val" (exceto valores no intervalo -tol <= val <= +tol) contido no vet...
static int Error(const char *msg, const char *msg2=0)
Returns error messages.
TPZVec< T > & Sort(TPZVec< T > &v)
Sorting the elements into v.
Defines a abstract class of solvers which will be used by matrix classes. Solver. ...
TPZFMatrix< TVar > operator*(TPZMatrix< TVar > &A, const TPZFMatrix< TVar > &B)
Implements product of matrices: .
Templated vector implementation.
virtual bool SolveEigensystemJacobi(int64_t &numiterations, REAL &tol, TPZVec< TVar > &Eigenvalues, TPZFMatrix< TVar > &Eigenvectors) const
Compute Eigenvalues and Eigenvectors of this matrix. This method is efficient only for small matrice...
MatrixOutputFormat
Defines output format.
virtual void Identity()
Converts the matrix in an identity matrix.
virtual int Resize(const int64_t newRows, const int64_t newCols)
Redimensions a matriz keeping the previous values.
int64_t fRow
Number of rows in matrix.
virtual const TVar & Get(const int64_t row, const int64_t col) const
Get value with bound checking.
void PrepareZ(const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar beta, const int opt) const
Is an auxiliar method used by MultiplyAdd.
int Inverse(TPZFMatrix< TVar > &Inv, DecomposeType dec)
It makes Inv =[this]. IMPORTANT OBSERVATION –> The original matrix (calling object) no is more equal...
Contains the implementation of the BiCG function which solves the unsymmetric linear system using Pre...
char fDecomposed
Decomposition type used to decompose the current matrix.
virtual int Subst_LBackward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is upper triangular with A(i,i)=1.
int BiCGSTAB(const Matrix &A, Vector &x, const Vector &b, Preconditioner &M, int64_t &max_iter, Real &tol, Vector *residual, const int FromCurrent)
BiCGSTAB solves the unsymmetric linear system using the Preconditioned BiConjugate Gradient Stabiliz...
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.
AutoPointerMutexArrayInit tmp
virtual ~TPZMatrix()
Simple destructor.
char fDefPositive
Definite Posistiveness of current matrix.
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
It computes z = beta * y + alpha * opt(this)*x but z and x can not overlap in memory.
Contains the implementation of the CMRES function which solves the unsymmetric linear system using th...
TPZFMatrix< TVar > operator+(const TPZMatrix< TVar > &A, const TPZMatrix< TVar > &B)
Implements sum of matrices: .
void MultAdd(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha, const TVar beta, const int opt) const override
It computes z = beta * y + alpha * opt(this)*x but z and x can not overlap in memory.
static TVar gZero
Initializing value to static variable.
Contains the implementation of the BiCGSTAB function which solves the unsymmetric linear system using...
virtual int GetSub(const int64_t sRow, const int64_t sCol, const int64_t rowSize, const int64_t colSize, TPZFMatrix< TVar > &Target) const
Gets submatrix storing it on Target.
virtual int Decompose_LDLt()
Decomposes the current matrix using LDLt.
virtual const TVar & GetVal(const int64_t, const int64_t) const
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.
int BiCG(Matrix &A, Vector &x, const Vector &b, Preconditioner &M, int64_t &max_iter, Real &tol)
virtual TVar & s(const int64_t row, const int64_t col) override
The operators check on the bounds if the DEBUG variable is defined.
void Print(const char *name=NULL, std::ostream &out=std::cout, const MatrixOutputFormat=EFormatted) const override
Prints the object data structure.
int Zero() override
Makes Zero all the elements.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
int Solve_LDLt(TPZFMatrix< TVar > *B, std::list< int64_t > &singular)
Solves the linear system using LDLt method .
std::istream & operator>>(std::istream &in, TPZMatrix< TVar > &A)
Overload >> operator to input data of the matrix.
virtual void SolveGMRES(int64_t &numiterations, TPZSolver< TVar > &preconditioner, TPZFMatrix< TVar > &H, int &numvectors, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent)
Solves the linear system using Generalized Minimal Residual (GMRES) method. .
virtual void Write(const bool val)
virtual void SolveBICGStab(int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent=0)
Solves the linear system using Bi-Conjugate Gradient stabilized method. .
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
#define DebugStop()
Returns a message to user put a breakpoint in.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
virtual void Add(const TPZMatrix< TVar > &A, TPZMatrix< TVar > &res) const
It adds itself to TPZMatrix<TVar>A putting the result in res.
virtual void SolveIR(int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent=0)
Solves the linear system using IR method. .
virtual bool Compare(TPZSavable *copy, bool override=false) override
Compare the object for identity with the object pointed to, eventually copy the object.
virtual void SolveCG(int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent=0)
Solves the linear system using Conjugate Gradient method. .
virtual void SolveJacobi(int64_t &numiterations, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, TPZFMatrix< TVar > &scratch, REAL &tol, const int FromCurrent=0)
Solves the linear system using Jacobi method. .
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.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
virtual int Put(const int64_t row, const int64_t col, const TVar &value)
Put values with bounds checking if DEBUG variable is defined.
virtual void AddKel(TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix.
virtual int InsertSub(const int64_t sRow, const int64_t sCol, const int64_t rowSize, const int64_t colSize, const int64_t pRow, const int64_t pCol, TPZMatrix< TVar > *Target) const
Inserts a submatrix from current object on matrix *Target with no redimentioning.
void Read(TPZStream &buf, void *context) override
Unpacks the object structure from a stream of bytes.
#define MIN(a, b)
Gets minime value between a and b.
virtual void Input(std::istream &in=std::cin)
Input operation.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
virtual int Redim(const int64_t newRows, const int64_t newCols)
Redimensions the matrix reinitializing it with zero.
Full matrix class. Matrix.
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
int Redim(const int64_t dim, const int64_t dim00) override
Redim: Set the dimension of the complete matrix and reduced matrix.
virtual void SolveBICG(int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, REAL &tol)
Solves the linear system using Bi-Conjugate Gradient method. .
virtual int Subst_LForward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is lower triangular with A(i,i)=1.
virtual int64_t Dim() const
Returns the dimension of the matrix if the matrix is square.
Contains TPZMatrix<TVar>class, root matrix class.
int64_t fCol
Number of cols in matrix.
virtual int PutVal(const int64_t row, const int64_t col, const TVar &value) override
Put and Get values without bounds checking these methods are faster than "Put" e "Get" if DEBUG is de...
virtual int Decompose_Cholesky()
Decomposes the current matrix using Cholesky method. The current matrix has to be symmetric...
virtual int PutVal(const int64_t, const int64_t, const TVar &val)
Put values without bounds checking This method is faster than "Put" if DEBUG is defined.
int CG(Matrix &A, Vector &x, const Vector &b, Preconditioner &M, Vector *residual, int64_t &max_iter, Real &tol, const int FromCurrent)
CG solves the symmetric positive definite linear system using the Conjugate Gradient method...
virtual void Substract(const TPZMatrix< TVar > &A, TPZMatrix< TVar > &result) const
It substracts A from storing the result in result.
int IR(Matrix &A, Vector &x, const Vector &b, Preconditioner &M, Vector *residual, int64_t &max_iter, Real &tol, const int FromCurrent)
IR solves the unsymmetric linear system Ax = b using Iterative Refinement (preconditioned Richardson ...
virtual int VerifySymmetry(REAL tol=1.e-13) const
Checks if current matrix value is symmetric.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ atan
void AutoFill(int64_t nrow, int64_t ncol, int symmetric)
Fill matrix storage with randomic values.
virtual void Multiply(const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &res, int opt=0) const
It mutiplies itself by TPZMatrix<TVar>A putting the result in res.
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
virtual int IsSimetric() const override
returns 1 or 0 depending on whether the fK00 matrix is zero or not
virtual int Decompose_LU()
Contains TPZStepSolver class which defines step solvers class.
int64_t Cols() const
Returns number of cols.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ exp
virtual void Print(std::ostream &out) const
int Resize(const int64_t newRows, const int64_t wCols) override
Redimension a matrix, but maintain your elements.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
virtual int Substitution(TPZFMatrix< TVar > *B) const
Computes Forward and Backward substitution for a "LU" decomposed matrix.
virtual int Solve_Cholesky(TPZFMatrix< TVar > *B)
Solves the linear system using Cholesky method .
TVar MatrixNorm(int p, int64_t numiter=2000000, REAL tol=1.e-10) const
Computes the matrix norm of this.
virtual 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.
TVar ConditionNumber(int p, int64_t numiter=2000000, REAL tol=1.e-10)
Computes the matrix condition number of this.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
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.
virtual void Simetrize()
Simetrizes copies upper plan to the lower plan, making its data simetric.
TVar & g(const int64_t row, const int64_t col) const
Contains the implementation of the CG function which solves the symmetric positive definite linear sy...
virtual int SolveDirect(TPZFMatrix< TVar > &F, const DecomposeType dt, std::list< int64_t > &singular)
Solves the linear system using Direct methods.
Contains the implementation of the IR function which solves the unsymmetric linear system using the I...
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
#define PZError
Defines the output device to error messages and the DebugStop() function.
DecomposeType
Defines decomposition type for any matrix classes.
virtual void Read(bool &val)
virtual int Subst_Backward(TPZFMatrix< TVar > *b) const
Computes B = Y, where A*Y = B, A is upper triangular.
Root matrix class (abstract). Matrix.
TPZFMatrix< TVar > operator-(const TPZMatrix< TVar > &A, const TPZMatrix< TVar > &B)
Implements difference of matrices: .