CPPLapack
 All Classes Files Functions Variables Friends Pages
_dgsmatrix-cast.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! cast to _zgsmatrix */
4 {CPPL_VERBOSE_REPORT;
5  zgsmatrix newmat(m,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.));
10  }
11 
12  destroy();
13  return _(newmat);
14 }
15 
16 ///////////////////////////////////////////////////////////////////////////////
17 ///////////////////////////////////////////////////////////////////////////////
18 ///////////////////////////////////////////////////////////////////////////////
19 
20 //=============================================================================
21 /*! convert to _dgematrix */
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  }
31 
32  destroy();
33  return _(newmat);
34 }
Complex Double-precision General Sparse Matrix Class.
Definition: zgsmatrix.hpp:3
_zgsmatrix to_zgsmatrix() const
CPPL_INT n
matrix column size
Definition: _dgsmatrix.hpp:10
_dgematrix to_dgematrix() const
dgematrix & zero()
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
Definition: _zgsmatrix.hpp:3
zgsmatrix & put(const CPPL_INT &, const CPPL_INT &, const comple &)
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgsmatrix.hpp:9
void destroy() const
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Definition: _dgematrix.hpp:3
std::vector< dcomponent > data
matrix data
Definition: _dgsmatrix.hpp:11
_dcovector _(dcovector &vec)