CPPLapack
 All Classes Files Functions Variables Friends
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 161 of file zhematrix-misc.hpp.

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

{VERBOSE_REPORT;
  long A_n(A.n);
  comple* A_array(A.array);
  //comple** A_darray(A.darray);
  comple** A_darray=A.darray; //corruption to support VC++
  A.n=B.n; A.array=B.array; A.darray=B.darray;
  B.n=A_n; B.array=A_array; B.darray=A_darray;
}
_zhematrix _ ( zhematrix mat) [inline]

convert user object to smart-temporary object

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

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

{VERBOSE_REPORT;
  _zhematrix newmat;
  
  //////// shallow copy ////////
  newmat.n =mat.n;
  newmat.array =mat.array;
  newmat.darray =mat.darray;
  
  //////// nullify ////////
  mat.n =0;
  mat.array =NULL;
  mat.darray =NULL;
  
  return newmat;
}
 All Classes Files Functions Variables Friends