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

Go to the source code of this file.

Functions

void swap (dsymatrix &A, dsymatrix &B)
 
_dsymatrix _ (dsymatrix &mat)
 

Function Documentation

void swap ( dsymatrix A,
dsymatrix B 
)
inline

swap two matrices

Definition at line 168 of file dsymatrix-misc.hpp.

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

169 {CPPL_VERBOSE_REPORT;
170  CPPL_INT A_n =A.n;
171  double* A_array =A.array;
172  double** A_darray =A.darray;
173  A.n=B.n; A.array=B.array; A.darray=B.darray;
174  B.n=A_n; B.array=A_array; B.darray=A_darray;
175 }
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
double * array
1D array to store matrix data
Definition: dsymatrix.hpp:11
double ** darray
array of pointers of column head addresses
Definition: dsymatrix.hpp:12
_dsymatrix _ ( dsymatrix mat)
inline

convert user object to smart-temporary object

Definition at line 179 of file dsymatrix-misc.hpp.

References dsymatrix::array, _dsymatrix::array, dsymatrix::darray, _dsymatrix::darray, dsymatrix::n, and _dsymatrix::n.

180 {CPPL_VERBOSE_REPORT;
181  _dsymatrix newmat;
182 
183  //////// shallow copy ////////
184  newmat.n =mat.n;
185  newmat.array =mat.array;
186  newmat.darray =mat.darray;
187 
188  //////// nullify ////////
189  mat.n =0;
190  mat.array =NULL;
191  mat.darray =NULL;
192 
193  return newmat;
194 }
double * array
1D array to store matrix data
Definition: _dsymatrix.hpp:12
double ** darray
array of pointers of column head addresses
Definition: _dsymatrix.hpp:13
CPPL_INT n
matrix column size
Definition: dsymatrix.hpp:10
(DO NOT USE) Smart-temporary Real Double-precision Symmetric Matrix Class
Definition: _dsymatrix.hpp:3
double * array
1D array to store matrix data
Definition: dsymatrix.hpp:11
CPPL_INT n
matrix column size
Definition: _dsymatrix.hpp:11
double ** darray
array of pointers of column head addresses
Definition: dsymatrix.hpp:12