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

Go to the source code of this file.

Functions

void swap (zgsmatrix &A, zgsmatrix &B)
_zgsmatrix _ (zgsmatrix &mat)

Function Documentation

void swap ( zgsmatrix A,
zgsmatrix B 
) [inline]

swap two matrices

Definition at line 268 of file zgsmatrix-misc.hpp.

References zgsmatrix::cols, zgsmatrix::data, zgsmatrix::m, zgsmatrix::n, zgsmatrix::rows, and swap().

{VERBOSE_REPORT;
  std::swap(A.n,B.n);
  std::swap(A.m,B.m);
  std::swap(A.data,B.data);
  std::swap(A.rows,B.rows);
  std::swap(A.cols,B.cols);
}
_zgsmatrix _ ( zgsmatrix mat) [inline]

convert user object to smart-temporary object

Definition at line 279 of file zgsmatrix-misc.hpp.

References _zgsmatrix::cols, zgsmatrix::cols, _zgsmatrix::data, zgsmatrix::data, zgsmatrix::m, _zgsmatrix::m, zgsmatrix::n, _zgsmatrix::n, _zgsmatrix::rows, zgsmatrix::rows, and swap().

{VERBOSE_REPORT;
  _zgsmatrix newmat;
  
  //////// shallow copy ////////
  newmat.n =mat.n;
  newmat.m =mat.m;
  std::swap(newmat.data,mat.data);
  std::swap(newmat.rows,mat.rows);
  std::swap(newmat.cols,mat.cols);

  //////// nullify ////////
  mat.m =0;
  mat.n =0;
  
  return newmat;
}
 All Classes Files Functions Variables Friends