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

Go to the source code of this file.

Functions

void swap (dgsmatrix &A, dgsmatrix &B)
_dgsmatrix _ (dgsmatrix &mat)

Function Documentation

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

swap two matrices

Definition at line 315 of file dgsmatrix-misc.hpp.

References dgsmatrix::cols, dgsmatrix::data, dgsmatrix::m, dgsmatrix::n, dgsmatrix::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);
}
_dgsmatrix _ ( dgsmatrix mat) [inline]

convert user object to smart-temporary object

Definition at line 326 of file dgsmatrix-misc.hpp.

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

{VERBOSE_REPORT;
  _dgsmatrix 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