21 static LoggerPtr logger(Logger::getLogger(
"pz.matrix.tpzsbmatrix"));
39 fBand = ( band > (dim - 1) ? (dim - 1) : band );
46 return ((TVar) rand() )/((TVar)RAND_MAX);
50 std::complex<float>
Random(std::complex<float>){
51 std::complex<float> I(0,1);
52 return ((std::complex<float>) rand() + I*(
float)rand() )/((std::complex<float>)RAND_MAX);
55 std::complex<double>
Random( std::complex<double> ){
56 std::complex<double> I(0,1);
57 return ((std::complex<double>) rand() + I*(
double)rand() )/((std::complex<double>)RAND_MAX);
65 if (nrow != ncol || symmetric == 0) {
77 for(i=0;i<this->
Rows();i++) {
79 int64_t jmax = i+
fBand+1;
80 if (jmax >= this->
Rows()) {
90 std::cout <<
"AutoFill (TPZMatrix) failed.";
93 if(i!=j) sum +=
fabs(val);
96 std::complex<double> complex_val(val);
97 val = std::real(complex_val);
119 int64_t row(r),col(c);
124 if ( (index = col-row) >
fBand )
127 if (value != this->
gZero) {
143 int64_t row(r),col(c);
145 this->
Swap( &row, &col );
148 if ( (index = col-row) >
fBand )
151 if (value != this->
gZero) {
161 template <
class TVar>
166 int64_t row(r),col(c);
168 this->
Swap( &row, &col );
171 if ( (index = col-row) >
fBand )
174 if (value != this->
gZero) {
188 const std::complex<float>
192 int64_t row(r),col(c);
193 bool mustConj =
false;
195 this->
Swap( &row, &col );
200 if ( (index = col-row) >
fBand )
201 return( this->
gZero );
204 if( mustConj ==
true){
205 static std::complex<float> cpVal;
207 cpVal = std::conj( cpVal );
216 const std::complex<double>
220 int64_t row(r), col(c);
221 bool mustConj =
false;
223 this->
Swap( &row, &col );
228 if ( (index = col-row) >
fBand )
229 return( this->
gZero );
231 if( mustConj ==
true){
232 static std::complex<double> cpVal;
234 cpVal = std::conj( cpVal );
248 int64_t row(r),col(c);
250 this->
Swap( &row, &col );
253 if ( (index = col-row) >
fBand )
254 return( this->
gZero );
265 int64_t row(r),col(c);
266 bool mustConj =
false;
268 this->
Swap( &row, &col );
273 if ( (index = col-row) >
fBand )
274 return( this->
gZero );
276 static std::complex<float> cpVal;
290 int64_t row(r),col(c);
291 bool mustConj =
false;
293 this->
Swap( &row, &col );
298 if ( (index = col-row) >
fBand )
299 return( this->
gZero );
301 static std::complex<double> cpVal;
315 this->
Swap( &row, &col );
318 if ( (index = col-row) >
fBand )
319 return( this->
gZero );
335 out <<
"Writing matrix '" << name;
336 out <<
"' (" << this->
Rows() <<
" x " << this->
Cols() <<
") Bandwith = "<<
fBand<<
"\n";
354 operator<<(std::ostream& out,TPZSBMatrix<TVar> &A)
359 out <<
"\n(" << A.Rows() <<
" x " << A.Cols()
360 <<
") Bandwith = "<< A.GetBand()<<
"\n";
362 for ( int64_t row = 0; row < A.Rows(); row++)
365 for ( int64_t col = 0; col < A.Cols(); col++ )
366 out << A.Get( row, col) <<
" ";
434 for (int64_t i=0; i<siz; i++) {
452 for (int64_t i=0; i<siz; i++) {
461 const TVar alpha,
const TVar beta ,
const int opt)
const {
465 TPZMatrix<TVar>::Error(__PRETTY_FUNCTION__,
"TPZSBMatrix::MultAdd <matrixs with incompatible dimensions>" );
470 int64_t rows = this->
Rows();
471 int64_t xcols = x.
Cols();
473 for (ic = 0; ic < xcols; ic++) {
475 for ( r = 0; r < rows; r++ ) {
480 for ( int64_t i = begin ; i < end; i++ ) val +=
GetVal( r, i ) * x.
GetVal(i, ic );
515 for (int64_t i=0; i<siz; i++) {
516 res.
fDiag[i] *= value;
533 for (int64_t i=0; i<siz; i++) {
550 if ( newDim == this->
Dim() )
553 Redim(newDim,newDim);
566 if (newDim != otherDim) {
570 if ( newDim != this->
Dim() )
573 if (
fBand > newDim-1) {
590 for (int64_t i=0; i<siz; i++) {
607 if ( this->
fBand == newBand )
610 int64_t nB = newBand;
611 if ( newBand > (this->
Dim() - 1) )
648 char uplo[] =
"Upper";
650 int lda = this->
fBand + 1;
651 int kd = this->
fBand;
654 cpbtrf_(uplo, &n, &kd , (varfloatcomplex*)
fDiag.
begin(), &lda, &info);
679 char uplo[] =
"Upper";
681 int lda = this->
fBand + 1;
682 int kd = this->
fBand;
684 zpbtrf_(uplo, &n, &kd, (vardoublecomplex *)
fDiag.
begin(), &lda, &info);
710 float *ab = &
fDiag[0];
716 spbsv_(uplo, &n, &kd, &nrhs, ab, &ldab, &b, &n, &info);
738 double *ab = &
fDiag[0];
744 dpbsv_(uplo, &n, &kd, &nrhs, ab, &ldab, &b, &n, &info);
777 int64_t j,k,l, begin,end;
780 for ( j = 0; j < this->
Dim(); j++ )
785 begin =
MAX( int64_t(j -
fBand), 0 );
787 for ( k=begin; k<j; k++)
800 for( l=j+1; l<end;l++)
814 for( l=j+1; l<end;l++)
844 int64_t bcols = B->
Cols();
845 for(int64_t ic=0; ic<bcols; ic++)
848 float *bptr = &(*B)(0,ic);
849 cblas_stbsv(CblasColMajor, CblasUpper, CblasTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
865 int64_t bcols = B->
Cols();
866 for(int64_t ic=0; ic<bcols; ic++)
869 double *bptr = &(*B)(0,ic);
870 cblas_dtbsv(CblasColMajor, CblasUpper, CblasTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
886 int64_t bcols = B->
Cols();
887 for(int64_t ic=0; ic<bcols; ic++)
889 std::complex<float> *bptr = &(*B)(0,ic);
890 cblas_ctbsv(CblasColMajor, CblasUpper, CblasTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
906 int64_t bcols = B->
Cols();
907 for(int64_t ic=0; ic<bcols; ic++)
909 std::complex<double> *bptr = &(*B)(0,ic);
910 cblas_ztbsv(CblasColMajor, CblasUpper, CblasTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
926 int64_t bcols = B->
Cols();
927 for(int64_t ic=0; ic<bcols; ic++)
929 float *bptr = &(*B)(0,ic);
930 cblas_stbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
947 int64_t bcols = B->
Cols();
948 for(int64_t ic=0; ic<bcols; ic++)
950 double *bptr = &(*B)(0,ic);
951 cblas_dtbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
967 int64_t bcols = B->
Cols();
968 for(int64_t ic=0; ic<bcols; ic++)
970 std::complex<float> *bptr = &(*B)(0,ic);
971 cblas_ctbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
988 int64_t bcols = B->
Cols();
989 for(int64_t ic=0; ic<bcols; ic++)
991 std::complex<double> *bptr = &(*B)(0,ic);
992 cblas_ztbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasNonUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1008 int64_t bcols = B->
Cols();
1009 for(int64_t ic=0; ic<bcols; ic++)
1011 float *bptr = &(*B)(0,ic);
1012 cblas_stbsv(CblasColMajor, CblasUpper, CblasTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1028 int64_t bcols = B->
Cols();
1029 for(int64_t ic=0; ic<bcols; ic++)
1031 double *bptr = &(*B)(0,ic);
1032 cblas_dtbsv(CblasColMajor, CblasUpper, CblasTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1048 int64_t bcols = B->
Cols();
1049 for(int64_t ic=0; ic<bcols; ic++)
1051 std::complex<float> *bptr = &(*B)(0,ic);
1052 cblas_ctbsv(CblasColMajor, CblasUpper, CblasTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1068 int64_t bcols = B->
Cols();
1069 for(int64_t ic=0; ic<bcols; ic++)
1071 std::complex<double> *bptr = &(*B)(0,ic);
1072 cblas_ztbsv(CblasColMajor, CblasUpper, CblasTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1088 int64_t bcols = B->
Cols();
1089 for(int64_t ic=0; ic<bcols; ic++)
1091 float *bptr = &(*B)(0,ic);
1092 cblas_stbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1109 int64_t bcols = B->
Cols();
1110 for(int64_t ic=0; ic<bcols; ic++)
1112 double *bptr = &(*B)(0,ic);
1113 cblas_dtbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1129 int64_t bcols = B->
Cols();
1130 for(int64_t ic=0; ic<bcols; ic++)
1132 std::complex<float> *bptr = &(*B)(0,ic);
1133 cblas_ctbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1150 int64_t bcols = B->
Cols();
1151 for(int64_t ic=0; ic<bcols; ic++)
1153 std::complex<double> *bptr = &(*B)(0,ic);
1154 cblas_ztbsv(CblasColMajor, CblasUpper, CblasNoTrans, CblasUnit, n, kd, &
fDiag[0], lda, bptr , 1);
1161 template<
class TVar>
1177 template<
class TVar>
1183 int64_t size =
fBand + 1;
1185 for ( k = 0; k < this->
Dim(); k++ )
1187 for ( j = 0; j < B->
Cols(); j++ )
1191 int64_t imin = k-
fBand;
1192 if(imin < 0) imin = 0;
1194 int64_t end=(k-fBand>0)? fBand:k;
1196 for ( i = imin; i < k ; i++ )
1214 template<
class TVar>
1222 int64_t size =
fBand + 1;
1223 for ( int64_t k = 0; k < this->
Dim(); k++ )
1224 for ( int64_t j = 0; j < B->
Cols(); j++ )
1230 template<
class TVar>
1241 template<
class TVar>
1247 int64_t k,j,jmax,stepcol=
fBand+2;
1249 for(k=0; k<B->
Cols() ; k++)
1251 for(int64_t i=this->
Rows()-1; i>=0; i--)
1255 for(j=i+1;j<jmax;j++)
1258 sum += B->
GetVal(j,k)*el;
1260 B->operator()(i,k) -= sum;
1273 template<
class TVar>
1286 template<
class TVar>
1298 template<
class TVar>
1302 TPZMatrix<float>::Error(__PRETTY_FUNCTION__,
"SolveEigenProblem <LAPACK does not support this specific data type>" );
1306 template<
class TVar>
1310 TPZMatrix<TVar>::Error(__PRETTY_FUNCTION__,
"SolveEigenProblem <LAPACK does not support this specific data type>" );
1322 int n = this->
Dim();
1323 int kd = this->
fBand;
1324 int ldab = this->
fBand + 1;
1328 int ldz = this->
Dim();
1332 dsbev_(&jobz, &uplo, &n, &kd,
fDiag.
begin(), &ldab, w.
begin(), z.
begin(), &ldz, work.
begin(), &info);
1337 TPZMatrix<double>::Error(__PRETTY_FUNCTION__,
"SolveEigenProblem <Invalid argument. Check info value for more information>");
1340 eigenvalues.Resize( this->
Dim() );
1341 for (
int i = 0 ; i < this->
Dim() ; i++) {
1342 eigenvalues[i] = w[i];
1355 int n = this->
Dim();
1356 int kd = this->
fBand;
1357 int ldab = this->
fBand + 1;
1361 int ldz = this->
Dim();
1366 zhbev_(&jobz, &uplo, &n, &kd, (vardoublecomplex *)
fDiag.
begin(), &ldab, w.
begin(), (vardoublecomplex *)z.
begin(), &ldz, (vardoublecomplex *)work.
begin(),rwork.
begin(), &info);
1375 eigenvalues.Resize( this->
Dim() );
1376 for (
int i = 0 ; i < this->
Dim() ; i++) {
1377 eigenvalues[i] = w[i];
1391 int n = this->
Dim();
1392 int kd = this->
fBand;
1393 int ldab = this->
fBand + 1;
1394 int ldbb = this->
fBand + 1;
1398 int ldz = this->
Dim();
1402 dsbev_(&jobz, &uplo, &n, &kd,
fDiag.
begin(), &ldab, w.
begin(), &z(0,0), &ldz, work.
begin(), &info);
1407 TPZMatrix<double>::Error(__PRETTY_FUNCTION__,
"SolveEigenProblem <Invalid argument. Check info value for more information>");
1409 eigenvalues.Resize( this->
Dim() );
1410 for(
int i = 0 ; i < this->
Dim() ; i++){
1411 eigenvalues[i] = w[i];
1413 eigenVectors.Redim(this->
Dim(), this->
Dim());
1414 for (
int iVec = 0 ; iVec < this->
Dim(); iVec++) {
1415 for (
int iCol = 0; iCol < this->
Dim(); iCol++) {
1416 eigenVectors( iVec , iCol) = z(iVec, iCol);
1433 int n = this->
Dim();
1434 int kd = this->
fBand;
1435 int ldab = this->
fBand + 1;
1439 int ldz = this->
Dim();
1444 zhbev_(&jobz, &uplo, &n, &kd, (vardoublecomplex *)
fDiag.
begin(), &ldab, w.
begin(), (vardoublecomplex *)&z(0,0), &ldz, (vardoublecomplex *)work.
begin(),rwork.
begin(), &info);
1451 eigenvalues.Resize( this->
Dim());
1452 for(
int i = 0; i < this->
Dim(); i++){
1453 eigenvalues[i] = w[i];
1455 eigenVectors.Redim(this->
Dim(), this->
Dim());
1456 for (
int iVec = 0 ; iVec < this->
Dim(); iVec++) {
1457 for (
int iCol = 0; iCol < this->
Dim(); iCol++) {
1458 eigenVectors( iVec , iCol) = z(iVec,iCol);
1475 int n = this->
Dim();
1476 int kd = this->
fBand;
1477 int ldab = this->
fBand + 1;
1481 int ldz = this->
Dim();
1485 ssbev_(&jobz, &uplo, &n, &kd,
fDiag.
begin(), &ldab, w.
begin(), z.
begin(), &ldz, work.
begin(), &info);
1490 TPZMatrix<float>::Error(__PRETTY_FUNCTION__,
"SolveEigenProblem <Invalid argument. Check info value for more information>");
1493 eigenvalues.Resize( this->
Dim() );
1494 for (
int i = 0 ; i < this->
Dim() ; i++) {
1495 eigenvalues[i] = w[i];
1508 int n = this->
Dim();
1509 int kd = this->
fBand;
1510 int ldab = this->
fBand + 1;
1514 int ldz = this->
Dim();
1519 chbev_(&jobz, &uplo, &n, &kd, (varfloatcomplex *)
fDiag.
begin(), &ldab, w.
begin(), (varfloatcomplex *)z.
begin(), &ldz, (varfloatcomplex *)work.
begin(),rwork.
begin(), &info);
1528 eigenvalues.Resize( this->
Dim() );
1529 for (
int i = 0 ; i < this->
Dim() ; i++) {
1530 eigenvalues[i] = w[i];
1544 int n = this->
Dim();
1545 int kd = this->
fBand;
1546 int ldab = this->
fBand + 1;
1547 int ldbb = this->
fBand + 1;
1551 int ldz = this->
Dim();
1555 ssbev_(&jobz, &uplo, &n, &kd,
fDiag.
begin(), &ldab, w.
begin(), &z(0,0), &ldz, work.
begin(), &info);
1560 TPZMatrix<float>::Error(__PRETTY_FUNCTION__,
"SolveEigenProblem <Invalid argument. Check info value for more information>");
1562 eigenvalues.Resize( this->
Dim() );
1563 for(
int i = 0 ; i < this->
Dim() ; i++){
1564 eigenvalues[i] = w[i];
1566 eigenVectors.Redim(this->
Dim(), this->
Dim());
1567 for (
int iVec = 0 ; iVec < this->
Dim(); iVec++) {
1568 for (
int iCol = 0; iCol < this->
Dim(); iCol++) {
1569 eigenVectors( iVec , iCol) = z(iVec,iCol);
1586 int n = this->
Dim();
1587 int kd = this->
fBand;
1588 int ldab = this->
fBand + 1;
1592 int ldz = this->
Dim();
1597 chbev_(&jobz, &uplo, &n, &kd, (varfloatcomplex *)
fDiag.
begin(), &ldab, w.
begin(), (varfloatcomplex *)&z(0,0), &ldz, (varfloatcomplex *)work.
begin(),rwork.
begin(), &info);
1604 eigenvalues.Resize( this->
Dim());
1605 for(
int i = 0; i < this->
Dim(); i++){
1606 eigenvalues[i] = w[i];
1608 eigenVectors.Redim(this->
Dim(), this->
Dim());
1609 for (
int iVec = 0 ; iVec < this->
Dim(); iVec++) {
1610 for (
int iCol = 0; iCol < this->
Dim(); iCol++) {
1611 eigenVectors( iVec , iCol) = z(iVec,iCol);
1620 template<
class TVar>
1624 TPZMatrix<TVar>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <LAPACK does not support this specific data type>" );
1627 template<
class TVar>
1631 TPZMatrix<TVar>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <LAPACK does not support this specific data type>" );
1646 int n = this->
Dim();
1647 int ka = this->
fBand;
1649 int ldab = this->
fBand + 1;
1650 int ldbb = this->
fBand + 1;
1654 int ldz = this->
Dim();
1658 ssbgv_(&jobz, &uplo, &n, &ka, &kb,
fDiag.
begin(), &ldab, B.
fDiag.begin(), &ldbb, w.
begin(), &z(0,0), &ldz, work.
begin(), &info);
1660 TPZMatrix<float>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <The algorithm failed to converge>");
1663 TPZMatrix<float>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <Invalid argument. Check info value for more information>");
1665 eigenvalues.Resize( this->
Dim() );
1666 eigenVectors.Resize( this->
Dim() , this->
Dim() );
1667 for (
int i = 0; i < this->
Dim() ; i++) {
1668 eigenvalues[i] = w[i];
1669 for (
int j = 0 ; j < this->
Dim() ; j++) {
1670 eigenVectors(i,j) = z(i,j);
1692 int n = this->
Dim();
1693 int ka = this->
fBand;
1695 int ldab = this->
fBand + 1;
1696 int ldbb = this->
fBand + 1;
1700 int ldz = this->
Dim();
1704 ssbgv_(&jobz, &uplo, &n, &ka, &kb,
fDiag.
begin(), &ldab, B.
fDiag.begin(), &ldbb, w.
begin(), &z(0,0), &ldz, work.
begin(), &info);
1706 TPZMatrix<float>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <The algorithm failed to converge>");
1709 TPZMatrix<float>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <Invalid argument. Check info value for more information>");
1711 eigenvalues.Resize( this->
Dim() );
1712 for (
int i = 0; i < this->
Dim() ; i++) {
1713 eigenvalues[i] = w[i];
1733 int n = this->
Dim();
1734 int ka = this->
fBand;
1736 int ldab = this->
fBand + 1;
1737 int ldbb = this->
fBand + 1;
1741 int ldz = this->
Dim();
1746 chbgv_(&jobz, &uplo, &n, &ka, &kb, (varfloatcomplex *)
fDiag.
begin(), &ldab, (varfloatcomplex *)B.
fDiag.begin(), &ldbb, w.
begin(), (varfloatcomplex *)&z(0,0), &ldz, (varfloatcomplex *)work.
begin(),rwork.
begin(), &info);
1753 eigenvalues.Resize( this->
Dim() );
1754 eigenVectors.Resize( this->
Dim() , this->
Dim() );
1755 for (
int i = 0; i < this->
Dim() ; i++) {
1756 eigenvalues[i] = w[i];
1757 for (
int j = 0 ; j < this->
Dim() ; j++) {
1758 eigenVectors(i,j) = z(i,j);
1780 int n = this->
Dim();
1781 int ka = this->
fBand;
1783 int ldab = this->
fBand + 1;
1784 int ldbb = this->
fBand + 1;
1788 int ldz = this->
Dim();
1793 chbgv_(&jobz, &uplo, &n, &ka, &kb, (varfloatcomplex *)
fDiag.
begin(), &ldab, (varfloatcomplex *)B.
fDiag.begin(), &ldbb, w.
begin(), (varfloatcomplex *)&z(0,0), &ldz, (varfloatcomplex *)work.
begin(),rwork.
begin(), &info);
1800 eigenvalues.Resize( this->
Dim() );
1801 for (
int i = 0; i < this->
Dim() ; i++) {
1802 eigenvalues[i] = w[i];
1823 int n = this->
Dim();
1824 int ka = this->
fBand;
1826 int ldab = this->
fBand + 1;
1827 int ldbb = this->
fBand + 1;
1831 int ldz = this->
Dim();
1835 dsbgv_(&jobz, &uplo, &n, &ka, &kb,
fDiag.
begin(), &ldab, B.
fDiag.begin(), &ldbb, w.
begin(), &z(0,0), &ldz, work.
begin(), &info);
1840 TPZMatrix<double>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <Invalid argument. Check info value for more information>");
1842 eigenvalues.Resize( this->
Dim() );
1843 eigenVectors.Resize( this->
Dim() , this->
Dim() );
1844 for (
int i = 0; i < this->
Dim() ; i++) {
1845 eigenvalues[i] = w[i];
1846 for (
int j = 0 ; j < this->
Dim() ; j++) {
1847 eigenVectors(i,j) = z(i,j);
1869 int n = this->
Dim();
1870 int ka = this->
fBand;
1872 int ldab = this->
fBand + 1;
1873 int ldbb = this->
fBand + 1;
1877 int ldz = this->
Dim();
1881 dsbgv_(&jobz, &uplo, &n, &ka, &kb,
fDiag.
begin(), &ldab, B.
fDiag.begin(), &ldbb, w.
begin(), &z(0,0), &ldz, work.
begin(), &info);
1886 TPZMatrix<double>::Error(__PRETTY_FUNCTION__,
"SolveGeneralisedEigenProblem <Invalid argument. Check info value for more information>");
1888 eigenvalues.Resize( this->
Dim() );
1889 for (
int i = 0; i < this->
Dim() ; i++) {
1890 eigenvalues[i] = w[i];
1909 int n = this->
Dim();
1910 int ka = this->
fBand;
1912 int ldab = this->
fBand + 1;
1913 int ldbb = this->
fBand + 1;
1917 int ldz = this->
Dim();
1922 zhbgv_(&jobz, &uplo, &n, &ka, &kb, (vardoublecomplex *)
fDiag.
begin(), &ldab, (vardoublecomplex *)B.
fDiag.begin(), &ldbb, w.
begin(), (vardoublecomplex *)&z(0,0), &ldz, (vardoublecomplex *)work.
begin(),rwork.
begin(), &info);
1929 eigenvalues.Resize( this->
Dim() );
1930 eigenVectors.Resize( this->
Dim() , this->
Dim() );
1931 for (
int i = 0; i < this->
Dim() ; i++) {
1932 eigenvalues[i] = w[i];
1933 for (
int j = 0 ; j < this->
Dim() ; j++) {
1934 eigenVectors(i,j) = z(i,j);
1956 int n = this->
Dim();
1957 int ka = this->
fBand;
1959 int ldab = this->
fBand + 1;
1960 int ldbb = this->
fBand + 1;
1964 int ldz = this->
Dim();
1969 zhbgv_(&jobz, &uplo, &n, &ka, &kb, (vardoublecomplex *)
fDiag.
begin(), &ldab, (vardoublecomplex *)B.
fDiag.begin(), &ldbb, w.
begin(), (vardoublecomplex *)&z(0,0), &ldz, (vardoublecomplex *)work.
begin(),rwork.
begin(), &info);
1976 eigenvalues.Resize( this->
Dim() );
1977 for (
int i = 0; i < this->
Dim() ; i++) {
1978 eigenvalues[i] = w[i];
1988 template<
class TVar>
int ClassId() const override
Define the class id associated with the class.
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
void Copy(const TPZSBMatrix< TVar > &)
int Redim(const int64_t newDim)
Redimension the matrix and zeroes its elements.
Implements symmetric band matrices. Matrix.
int Decompose_LDLt() override
Decomposes the current matrix using LDLt.
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
Contains TPZSBMatrix class which implements symmetric band matrices(hermitian, for the complex case...
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.
TPZSBMatrix & operator-=(const TPZSBMatrix< TVar > &A)
static int Error(const char *msg, const char *msg2=0)
Returns error messages.
virtual void resize(const int64_t newsize)
TPZSBMatrix & operator=(const TPZSBMatrix< TVar > &A)
Operadores com matrizes SKY LINE.
int Clear() override
It clears data structure.
MatrixOutputFormat
Defines output format.
int64_t fRow
Number of rows in matrix.
void PrepareZ(const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar beta, const int opt) const
Is an auxiliar method used by MultiplyAdd.
char fDecomposed
Decomposition type used to decompose the current matrix.
This class implements a simple vector storage scheme for a templated class T. Utility.
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.
#define MAX(a, b)
Gets maxime value between a and b.
char fDefPositive
Definite Posistiveness of current matrix.
static TVar gZero
Initializing value to static variable.
TVar & operator()(int64_t row, int64_t col)
TPZSBMatrix< TVar > & operator*=(const TVar v)
int64_t size() const
Returns the number of elements of the vector.
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 Resize(const int64_t newDim, const int64_t) override
Redimension the matrix keeping original elements.
Contains TPZMatrixclass which implements full matrix (using column major representation).
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.
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZSBMatrix & operator+=(const TPZSBMatrix< TVar > &A)
int Subst_LBackward(TPZFMatrix< TVar > *B) const override
Computes B = Y, where A*Y = B, A is upper triangular with A(i,i)=1.
int64_t Rows() const
Returns number of rows.
int PutVal(const int64_t row, const int64_t col, const TVar &element) 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)
int Subst_Forward(TPZFMatrix< TVar > *B) const override
To solve linear systems.
TPZSBMatrix operator+(const TPZSBMatrix< TVar > &A) const
int SetBand(const int64_t newBand)
T * begin() const
Casting operator. Returns The fStore pointer.
#define MIN(a, b)
Gets minime value between a and b.
virtual int Redim(const int64_t newRows, const int64_t newCols)
Redimensions the matrix reinitializing it with zero.
Full matrix class. Matrix.
virtual int64_t Dim() const
Returns the dimension of the matrix if the matrix is square.
int Subst_Backward(TPZFMatrix< TVar > *b) const override
Computes B = Y, where A*Y = B, A is upper triangular.
int32_t Hash(std::string str)
TPZSBMatrix< TVar > operator*(const TVar v) const
int64_t fCol
Number of cols in matrix.
void Print(const char *name=NULL, std::ostream &out=std::cout, const MatrixOutputFormat form=EFormatted) const override
It prints the matrix data in a MatrixFormat Rows X Cols.
virtual int Decompose_Cholesky()
Decomposes the current matrix using Cholesky method. The current matrix has to be symmetric...
static void Swap(int64_t *a, int64_t *b)
Swaps contents of a in b and b in a.
int Subst_Diag(TPZFMatrix< TVar > *B) const override
Computes B = Y, where A*Y = B, A is diagonal matrix.
int Subst_LForward(TPZFMatrix< TVar > *B) const override
Computes B = Y, where A*Y = B, A is lower triangular with A(i,i)=1.
int64_t Cols() const
Returns number of cols.
virtual void Print(std::ostream &out) const
TPZSBMatrix< TVar > operator-() const
int Zero() override
Zeroes the elements of the matrix.
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.
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.
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.
int64_t Index(int64_t i, int64_t j) 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.