CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
zhsmatrix-misc.hpp File Reference

Go to the source code of this file.

Functions

void swap (zhsmatrix &A, zhsmatrix &B)
 
_zhsmatrix _ (zhsmatrix &mat)
 

Function Documentation

void swap ( zhsmatrix A,
zhsmatrix B 
)
inline

swap two matrices

Definition at line 251 of file zhsmatrix-misc.hpp.

References zhsmatrix::data, zhsmatrix::line, and zhsmatrix::n.

Referenced by _().

252 {CPPL_VERBOSE_REPORT;
253  std::swap(A.n,B.n);
254  std::swap(A.data,B.data);
255  std::swap(A.line,B.line);
256 }
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.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: zhsmatrix.hpp:12
void swap(zhsmatrix &A, zhsmatrix &B)
_zhsmatrix _ ( zhsmatrix mat)
inline

convert user object to smart-temporary object

Definition at line 260 of file zhsmatrix-misc.hpp.

References zhsmatrix::data, _zhsmatrix::data, zhsmatrix::line, _zhsmatrix::line, zhsmatrix::n, _zhsmatrix::n, and swap().

261 {CPPL_VERBOSE_REPORT;
262  _zhsmatrix newmat;
263  //////// shallow copy ////////
264  newmat.n =mat.n;
265  std::swap(newmat.data, mat.data);
266  std::swap(newmat.line, mat.line);
267  //////// nullify ////////
268  mat.n =0;
269  return newmat;
270 }
std::vector< zcomponent > data
matrix data
Definition: _zhsmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: zhsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: _zhsmatrix.hpp:11
std::vector< zcomponent > data
matrix data
Definition: zhsmatrix.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: zhsmatrix.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: _zhsmatrix.hpp:13
void swap(zhsmatrix &A, zhsmatrix &B)
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Sparse Matrix Class ...
Definition: _zhsmatrix.hpp:3