CPPLapack
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Public Attributes | Friends | List of all members
_dsymatrix Class Reference

(DO NOT USE) Smart-temporary Real Double-precision Symmetric Matrix Class More...

#include <_dsymatrix.hpp>

Public Member Functions

 _dsymatrix ()
 
 _dsymatrix (const _dsymatrix &)
 
 ~_dsymatrix ()
 
_zhematrix to_zhematrix () const
 
_dgematrix to_dgematrix () const
 
_dssmatrix to_dssmatrix (const double=DBL_MIN) const
 
double & operator() (const CPPL_INT &, const CPPL_INT &) const
 
void write (const char *) const
 
void nullify () const
 
void destroy () const
 
void complete () const
 

Public Attributes

CPPL_INT const & m
 matrix row size More...
 
CPPL_INT n
 matrix column size More...
 
double * array
 1D array to store matrix data More...
 
double ** darray
 array of pointers of column head addresses More...
 

Friends

std::ostream & operator<< (std::ostream &, const dsymatrix &)
 
_dsymatrix t (const _dsymatrix &)
 
_dsymatrix i (const _dsymatrix &)
 
void idamax (CPPL_INT &, CPPL_INT &, const _dsymatrix &)
 
double damax (const _dsymatrix &)
 
const _dsymatrixoperator+ (const _dsymatrix &)
 
_dsymatrix operator- (const _dsymatrix &)
 
_dgematrix operator+ (const _dsymatrix &, const dgematrix &)
 
_dgematrix operator+ (const _dsymatrix &, const _dgematrix &)
 
_dsymatrix operator+ (const _dsymatrix &, const dsymatrix &)
 
_dsymatrix operator+ (const _dsymatrix &, const _dsymatrix &)
 
_dgematrix operator+ (const _dsymatrix &, const dgbmatrix &)
 
_dgematrix operator+ (const _dsymatrix &, const _dgbmatrix &)
 
_dgematrix operator+ (const _dsymatrix &, const dgsmatrix &)
 
_dgematrix operator+ (const _dsymatrix &, const _dgsmatrix &)
 
_dsymatrix operator+ (const _dsymatrix &, const dssmatrix &)
 
_dsymatrix operator+ (const _dsymatrix &, const _dssmatrix &)
 
_dgematrix operator- (const _dsymatrix &, const dgematrix &)
 
_dgematrix operator- (const _dsymatrix &, const _dgematrix &)
 
_dsymatrix operator- (const _dsymatrix &, const dsymatrix &)
 
_dsymatrix operator- (const _dsymatrix &, const _dsymatrix &)
 
_dgematrix operator- (const _dsymatrix &, const dgbmatrix &)
 
_dgematrix operator- (const _dsymatrix &, const _dgbmatrix &)
 
_dgematrix operator- (const _dsymatrix &, const dgsmatrix &)
 
_dgematrix operator- (const _dsymatrix &, const _dgsmatrix &)
 
_dsymatrix operator- (const _dsymatrix &, const dssmatrix &)
 
_dsymatrix operator- (const _dsymatrix &, const _dssmatrix &)
 
_dcovector operator* (const _dsymatrix &, const dcovector &)
 
_dcovector operator* (const _dsymatrix &, const _dcovector &)
 
_dgematrix operator* (const _dsymatrix &, const dgematrix &)
 
_dgematrix operator* (const _dsymatrix &, const _dgematrix &)
 
_dgematrix operator* (const _dsymatrix &, const dsymatrix &)
 
_dgematrix operator* (const _dsymatrix &, const _dsymatrix &)
 
_dgematrix operator* (const _dsymatrix &, const dgbmatrix &)
 
_dgematrix operator* (const _dsymatrix &, const _dgbmatrix &)
 
_dgematrix operator* (const _dsymatrix &, const dgsmatrix &)
 
_dgematrix operator* (const _dsymatrix &, const _dgsmatrix &)
 
_dgematrix operator* (const _dsymatrix &, const dssmatrix &)
 
_dgematrix operator* (const _dsymatrix &, const _dssmatrix &)
 
_dsymatrix operator* (const _dsymatrix &, const double &)
 
_dsymatrix operator/ (const _dsymatrix &, const double &)
 
_dsymatrix operator* (const double &, const _dsymatrix &)
 

Detailed Description

(DO NOT USE) Smart-temporary Real Double-precision Symmetric Matrix Class

Definition at line 3 of file _dsymatrix.hpp.

Constructor & Destructor Documentation

_dsymatrix::_dsymatrix ( )
inline

_dsymatrix constructor without arguments

Definition at line 3 of file _dsymatrix-constructor.hpp.

References array, darray, and n.

4  :m(n)
5 {CPPL_VERBOSE_REPORT;
6  n =0;
7  array =NULL;
8  darray =NULL;
9 }
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
CPPL_INT const & m
matrix row size
Definition: _dsymatrix.hpp:10
_dsymatrix::_dsymatrix ( const _dsymatrix mat)
inline

_dsymatrix copy constructor

Definition at line 13 of file _dsymatrix-constructor.hpp.

References array, darray, n, and nullify().

14  :m(n)
15 {CPPL_VERBOSE_REPORT;
16  n =mat.n;
17  array =mat.array;
18  darray =mat.darray;
19 
20  mat.nullify();
21 }
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
void nullify() const
CPPL_INT const & m
matrix row size
Definition: _dsymatrix.hpp:10
_dsymatrix::~_dsymatrix ( )
inline

dsymatrix destructor

Definition at line 29 of file _dsymatrix-constructor.hpp.

References array, and darray.

30 {CPPL_VERBOSE_REPORT;
31  delete[] array;
32  delete[] darray;
33 }
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13

Member Function Documentation

_zhematrix _dsymatrix::to_zhematrix ( ) const
inline

cast to _zhematrix

Definition at line 3 of file _dsymatrix-cast.hpp.

References _(), destroy(), i, and n.

4 {CPPL_VERBOSE_REPORT;
5  zhematrix newmat(n);
6 
7  for(CPPL_INT j=0; j<n; j++){
8  for(CPPL_INT i=j; i<n; i++){
9  newmat(i,j) =comple((*this)(i,j),0.0);
10  }
11  }
12 
13  destroy();
14  return _(newmat);
15 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
Complex Double-precision Hermitian Matrix Class [l-type (UPLO=l) Strage].
Definition: zhematrix.hpp:4
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix _dsymatrix::to_dgematrix ( ) const
inline

convert to _dgematrix

Definition at line 23 of file _dsymatrix-cast.hpp.

References _(), destroy(), i, and n.

Referenced by operator+(), and operator-().

24 {CPPL_VERBOSE_REPORT;
25  dgematrix newmat(n,n);
26 
27  for(CPPL_INT i=0; i<n; i++){
28  for(CPPL_INT j=0; j<n; j++){
29  newmat(i,j) =(*this)(i,j);
30  }
31  }
32 
33  destroy();
34  return _(newmat);
35 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dssmatrix _dsymatrix::to_dssmatrix ( const double  = DBL_MIN) const
inline
double & _dsymatrix::operator() ( const CPPL_INT &  i,
const CPPL_INT &  j 
) const
inline

operator() for object

Definition at line 3 of file _dsymatrix-io.hpp.

References darray, i, and n.

Referenced by write().

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if( i<0 || j<0 || n<=i || n<=j ){
7  ERROR_REPORT;
8  std::cerr << "The required component is out of the matrix size." << std::endl
9  << "Your input is (" << i << "," << j << "), whereas the matrix size is " << n << "x" << n << "." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  if( i >= j ){
15  //return array[i+n*j];
16  return darray[j][i];
17  } else {
18  //return array[j+n*i];
19  return darray[i][j];
20  }
21 }
friend _dsymatrix i(const _dsymatrix &)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
void _dsymatrix::write ( const char *  filename) const
inline

Definition at line 50 of file _dsymatrix-io.hpp.

References destroy(), i, n, and operator()().

51 {CPPL_VERBOSE_REPORT;
52  std::ofstream ofs(filename, std::ios::trunc);
53  ofs.setf(std::cout.flags());
54  ofs.precision(std::cout.precision());
55  ofs.width(std::cout.width());
56  ofs.fill(std::cout.fill());
57 
58  ofs << "#dsymatrix " << n << std::endl;
59  for(CPPL_INT i=0; i<n; i++){
60  for(CPPL_INT j=0; j<=i; j++ ){
61  ofs << operator()(i,j) << " ";
62  }
63  ofs << std::endl;
64  }
65 
66  ofs.close();
67  destroy();
68 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
double & operator()(const CPPL_INT &, const CPPL_INT &) const
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
void _dsymatrix::nullify ( ) const
inline

nullify all the matrix data

Definition at line 3 of file _dsymatrix-misc.hpp.

References array, darray, and n.

Referenced by _dsymatrix(), dsymatrix::dsymatrix(), and dsymatrix::shallow_copy().

4 {CPPL_VERBOSE_REPORT;
5  n=0;
6  array=NULL;
7  darray=NULL;
8 }
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
void _dsymatrix::destroy ( ) const
inline

destroy all the matrix data

Definition at line 12 of file _dsymatrix-misc.hpp.

References array, and darray.

Referenced by operator*(), dgematrix::operator*=(), operator+(), dsymatrix::operator+=(), dgematrix::operator+=(), operator-(), dsymatrix::operator-=(), dgematrix::operator-=(), operator<<(), to_dgematrix(), to_zhematrix(), and write().

13 {CPPL_VERBOSE_REPORT;
14  delete [] array;
15  delete [] darray;
16  array=NULL;
17  darray=NULL;
18 }
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
void _dsymatrix::complete ( ) const
inline

complete the upper-right components

Definition at line 22 of file _dsymatrix-misc.hpp.

References darray, i, and n.

Referenced by operator*().

23 {CPPL_VERBOSE_REPORT;
24  for(CPPL_INT i=0; i<n; i++){
25  for(CPPL_INT j=0; j<i; j++){
26  darray[i][j] =darray[j][i];
27  }
28  }
29 }
friend _dsymatrix i(const _dsymatrix &)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const dsymatrix mat 
)
friend

Definition at line 77 of file dsymatrix-io.hpp.

78 {CPPL_VERBOSE_REPORT;
79  for(CPPL_INT i=0; i<mat.n; i++){
80  for(CPPL_INT j=0; j<=i; j++){
81  s << " " << mat(i,j) << " ";
82  }
83  for(CPPL_INT j=i+1; j<mat.n; j++){
84  s << "{" << mat(i,j) << "}";
85  }
86  s << std::endl;
87  }
88  return s;
89 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
_dsymatrix t ( const _dsymatrix mat)
friend

return transposed _dsymatrix

Definition at line 3 of file _dsymatrix-calc.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  WARNING_REPORT;
7  std::cerr << "This function call has no effect since the matrix is symmetric." << std::endl;
8 #endif//CPPL_DEBUG
9 
10  return mat;
11 }
_dsymatrix i ( const _dsymatrix mat)
friend

return its inverse matrix

Definition at line 15 of file _dsymatrix-calc.hpp.

Referenced by complete(), operator()(), to_dgematrix(), to_zhematrix(), and write().

16 {CPPL_VERBOSE_REPORT;
17  dsymatrix mat_cp(mat);
18  dsymatrix mat_inv(mat_cp.n);
19  mat_inv.identity();
20 
21  char UPLO('l');
22  CPPL_INT NRHS(mat.n), LDA(mat.n), *IPIV(new CPPL_INT[mat.n]), LDB(mat.n), LWORK(-1), INFO(1);
23  double *WORK( new double[1] );
24  dsysv_(&UPLO, &mat_cp.n, &NRHS, mat_cp.array, &LDA, IPIV, mat_inv.array, &LDB, WORK, &LWORK, &INFO);
25 
26  LWORK = CPPL_INT(WORK[0]);
27  delete [] WORK;
28  WORK = new double[LWORK];
29  dsysv_(&UPLO, &mat_cp.n, &NRHS, mat_cp.array, &LDA, IPIV, mat_inv.array, &LDB, WORK, &LWORK, &INFO);
30  delete [] WORK;
31  delete [] IPIV;
32 
33  if(INFO!=0){
34  WARNING_REPORT;
35  std::cerr << "Serious trouble happend. INFO = " << INFO << "." << std::endl;
36  }
37 
38  return _(mat_inv);
39 }
Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].
Definition: dsymatrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
void idamax ( CPPL_INT &  i,
CPPL_INT &  j,
const _dsymatrix mat 
)
friend

search the index of element having the largest absolute value in 0-based numbering system

Definition at line 48 of file _dsymatrix-calc.hpp.

49 {CPPL_VERBOSE_REPORT;
50  dsymatrix newmat =mat;
51  idamax(i, j, newmat);
52 }
friend _dsymatrix i(const _dsymatrix &)
Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].
Definition: dsymatrix.hpp:3
friend void idamax(CPPL_INT &, CPPL_INT &, const _dsymatrix &)
double damax ( const _dsymatrix mat)
friend

return its largest absolute value

Definition at line 56 of file _dsymatrix-calc.hpp.

57 {CPPL_VERBOSE_REPORT;
58  dsymatrix newmat =mat;
59  return damax(newmat);
60 }
Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].
Definition: dsymatrix.hpp:3
friend double damax(const _dsymatrix &)
const _dsymatrix& operator+ ( const _dsymatrix mat)
friend

+_dsymatrix operator

Definition at line 3 of file _dsymatrix-unary.hpp.

4 {CPPL_VERBOSE_REPORT;
5  return mat;
6 }
_dsymatrix operator- ( const _dsymatrix mat)
friend

-_dsymatrix operator

Definition at line 10 of file _dsymatrix-unary.hpp.

11 {CPPL_VERBOSE_REPORT;
12  const CPPL_INT size =mat.n*mat.n;
13  for(CPPL_INT i=0; i<size; i++){
14  mat.array[i] =-mat.array[i];
15  }
16 
17  return mat;
18 }
friend _dsymatrix i(const _dsymatrix &)
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dgematrix operator+ ( const _dsymatrix matA,
const dgematrix matB 
)
friend

_dsymatrix+dgematrix operator

Definition at line 3 of file _dsymatrix-dgematrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.n!=matB.m){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  dgematrix newmat =matB;
15 
16  for(CPPL_INT i=0; i<matA.n; i++){
17  for(CPPL_INT j=0; j<matA.n; j++ ){
18  newmat(i,j)+=matA(i,j);
19  }
20  }
21 
22  matA.destroy();
23  return _(newmat);
24 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
void destroy() const
CPPL_INT n
matrix column size
Definition: dgematrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator+ ( const _dsymatrix matA,
const _dgematrix matB 
)
friend

_dgematrix+dsymatrix operator

Definition at line 3 of file _dsymatrix-_dgematrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.n!=matB.m){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  for(CPPL_INT i=0; i<matA.n; i++) {
15  for(CPPL_INT j=0; j<matA.n; j++) {
16  matB(i,j) += matA(i,j);
17  }
18  }
19 
20  matA.destroy();
21  return matB;
22 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
CPPL_INT m
matrix row size
Definition: _dgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _dgematrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dsymatrix operator+ ( const _dsymatrix matA,
const dsymatrix matB 
)
friend

_dsymatrix+dsymatrix operator

Definition at line 3 of file _dsymatrix-dsymatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  for(CPPL_INT j=0; j<matA.n; j++){
15  for(CPPL_INT i=j; i<matA.n; i++){
16  matA.darray[j][i] += matB.darray[j][i];
17  }
18  }
19 
20  return matA;
21 }
friend _dsymatrix i(const _dsymatrix &)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
double ** darray
array of pointers of column head addresses
Definition: dsymatrix.hpp:12
_dsymatrix operator+ ( const _dsymatrix matA,
const _dsymatrix matB 
)
friend

_dsymatrix+_dsymatrix operator

Definition at line 3 of file _dsymatrix-_dsymatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.n << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  for(CPPL_INT j=0; j<matA.n; j++){
15  for(CPPL_INT i=j; i<matA.n; i++){
16  matA.darray[j][i] +=matB.darray[j][i];
17  }
18  }
19 
20  matB.destroy();
21  return matA;
22 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dgematrix operator+ ( const _dsymatrix matA,
const dgbmatrix matB 
)
friend

_dsymatrix+dgbmatrix operator

Definition at line 3 of file _dsymatrix-dgbmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.n!=matB.m){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  dgematrix newmat(matA.n, matA.n);
15 
16  for(CPPL_INT i=0; i<matB.m; i++){
17  for(CPPL_INT j=i; j<matA.n; j++){
18  newmat(i,j) = newmat(j,i) = matA(i,j);
19  }
20  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
21  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
22  newmat(i,j)+=matB(i,j);
23  }
24  }
25 
26  matA.destroy();
27  return _(newmat);
28 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT m
matrix row size
Definition: dgbmatrix.hpp:9
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT kl
lower band width
Definition: dgbmatrix.hpp:11
CPPL_INT ku
upper band width
Definition: dgbmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: dgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator+ ( const _dsymatrix matA,
const _dgbmatrix matB 
)
friend

_dsymatrix+_dgbmatrix operator

Definition at line 3 of file _dsymatrix-_dgbmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.n || matA.n!=matB.m){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  dgematrix newmat(matA.n, matA.n);
15 
16  for(CPPL_INT i=0; i<matB.m; i++){
17  for(CPPL_INT j=i; j<matA.n; j++){
18  newmat(i,j) = newmat(j,i) = matA(i,j);
19  }
20  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
21  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
22  newmat(i,j) += matB(i,j);
23  }
24  }
25 
26  matA.destroy();
27  matB.destroy();
28  return _(newmat);
29 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT ku
upper band width
Definition: _dgbmatrix.hpp:12
void destroy() const
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT kl
lower band width
Definition: _dgbmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
Definition: _dgbmatrix.hpp:9
_dgematrix operator+ ( const _dsymatrix matA,
const dgsmatrix matB 
)
friend

_dsymatrix+dgsmatrix operator

Definition at line 3 of file _dsymatrix-dgsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.m || matA.n!=matB.n){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  dgematrix newmat =matA.to_dgematrix();
15 
16  const std::vector<dcomponent>::const_iterator matB_data_end =matB.data.end();
17  for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
18  newmat(it->i,it->j) += it->v;
19  }
20 
21  matA.destroy();
22  return _(newmat);
23 }
std::vector< dcomponent > data
matrix data
Definition: dgsmatrix.hpp:11
void destroy() const
CPPL_INT n
matrix column size
Definition: dgsmatrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
_dgematrix to_dgematrix() const
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
Definition: dgsmatrix.hpp:9
_dgematrix operator+ ( const _dsymatrix matA,
const _dgsmatrix matB 
)
friend

_dsymatrix+_dgsmatrix operator

Definition at line 3 of file _dsymatrix-_dgsmatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(matA.n!=matB.m || matA.n!=matB.n){
7  ERROR_REPORT;
8  std::cerr << "These two matrises can not make a summation." << std::endl
9  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  dgematrix newmat =matA.to_dgematrix();
15 
16  const std::vector<dcomponent>::const_iterator matB_data_end =matB.data.end();
17  for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
18  newmat(it->i,it->j) += it->v;
19  }
20 
21  matA.destroy();
22  matB.destroy();
23  return _(newmat);
24 }
void destroy() const
CPPL_INT n
matrix column size
Definition: _dgsmatrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgsmatrix.hpp:9
void destroy() const
_dgematrix to_dgematrix() const
std::vector< dcomponent > data
matrix data
Definition: _dgsmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dsymatrix operator+ ( const _dsymatrix ,
const dssmatrix  
)
friend
_dsymatrix operator+ ( const _dsymatrix ,
const _dssmatrix  
)
friend
_dgematrix operator- ( const _dsymatrix matA,
const dgematrix matB 
)
friend

_dsymatrix-dgematrix operator

Definition at line 28 of file _dsymatrix-dgematrix.hpp.

29 {CPPL_VERBOSE_REPORT;
30 #ifdef CPPL_DEBUG
31  if(matA.n!=matB.n || matA.n!=matB.m){
32  ERROR_REPORT;
33  std::cerr << "These two matrises can not make a subtraction." << std::endl
34  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl;
35  exit(1);
36  }
37 #endif//CPPL_DEBUG
38 
39  dgematrix newmat =-matB;
40 
41  for(CPPL_INT i=0; i<matA.n; i++){
42  for(CPPL_INT j=0; j<matA.n; j++ ){
43  newmat(i,j)+=matA(i,j);
44  }
45  }
46 
47  matA.destroy();
48  return _(newmat);
49 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
void destroy() const
CPPL_INT n
matrix column size
Definition: dgematrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator- ( const _dsymatrix matA,
const _dgematrix matB 
)
friend

_dsymatrix-dgematrix operator

Definition at line 26 of file _dsymatrix-_dgematrix.hpp.

27 {CPPL_VERBOSE_REPORT;
28 #ifdef CPPL_DEBUG
29  if(matA.n!=matB.n || matA.n!=matB.m){
30  ERROR_REPORT;
31  std::cerr << "These two matrises can not make a subtraction." << std::endl
32  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl;
33  exit(1);
34  }
35 #endif//CPPL_DEBUG
36 
37  for(CPPL_INT i=0; i<matA.n; i++) {
38  for(CPPL_INT j=0; j<matA.n; j++) {
39  matB(i,j) =matA(i,j)-matB(i,j);
40  }
41  }
42 
43  matA.destroy();
44  return matB;
45 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
CPPL_INT m
matrix row size
Definition: _dgematrix.hpp:9
CPPL_INT n
matrix column size
Definition: _dgematrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dsymatrix operator- ( const _dsymatrix matA,
const dsymatrix matB 
)
friend

_dsymatrix-dsymatrix operator

Definition at line 25 of file _dsymatrix-dsymatrix.hpp.

26 {CPPL_VERBOSE_REPORT;
27 #ifdef CPPL_DEBUG
28  if(matA.n!=matB.n){
29  ERROR_REPORT;
30  std::cerr << "These two matrises can not make a subtraction." << std::endl
31  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
32  exit(1);
33  }
34 #endif//CPPL_DEBUG
35 
36  for(CPPL_INT j=0; j<matA.n; j++){
37  for(CPPL_INT i=j; i<matA.n; i++){
38  matA.darray[j][i] -= matB.darray[j][i];
39  }
40  }
41 
42  return matA;
43 }
friend _dsymatrix i(const _dsymatrix &)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
double ** darray
array of pointers of column head addresses
Definition: dsymatrix.hpp:12
_dsymatrix operator- ( const _dsymatrix matA,
const _dsymatrix matB 
)
friend

_dsymatrix-_dsymatrix operator

Definition at line 26 of file _dsymatrix-_dsymatrix.hpp.

27 {CPPL_VERBOSE_REPORT;
28 #ifdef CPPL_DEBUG
29  if(matA.n!=matB.n){
30  ERROR_REPORT;
31  std::cerr << "These two matrises can not make a subtraction." << std::endl
32  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.n << "x" << matB.n << ")." << std::endl;
33  exit(1);
34  }
35 #endif//CPPL_DEBUG
36 
37  for(CPPL_INT j=0; j<matA.n; j++){
38  for(CPPL_INT i=j; i<matA.n; i++){
39  matA.darray[j][i] -=matB.darray[j][i];
40  }
41  }
42 
43  matB.destroy();
44  return matA;
45 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dgematrix operator- ( const _dsymatrix matA,
const dgbmatrix matB 
)
friend

_dsymatrix-dgbmatrix operator

Definition at line 32 of file _dsymatrix-dgbmatrix.hpp.

33 {CPPL_VERBOSE_REPORT;
34 #ifdef CPPL_DEBUG
35  if(matA.n!=matB.n || matA.n!=matB.m){
36  ERROR_REPORT;
37  std::cerr << "These two matrises can not make a summation." << std::endl
38  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
39  exit(1);
40  }
41 #endif//CPPL_DEBUG
42 
43  dgematrix newmat(matA.n, matA.n);
44 
45  for(CPPL_INT i=0; i<matB.m; i++){
46  for(CPPL_INT j=i; j<matA.n; j++){
47  newmat(i,j) = newmat(j,i) = matA(i,j);
48  }
49  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
50  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
51  newmat(i,j)-=matB(i,j);
52  }
53  }
54 
55  matA.destroy();
56  return _(newmat);
57 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT m
matrix row size
Definition: dgbmatrix.hpp:9
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT kl
lower band width
Definition: dgbmatrix.hpp:11
CPPL_INT ku
upper band width
Definition: dgbmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: dgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator- ( const _dsymatrix matA,
const _dgbmatrix matB 
)
friend

_dsymatrix-_dgbmatrix operator

Definition at line 33 of file _dsymatrix-_dgbmatrix.hpp.

34 {CPPL_VERBOSE_REPORT;
35 #ifdef CPPL_DEBUG
36  if(matA.n!=matB.n || matA.n!=matB.m){
37  ERROR_REPORT;
38  std::cerr << "These two matrises can not make a summation." << std::endl
39  << "Your input was (" << matA.n << "x" << matA.n << ") + (" << matB.m << "x" << matB.n << ")." << std::endl;
40  exit(1);
41  }
42 #endif//CPPL_DEBUG
43 
44  dgematrix newmat(matA.n, matA.n);
45 
46  for(CPPL_INT i=0; i<matB.m; i++){
47  for(CPPL_INT j=i; j<matA.n; j++){
48  newmat(i,j) = newmat(j,i) = matA(i,j);
49  }
50  const CPPL_INT jmax =std::min(matB.n,i+matB.ku+1);
51  for(CPPL_INT j=std::max(CPPL_INT(0),i-matB.kl); j<jmax; j++){
52  newmat(i,j) -= matB(i,j);
53  }
54  }
55 
56  matA.destroy();
57  matB.destroy();
58  return _(newmat);
59 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT ku
upper band width
Definition: _dgbmatrix.hpp:12
void destroy() const
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT kl
lower band width
Definition: _dgbmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
Definition: _dgbmatrix.hpp:9
_dgematrix operator- ( const _dsymatrix matA,
const dgsmatrix matB 
)
friend

_dsymatrix-dgsmatrix operator

Definition at line 27 of file _dsymatrix-dgsmatrix.hpp.

28 {CPPL_VERBOSE_REPORT;
29 #ifdef CPPL_DEBUG
30  if(matA.n!=matB.m || matA.n!=matB.n){
31  ERROR_REPORT;
32  std::cerr << "These two matrises can not make a subtraction." << std::endl
33  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl;
34  exit(1);
35  }
36 #endif//CPPL_DEBUG
37 
38  dgematrix newmat =matA.to_dgematrix();
39 
40  const std::vector<dcomponent>::const_iterator matB_data_end =matB.data.end();
41  for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
42  newmat(it->i,it->j) -= it->v;
43  }
44 
45  matA.destroy();
46  return _(newmat);
47 }
std::vector< dcomponent > data
matrix data
Definition: dgsmatrix.hpp:11
void destroy() const
CPPL_INT n
matrix column size
Definition: dgsmatrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
_dgematrix to_dgematrix() const
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
Definition: dgsmatrix.hpp:9
_dgematrix operator- ( const _dsymatrix matA,
const _dgsmatrix matB 
)
friend

_dsymatrix-_dgsmatrix operator

Definition at line 28 of file _dsymatrix-_dgsmatrix.hpp.

29 {CPPL_VERBOSE_REPORT;
30 #ifdef CPPL_DEBUG
31  if(matA.n!=matB.m || matA.n!=matB.n){
32  ERROR_REPORT;
33  std::cerr << "These two matrises can not make a subtraction." << std::endl
34  << "Your input was (" << matA.n << "x" << matA.n << ") - (" << matB.m << "x" << matB.n << ")." << std::endl;
35  exit(1);
36  }
37 #endif//CPPL_DEBUG
38 
39  dgematrix newmat =matA.to_dgematrix();
40 
41  const std::vector<dcomponent>::const_iterator matB_data_end =matB.data.end();
42  for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
43  newmat(it->i,it->j) -= it->v;
44  }
45 
46  matA.destroy();
47  matB.destroy();
48  return _(newmat);
49 }
void destroy() const
CPPL_INT n
matrix column size
Definition: _dgsmatrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgsmatrix.hpp:9
void destroy() const
_dgematrix to_dgematrix() const
std::vector< dcomponent > data
matrix data
Definition: _dgsmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dsymatrix operator- ( const _dsymatrix ,
const dssmatrix  
)
friend
_dsymatrix operator- ( const _dsymatrix ,
const _dssmatrix  
)
friend
_dcovector operator* ( const _dsymatrix mat,
const dcovector vec 
)
friend

_dsymatrix*dcovector operator

Definition at line 3 of file _dsymatrix-dcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(mat.n!=vec.l){
7  ERROR_REPORT;
8  std::cerr << "These matrix and vector can not make a product." << std::endl
9  << "Your input was (" << mat.n << "x" << mat.n << ") * (" << vec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  dcovector newvec(mat.n);
15  char uplo ='l';
16  double alpha =1.;
17  CPPL_INT inc =1;
18  double beta =0.;
19 
20  dsymv_( &uplo, &mat.n, &alpha, mat.array, &mat.n, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  mat.destroy();
23  return _(newvec);
24 }
void destroy() const
CPPL_INT l
vector size
Definition: dcovector.hpp:9
double * array
1D array to store vector data
Definition: dcovector.hpp:11
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
Real Double-precision Column Vector Class.
Definition: dcovector.hpp:3
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dcovector operator* ( const _dsymatrix mat,
const _dcovector vec 
)
friend

_dsymatrix*_dcovector operator

Definition at line 3 of file _dsymatrix-_dcovector.hpp.

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  if(mat.n!=vec.l){
7  ERROR_REPORT;
8  std::cerr << "These matrix and vector can not make a product." << std::endl
9  << "Your input was (" << mat.n << "x" << mat.n << ") * (" << vec.l << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  dcovector newvec(mat.n);
15  char uplo ='l';
16  double alpha =1.;
17  CPPL_INT inc =1;
18  double beta =0.;
19 
20  dsymv_( &uplo, &mat.n, &alpha, mat.array, &mat.n, vec.array, &inc, &beta, newvec.array, &inc );
21 
22  mat.destroy();
23  vec.destroy();
24  return _(newvec);
25 }
CPPL_INT l
vector size
Definition: _dcovector.hpp:9
void destroy() const
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
void destroy() const
Real Double-precision Column Vector Class.
Definition: dcovector.hpp:3
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
double * array
1D array to store vector data
Definition: _dcovector.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator* ( const _dsymatrix matA,
const dgematrix matB 
)
friend

_dsymatrix*dgematrix operator

Definition at line 53 of file _dsymatrix-dgematrix.hpp.

54 {CPPL_VERBOSE_REPORT;
55 #ifdef CPPL_DEBUG
56  if(matA.n!=matB.m){
57  ERROR_REPORT;
58  std::cerr << "These two matrises can not make a product." << std::endl
59  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
60  exit(1);
61  }
62 #endif//CPPL_DEBUG
63 
64  dgematrix newmat( matA.n, matB.n );
65  char side ='l';
66  char uplo ='l';
67  double alpha =1.;
68  double beta =0.;
69 
70  dsymm_( &side, &uplo, &matA.n, &matB.n, &alpha, matA.array, &matA.n, matB.array, &matB.m, &beta, newmat.array, &newmat.m );
71 
72  matA.destroy();
73  return _(newmat);
74 }
CPPL_INT m
matrix row size
Definition: dgematrix.hpp:9
void destroy() const
double * array
1D array to store matrix data
Definition: dgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: dgematrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator* ( const _dsymatrix matA,
const _dgematrix matB 
)
friend

_dgematrix*dgematrix operator

Definition at line 49 of file _dsymatrix-_dgematrix.hpp.

50 {CPPL_VERBOSE_REPORT;
51 #ifdef CPPL_DEBUG
52  if(matA.n!=matB.m){
53  ERROR_REPORT;
54  std::cerr << "These two matrises can not make a product." << std::endl
55  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
56  exit(1);
57  }
58 #endif//CPPL_DEBUG
59 
60  dgematrix newmat( matA.n, matB.n );
61  char side ='l';
62  char uplo ='l';
63  double alpha =1.;
64  double beta =0.;
65 
66  dsymm_( &side, &uplo, &matA.n, &matB.n, &alpha, matA.array, &matA.n, matB.array, &matB.m, &beta, newmat.array, &newmat.m );
67 
68  matA.destroy();
69  matB.destroy();
70  return _(newmat);
71 }
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
CPPL_INT m
matrix row size
Definition: _dgematrix.hpp:9
double * array
1D array to store matrix data
Definition: _dgematrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dgematrix.hpp:10
void destroy() const
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator* ( const _dsymatrix matA,
const dsymatrix matB 
)
friend

_dsymatrix*dsymatrix operator

Definition at line 47 of file _dsymatrix-dsymatrix.hpp.

48 {CPPL_VERBOSE_REPORT;
49 #ifdef CPPL_DEBUG
50  if(matA.n!=matB.n){
51  ERROR_REPORT;
52  std::cerr << "These two matrises can not make a product." << std::endl
53  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
54  exit(1);
55  }
56 #endif//CPPL_DEBUG
57 
58  matB.complete();
59 
60  dgematrix newmat(matA.n, matA.n);
61  char side ='l';
62  char uplo ='l';
63  double alpha =1.;
64  double beta =0.;
65 
66  dsymm_( &side, &uplo, &matA.n, &matB.n, &alpha, matA.array, &matA.n, matB.array, &matB.m, &beta, newmat.array, &newmat.m );
67 
68  matA.destroy();
69  return _(newmat);
70 }
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
CPPL_INT const & m
matrix row size
Definition: dsymatrix.hpp:9
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
void complete() const
double * array
1D array to store matrix data
Definition: dsymatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator* ( const _dsymatrix matA,
const _dsymatrix matB 
)
friend

_dsymatrix*_dsymatrix operator

Definition at line 49 of file _dsymatrix-_dsymatrix.hpp.

50 {CPPL_VERBOSE_REPORT;
51 #ifdef CPPL_DEBUG
52  if(matA.n!=matB.n){
53  ERROR_REPORT;
54  std::cerr << "These two matrises can not make a product." << std::endl
55  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.n << "x" << matB.n << ")." << std::endl;
56  exit(1);
57  }
58 #endif//CPPL_DEBUG
59 
60  matB.complete();
61 
62  dgematrix newmat(matA.n, matA.n);
63  char side ='l';
64  char uplo ='l';
65  double alpha =1.;
66  double beta =0.;
67 
68  dsymm_( &side, &uplo, &matA.n, &matB.n, &alpha, matA.array, &matA.n, matB.array, &matB.m, &beta, newmat.array, &newmat.m );
69 
70  matA.destroy();
71  matB.destroy();
72  return _(newmat);
73 }
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
void complete() const
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT const & m
matrix row size
Definition: _dsymatrix.hpp:10
_dgematrix operator* ( const _dsymatrix matA,
const dgbmatrix matB 
)
friend

_dgematrix*dgbmatrix operator

Definition at line 61 of file _dsymatrix-dgbmatrix.hpp.

62 {CPPL_VERBOSE_REPORT;
63 #ifdef CPPL_DEBUG
64  if(matA.n!=matB.m){
65  ERROR_REPORT;
66  std::cerr << "These two matrises can not make a product." << std::endl
67  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
68  exit(1);
69  }
70 #endif//CPPL_DEBUG
71 
72  dgematrix newmat( matA.n, matB.n );
73  newmat.zero();
74 
75  for(CPPL_INT i=0; i<newmat.m; i++){
76  for(CPPL_INT j=0; j<newmat.n; j++){
77  const CPPL_INT kmax =std::min(matB.m,j+matB.kl+1);
78  for(CPPL_INT k=std::max(CPPL_INT(0),j-matB.ku); k<kmax; k++){
79  newmat(i,j) +=matA(i,k)*matB(k,j);
80  }
81  }
82  }
83 
84  matA.destroy();
85  return _(newmat);
86 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT m
matrix row size
Definition: dgbmatrix.hpp:9
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT kl
lower band width
Definition: dgbmatrix.hpp:11
CPPL_INT ku
upper band width
Definition: dgbmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: dgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT const & m
matrix row size
Definition: _dsymatrix.hpp:10
_dgematrix operator* ( const _dsymatrix matA,
const _dgbmatrix matB 
)
friend

_dsymatrix*_dgbmatrix operator

Definition at line 63 of file _dsymatrix-_dgbmatrix.hpp.

64 {CPPL_VERBOSE_REPORT;
65 #ifdef CPPL_DEBUG
66  if(matA.n!=matB.m){
67  ERROR_REPORT;
68  std::cerr << "These two matrises can not make a product." << std::endl
69  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
70  exit(1);
71  }
72 #endif//CPPL_DEBUG
73 
74  dgematrix newmat( matA.n, matB.n );
75  newmat.zero();
76 
77  for(CPPL_INT i=0; i<newmat.m; i++){
78  for(CPPL_INT j=0; j<newmat.n; j++){
79  const CPPL_INT kmax =std::min(matB.m,j+matB.kl+1);
80  for(CPPL_INT k=std::max(CPPL_INT(0),j-matB.ku); k<kmax; k++){
81  newmat(i,j) += matA(i,k)*matB(k,j);
82  }
83  }
84  }
85 
86  matA.destroy();
87  matB.destroy();
88  return _(newmat);
89 }
friend _dsymatrix i(const _dsymatrix &)
CPPL_INT ku
upper band width
Definition: _dgbmatrix.hpp:12
void destroy() const
void destroy() const
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT kl
lower band width
Definition: _dgbmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dgbmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT const & m
matrix row size
Definition: _dsymatrix.hpp:10
CPPL_INT m
matrix row size
Definition: _dgbmatrix.hpp:9
_dgematrix operator* ( const _dsymatrix matA,
const dgsmatrix matB 
)
friend

_dsymatrix*dgsmatrix operator

Definition at line 51 of file _dsymatrix-dgsmatrix.hpp.

52 {CPPL_VERBOSE_REPORT;
53 #ifdef CPPL_DEBUG
54  if(matA.n!=matB.m){
55  ERROR_REPORT;
56  std::cerr << "These two matrises can not make a product." << std::endl
57  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
58  exit(1);
59  }
60 #endif//CPPL_DEBUG
61 
62  dgematrix newmat(matA.n, matB.n);
63  newmat.zero();
64 
65  const std::vector<dcomponent>::const_iterator matB_data_end =matB.data.end();
66  for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
67  for(CPPL_INT i=0; i<matA.n; i++){
68  newmat(i,it->j) += matB(i,it->i)*it->v;
69  }
70  }
71 
72  matA.destroy();
73  return _(newmat);
74 }
friend _dsymatrix i(const _dsymatrix &)
std::vector< dcomponent > data
matrix data
Definition: dgsmatrix.hpp:11
void destroy() const
CPPL_INT n
matrix column size
Definition: dgsmatrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
CPPL_INT m
matrix row size
Definition: dgsmatrix.hpp:9
_dgematrix operator* ( const _dsymatrix matA,
const _dgsmatrix matB 
)
friend

_dsymatrix*_dgsmatrix operator

Definition at line 53 of file _dsymatrix-_dgsmatrix.hpp.

54 {CPPL_VERBOSE_REPORT;
55 #ifdef CPPL_DEBUG
56  if(matA.n!=matB.m){
57  ERROR_REPORT;
58  std::cerr << "These two matrises can not make a product." << std::endl
59  << "Your input was (" << matA.n << "x" << matA.n << ") * (" << matB.m << "x" << matB.n << ")." << std::endl;
60  exit(1);
61  }
62 #endif//CPPL_DEBUG
63 
64  dgematrix newmat(matA.n, matB.n);
65  newmat.zero();
66 
67  const std::vector<dcomponent>::const_iterator matB_data_end =matB.data.end();
68  for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
69  for(CPPL_INT i=0; i<matA.n; i++){
70  newmat(i,it->j) += matB(i,it->i)*it->v;
71  }
72  }
73 
74  matA.destroy();
75  matB.destroy();
76  return _(newmat);
77 }
friend _dsymatrix i(const _dsymatrix &)
void destroy() const
CPPL_INT n
matrix column size
Definition: _dgsmatrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgsmatrix.hpp:9
void destroy() const
std::vector< dcomponent > data
matrix data
Definition: _dgsmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dcovector _(dcovector &vec)
_dgematrix operator* ( const _dsymatrix ,
const dssmatrix  
)
friend
_dgematrix operator* ( const _dsymatrix ,
const _dssmatrix  
)
friend
_dsymatrix operator* ( const _dsymatrix mat,
const double &  d 
)
friend

_dsymatrix*double operator

Definition at line 3 of file _dsymatrix-double.hpp.

4 {CPPL_VERBOSE_REPORT;
5  for(CPPL_INT j=0; j<mat.n; j++){
6  for(CPPL_INT i=j; i<mat.n; i++){
7  mat.darray[j][i] *=d;
8  }
9  }
10 
11  return mat;
12 }
friend _dsymatrix i(const _dsymatrix &)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dsymatrix operator/ ( const _dsymatrix mat,
const double &  d 
)
friend

dsymatrix/double operator

Definition at line 16 of file _dsymatrix-double.hpp.

17 {CPPL_VERBOSE_REPORT;
18  for(CPPL_INT j=0; j<mat.n; j++){
19  for(CPPL_INT i=j; i<mat.n; i++){
20  mat.darray[j][i] /=d;
21  }
22  }
23 
24  return mat;
25 }
friend _dsymatrix i(const _dsymatrix &)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
_dsymatrix operator* ( const double &  d,
const _dsymatrix mat 
)
friend

double*_dsymatrix operator

Definition at line 3 of file double-_dsymatrix.hpp.

4 {CPPL_VERBOSE_REPORT;
5  for(CPPL_INT j=0; j<mat.n; j++){
6  for(CPPL_INT i=j; i<mat.n; i++){
7  mat.darray[j][i] *=d;
8  }
9  }
10 
11  return mat;
12 }
friend _dsymatrix i(const _dsymatrix &)
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11

Member Data Documentation

CPPL_INT const& _dsymatrix::m

matrix row size

Definition at line 10 of file _dsymatrix.hpp.

Referenced by operator*(), operator+(), and operator-().

CPPL_INT _dsymatrix::n
mutable
double* _dsymatrix::array
mutable
double** _dsymatrix::darray
mutable

The documentation for this class was generated from the following files: