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

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

#include <_dssmatrix.hpp>

Public Member Functions

 _dssmatrix ()
 
 _dssmatrix (const _dssmatrix &)
 
 ~_dssmatrix ()
 
_zhsmatrix to_zhsmatrix () const
 
_dgematrix to_dgematrix () const
 
_dsymatrix to_dsymatrix () const
 
_dgsmatrix to_dgsmatrix () const
 
double operator() (const CPPL_INT &, const CPPL_INT &) const
 
void write (const char *) const
 
void nullify () const
 
void destroy () const
 

Public Attributes

CPPL_INT const & m
 matrix row size More...
 
CPPL_INT n
 matrix column size More...
 
std::vector< dcomponentdata
 matrix data More...
 
std::vector< std::vector
< CPPL_INT > > 
line
 vector of vector to store the entry information of component for each row and column More...
 

Friends

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

Detailed Description

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

Definition at line 3 of file _dssmatrix.hpp.

Constructor & Destructor Documentation

_dssmatrix::_dssmatrix ( )
inline

_dssmatrix constructor without arguments

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

References data, line, and n.

4  :m(n)
5 {CPPL_VERBOSE_REPORT;
6  n =0;
7  data.clear();
8  line.clear();
9 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT const & m
matrix row size
Definition: _dssmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13
_dssmatrix::_dssmatrix ( const _dssmatrix mat)
inline

_dssmatrix copy constructor

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

References data, line, n, and nullify().

14  :m(n)
15 {CPPL_VERBOSE_REPORT;
16  n =mat.n;
17  data.swap(mat.data);
18  line.swap(mat.line);
19 
20  mat.nullify();
21 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT const & m
matrix row size
Definition: _dssmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13
void nullify() const
_dssmatrix::~_dssmatrix ( )
inline

_dssmatrix destructor

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

References data, and line.

30 {CPPL_VERBOSE_REPORT;
31  data.clear();
32  line.clear();
33 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13

Member Function Documentation

_zhsmatrix _dssmatrix::to_zhsmatrix ( ) const
inline

cast to _zhsmatrix

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

References _(), data, destroy(), n, and zhsmatrix::put().

4 {CPPL_VERBOSE_REPORT;
5  zhsmatrix newmat(n,CPPL_INT(data.size()));
6 
7  const std::vector<dcomponent>::const_iterator data_end =data.end();
8  for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
9  newmat.put(it->i, it->j, comple(it->v,0.0));
10  }
11 
12  destroy();
13  return _(newmat);
14 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
Complex Double-precision Hermitian Sparse Matrix Class.
Definition: zhsmatrix.hpp:3
void destroy() const
_dcovector _(dcovector &vec)
_dgematrix _dssmatrix::to_dgematrix ( ) const
inline

convert to _dgematrix

Definition at line 22 of file _dssmatrix-cast.hpp.

References _(), data, destroy(), m, n, and dgematrix::zero().

23 {CPPL_VERBOSE_REPORT;
24  dgematrix newmat(m,n);
25  newmat.zero();
26 
27  const std::vector<dcomponent>::const_iterator data_end =data.end();
28  for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
29  newmat(it->i, it->j) =it->v;
30  newmat(it->j, it->i) =it->v;
31  }
32 
33  destroy();
34  return _(newmat);
35 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT const & m
matrix row size
Definition: _dssmatrix.hpp:10
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
void destroy() const
_dcovector _(dcovector &vec)
_dsymatrix _dssmatrix::to_dsymatrix ( ) const
inline

convert to _dsymatrix

Definition at line 39 of file _dssmatrix-cast.hpp.

References _(), data, destroy(), n, and dsymatrix::zero().

40 {CPPL_VERBOSE_REPORT;
41  dsymatrix newmat(n);
42  newmat.zero();
43 
44  const std::vector<dcomponent>::const_iterator data_end =data.end();
45  for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
46  newmat(it->i, it->j) =it->v;
47  }
48 
49  destroy();
50  return _(newmat);
51 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].
Definition: dsymatrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
void destroy() const
_dcovector _(dcovector &vec)
_dgsmatrix _dssmatrix::to_dgsmatrix ( ) const
inline

convert to _dgsmatrix

Definition at line 55 of file _dssmatrix-cast.hpp.

References _(), data, destroy(), m, n, dgsmatrix::put(), and dgsmatrix::zero().

56 {CPPL_VERBOSE_REPORT;
57  dgsmatrix newmat(m,n,CPPL_INT(data.size()*2));
58  newmat.zero();
59 
60  const std::vector<dcomponent>::const_iterator data_end =data.end();
61  for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
62  newmat.put(it->i, it->j, it->v);
63  if(it->i!=it->j){
64  newmat.put(it->j, it->i, it->v);
65  }
66  }
67 
68  destroy();
69  return _(newmat);
70 }
Real Double-precision General Sparse Matrix Class.
Definition: dgsmatrix.hpp:3
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT const & m
matrix row size
Definition: _dssmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
void destroy() const
_dcovector _(dcovector &vec)
double _dssmatrix::operator() ( const CPPL_INT &  i,
const CPPL_INT &  j 
) const
inline

operator() for const object

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

References data, line, and n.

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 << "," << n << ")." << std::endl;
10  exit(1);
11  }
12 #endif//CPPL_DEBUG
13 
14  //// search (i,j) component ////
15  const CPPL_INT ii(std::max(i,j)), jj(std::min(i,j));
16 
17  const std::vector<CPPL_INT>::iterator line_ii_end =line[ii].end();
18  for(std::vector<CPPL_INT>::iterator p=line[ii].begin(); p!=line_ii_end; p++){
19  if(data[*p].i==ii && data[*p].j==jj){ return data[*p].v; }
20  }
21 
22  //// (i,j) component was not found ////
23  return 0.0;
24 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13
void _dssmatrix::write ( const char *  filename) const
inline

Definition at line 66 of file _dssmatrix-io.hpp.

References data, destroy(), and n.

67 {CPPL_VERBOSE_REPORT;
68  std::ofstream ofs(filename, std::ios::trunc);
69  ofs.setf(std::cout.flags());
70  ofs.precision(std::cout.precision());
71  ofs.width(std::cout.width());
72  ofs.fill(std::cout.fill());
73 
74  ofs << "#dssmatrix " << n << " " << data.size() << std::endl;
75 
76  const std::vector<dcomponent>::const_iterator data_end =data.end();
77  for(std::vector<dcomponent>::const_iterator it=data.begin(); it!=data_end; it++){
78  ofs << it->i << " " << it->j << " " << it->v << std::endl;
79  }
80 
81  ofs.close();
82  destroy();
83 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
void destroy() const
void _dssmatrix::nullify ( ) const
inline

nullify all the matrix data

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

References data, line, and n.

Referenced by _dssmatrix(), dssmatrix::dssmatrix(), and dssmatrix::shallow_copy().

4 {CPPL_VERBOSE_REPORT;
5  n=0;
6  data.clear();
7  line.clear();
8 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13
void _dssmatrix::destroy ( ) const
inline

destroy all the matrix data

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

References data, and line.

Referenced by damax(), idamax(), operator*(), operator+(), dssmatrix::operator+=(), operator-(), dssmatrix::operator-=(), operator<<(), to_dgematrix(), to_dgsmatrix(), to_dsymatrix(), to_zhsmatrix(), and write().

13 {CPPL_VERBOSE_REPORT;
14  data.clear();
15  line.clear();
16 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13

Friends And Related Function Documentation

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

Definition at line 31 of file _dssmatrix-io.hpp.

32 {CPPL_VERBOSE_REPORT;
33  for(CPPL_INT i=0; i<mat.n; i++){
34  for(CPPL_INT j=0; j<mat.n; j++){
35  if( i >= j ){
36  std::vector<CPPL_INT>::iterator q;
37  const std::vector<CPPL_INT>::iterator mat_line_i_end =mat.line[i].end();
38  for(q=mat.line[i].begin(); q!=mat_line_i_end; q++){
39  if(mat.data[*q].j==j){ break; }
40  }
41  if(q!=mat_line_i_end){ s << " " << mat.data[*q].v << " "; }
42  else{ s << " x "; }
43  }
44  else{//i<j
45  std::vector<CPPL_INT>::iterator q;
46  const std::vector<CPPL_INT>::iterator mat_line_i_end =mat.line[i].end();
47  for(q=mat.line[i].begin(); q!=mat_line_i_end; q++){
48  if(mat.data[*q].j==j){ break; }
49  }
50  if(q!=mat_line_i_end){ s << "{" << mat.data[*q].v << "}"; }
51  else{ s << "{x}"; }
52  }
53  }
54  s << std::endl;
55  }
56 
57  mat.destroy();
58  return s;
59 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
_dgematrix i(const _dgbmatrix &mat)
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13
void destroy() const
_dssmatrix t ( const dssmatrix mat)
friend

return transposed dssmatrix

Definition at line 3 of file dssmatrix-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  dssmatrix newmat(mat);
11  return _(newmat);
12 }
Real Double-precision Symmetric Sparse Matrix Class.
Definition: dssmatrix.hpp:3
_dcovector _(dcovector &vec)
void idamax ( CPPL_INT &  i,
CPPL_INT &  j,
const dssmatrix mat 
)
friend

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

Definition at line 21 of file dssmatrix-calc.hpp.

22 {CPPL_VERBOSE_REPORT;
23  std::vector<dcomponent>::const_iterator itx(mat.data.begin());
24  double vmax =0.;
25 
26  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
27  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
28  if( vmax < fabs(it->v) ){
29  vmax =fabs(it->v);
30  itx =it;
31  }
32  }
33 
34  i =itx->i;
35  j =itx->j;
36 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11
_dgematrix i(const _dgbmatrix &mat)
friend _dgematrix i(const _dgematrix &)
double damax ( const dssmatrix mat)
friend

return its largest absolute value

Definition at line 40 of file dssmatrix-calc.hpp.

41 {CPPL_VERBOSE_REPORT;
42  std::vector<dcomponent>::const_iterator itx(mat.data.begin());
43  double vmax =0.;
44 
45  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
46  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
47  if( vmax < fabs(it->v) ){
48  vmax =fabs(it->v);
49  itx =it;
50  }
51  }
52 
53  return itx->v;
54 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11
const _dssmatrix& operator+ ( const _dssmatrix mat)
friend

+_dssmatrix operator

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

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

-_dssmatrix operator

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

11 {CPPL_VERBOSE_REPORT;
12  const std::vector<dcomponent>::iterator mat_data_end =mat.data.end();
13  for(std::vector<dcomponent>::iterator it=mat.data.begin(); it!=mat_data_end; it++){
14  it->v =-it->v;
15  }
16 
17  return mat;
18 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
_dgematrix operator+ ( const _dssmatrix ,
const dgematrix  
)
friend
_dgematrix operator+ ( const _dssmatrix ,
const _dgematrix  
)
friend
_dgematrix operator+ ( const _dssmatrix ,
const dsymatrix  
)
friend
_dgematrix operator+ ( const _dssmatrix ,
const _dsymatrix  
)
friend
_dgematrix operator+ ( const _dssmatrix ,
const dgbmatrix  
)
friend
_dgematrix operator+ ( const _dssmatrix ,
const _dgbmatrix  
)
friend
_dgsmatrix operator+ ( const _dssmatrix ,
const dgsmatrix  
)
friend
_dgsmatrix operator+ ( const _dssmatrix ,
const _dgsmatrix  
)
friend
_dssmatrix operator+ ( const _dssmatrix matA,
const dssmatrix matB 
)
friend

_dssmatrix+dssmatrix operator

Definition at line 3 of file _dssmatrix-dssmatrix.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  dssmatrix newmat(matA);
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  return _(newmat);
22 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
Real Double-precision Symmetric Sparse Matrix Class.
Definition: dssmatrix.hpp:3
CPPL_INT n
matrix column size
Definition: dssmatrix.hpp:10
_dcovector _(dcovector &vec)
_dssmatrix operator+ ( const _dssmatrix matA,
const _dssmatrix matB 
)
friend

_dssmatrix+_dssmatrix operator

Definition at line 3 of file _dssmatrix-_dssmatrix.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  dssmatrix newmat(matA);
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  matB.destroy();
22  return _(newmat);
23 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
Real Double-precision Symmetric Sparse Matrix Class.
Definition: dssmatrix.hpp:3
void destroy() const
_dcovector _(dcovector &vec)
_dgematrix operator- ( const _dssmatrix ,
const dgematrix  
)
friend
_dgematrix operator- ( const _dssmatrix ,
const _dgematrix  
)
friend
_dgematrix operator- ( const _dssmatrix ,
const dsymatrix  
)
friend
_dgematrix operator- ( const _dssmatrix ,
const _dsymatrix  
)
friend
_dgematrix operator- ( const _dssmatrix ,
const dgbmatrix  
)
friend
_dgematrix operator- ( const _dssmatrix ,
const _dgbmatrix  
)
friend
_dgsmatrix operator- ( const _dssmatrix ,
const dgsmatrix  
)
friend
_dgsmatrix operator- ( const _dssmatrix ,
const _dgsmatrix  
)
friend
_dssmatrix operator- ( const _dssmatrix matA,
const dssmatrix matB 
)
friend

_dssmatrix-dssmatrix operator

Definition at line 26 of file _dssmatrix-dssmatrix.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  dssmatrix newmat(matA);
38 
39  const std::vector<dcomponent>::const_iterator matB_data_end =matB.data.end();
40  for(std::vector<dcomponent>::const_iterator it=matB.data.begin(); it!=matB_data_end; it++){
41  newmat(it->i,it->j) -=it->v;
42  }
43 
44  return _(newmat);
45 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
Real Double-precision Symmetric Sparse Matrix Class.
Definition: dssmatrix.hpp:3
CPPL_INT n
matrix column size
Definition: dssmatrix.hpp:10
_dcovector _(dcovector &vec)
_dssmatrix operator- ( const _dssmatrix matA,
const _dssmatrix matB 
)
friend

_dssmatrix-_dssmatrix operator

Definition at line 27 of file _dssmatrix-_dssmatrix.hpp.

28 {CPPL_VERBOSE_REPORT;
29 #ifdef CPPL_DEBUG
30  if(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.n << "x" << matB.n << ")." << std::endl;
34  exit(1);
35  }
36 #endif//CPPL_DEBUG
37 
38  dssmatrix newmat(matA);
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  matB.destroy();
46  return _(newmat);
47 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
Real Double-precision Symmetric Sparse Matrix Class.
Definition: dssmatrix.hpp:3
void destroy() const
_dcovector _(dcovector &vec)
_dgematrix operator* ( const _dssmatrix ,
const dgematrix  
)
friend
_dgematrix operator* ( const _dssmatrix ,
const _dgematrix  
)
friend
_dgematrix operator* ( const _dssmatrix ,
const dsymatrix  
)
friend
_dgematrix operator* ( const _dssmatrix ,
const _dsymatrix  
)
friend
_dgematrix operator* ( const _dssmatrix ,
const dgbmatrix  
)
friend
_dgematrix operator* ( const _dssmatrix ,
const _dgbmatrix  
)
friend
_dgematrix operator* ( const _dssmatrix ,
const dgsmatrix  
)
friend
_dgematrix operator* ( const _dssmatrix ,
const _dgsmatrix  
)
friend
_dssmatrix operator* ( const _dssmatrix ,
const dssmatrix  
)
friend
_dssmatrix operator* ( const _dssmatrix ,
const _dssmatrix  
)
friend
_dssmatrix operator* ( const _dssmatrix mat,
const double &  d 
)
friend

_dssmatrix*double operator

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

4 {CPPL_VERBOSE_REPORT;
5  const std::vector<dcomponent>::iterator mat_data_end =mat.data.end();
6  for(std::vector<dcomponent>::iterator it=mat.data.begin(); it!=mat_data_end; it++){
7  it->v *=d;
8  }
9 
10  return mat;
11 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
_dssmatrix operator/ ( const _dssmatrix mat,
const double &  d 
)
friend

_dssmatrix/double operator

Definition at line 15 of file _dssmatrix-double.hpp.

16 {CPPL_VERBOSE_REPORT;
17  const std::vector<dcomponent>::iterator mat_data_end =mat.data.end();
18  for(std::vector<dcomponent>::iterator it=mat.data.begin(); it!=mat_data_end; it++){
19  it->v /=d;
20  }
21 
22  return mat;
23 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
_dssmatrix operator* ( const double &  d,
const _dssmatrix mat 
)
friend

double*_dssmatrix operator

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

4 {CPPL_VERBOSE_REPORT;
5  const std::vector<dcomponent>::iterator mat_data_end =mat.data.end();
6  for(std::vector<dcomponent>::iterator it=mat.data.begin(); it!=mat_data_end; it++){
7  it->v *=d;
8  }
9 
10  return mat;
11 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12

Member Data Documentation

CPPL_INT const& _dssmatrix::m

matrix row size

Definition at line 10 of file _dssmatrix.hpp.

Referenced by to_dgematrix(), and to_dgsmatrix().

CPPL_INT _dssmatrix::n
mutable
std::vector<dcomponent> _dssmatrix::data
mutable
std::vector< std::vector<CPPL_INT> > _dssmatrix::line
mutable

vector of vector to store the entry information of component for each row and column

Definition at line 13 of file _dssmatrix.hpp.

Referenced by _(), _dssmatrix(), destroy(), dssmatrix::dssmatrix(), nullify(), operator()(), operator<<(), dssmatrix::shallow_copy(), and ~_dssmatrix().


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