CPPLapack
 All Classes Files Functions Variables Friends Pages
dgrmatrix-cast.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! cast to _zgrmatrix */
3 /*
4 inline _zgrmatrix dgrmatrix::to_zgrmatrix() const
5 {CPPL_VERBOSE_REPORT;
6  zgrmatrix newmat;
7  newmat.m =m;
8  newmat.n =n;
9  newmat.ia =ia;
10  newmat.ja =ja;
11 
12  newmat.a.resize(a.size());
13  const size_t a_size =a.size();
14  for(size_t k=0; k<a_size; k++){
15  newmat.a[k] =comple(a[k],0.);
16  }
17 
18  return _(newmat);
19 }
20 */
21 
22 ///////////////////////////////////////////////////////////////////////////////
23 ///////////////////////////////////////////////////////////////////////////////
24 ///////////////////////////////////////////////////////////////////////////////
25 
26 //=============================================================================
27 /*! convert to _dgematrix */
29 {CPPL_VERBOSE_REPORT;
30  dgematrix newmat(m,n);
31  newmat.zero();
32 
33  for(CPPL_INT i=0; i<m; i++){
34  int k_beg =ia[i]-1;
35  int k_end =ia[i+1]-1;
36  for(int k=k_beg; k<k_end; k++){
37  int j =ja[k]-1;
38  newmat(i,j) =a[k];
39  }
40  }
41 
42  return _(newmat);
43 }
_dgematrix to_dgematrix() const
std::vector< double > a
matrix component values
Definition: dgrmatrix.hpp:11
std::vector< CPPL_INT > ia
rowIndex (NOT zero-based BUT one-based indexing)
Definition: dgrmatrix.hpp:12
dgematrix & zero()
_dgematrix i(const _dgbmatrix &mat)
Real Double-precision General Dence Matrix Class.
Definition: dgematrix.hpp:3
CPPL_INT n
matrix column size
Definition: dgrmatrix.hpp:10
(DO NOT USE) Smart-temporary Real Double-precision General Dence Matrix Class
Definition: _dgematrix.hpp:3
CPPL_INT m
matrix row size
Definition: dgrmatrix.hpp:9
std::vector< CPPL_INT > ja
columns (NOT zero-based BUT one-based indexing)
Definition: dgrmatrix.hpp:13
_dcovector _(dcovector &vec)