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

Go to the source code of this file.

Functions

void swap (zhematrix &A, zhematrix &B)
 
_zhematrix _ (zhematrix &mat)
 

Function Documentation

void swap ( zhematrix A,
zhematrix B 
)
inline

swap two matrices

Definition at line 172 of file zhematrix-misc.hpp.

References zhematrix::array, zhematrix::darray, and zhematrix::n.

173 {CPPL_VERBOSE_REPORT;
174  CPPL_INT A_n =A.n;
175  comple* A_array =A.array;
176  comple** A_darray =A.darray;
177  A.n=B.n; A.array=B.array; A.darray=B.darray;
178  B.n=A_n; B.array=A_array; B.darray=A_darray;
179 }
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
comple ** darray
array of pointers of column head addresses
Definition: zhematrix.hpp:13
_zhematrix _ ( zhematrix mat)
inline

convert user object to smart-temporary object

Definition at line 183 of file zhematrix-misc.hpp.

References _zhematrix::array, zhematrix::array, _zhematrix::darray, zhematrix::darray, zhematrix::n, and _zhematrix::n.

184 {CPPL_VERBOSE_REPORT;
185  _zhematrix newmat;
186 
187  //////// shallow copy ////////
188  newmat.n =mat.n;
189  newmat.array =mat.array;
190  newmat.darray =mat.darray;
191 
192  //////// nullify ////////
193  mat.n =0;
194  mat.array =NULL;
195  mat.darray =NULL;
196 
197  return newmat;
198 }
(DO NOT USE) Smart-temporary Complex Double-precision Hermitian Matrix Class
Definition: _zhematrix.hpp:3
CPPL_INT n
matrix column size
Definition: _zhematrix.hpp:11
CPPL_INT n
matrix column size
Definition: zhematrix.hpp:11
comple * array
1D array to store matrix data
Definition: zhematrix.hpp:12
comple * array
1D array to store matrix data
Definition: _zhematrix.hpp:12
comple ** darray
array of pointers of column head addresses
Definition: zhematrix.hpp:13
comple ** darray
array of pointers of column head addresses
Definition: _zhematrix.hpp:13