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

Go to the source code of this file.

Functions

void swap (dssmatrix &A, dssmatrix &B)
_dssmatrix _ (dssmatrix &mat)

Function Documentation

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

swap two matrices

Definition at line 362 of file dssmatrix-misc.hpp.

References dssmatrix::data, dssmatrix::line, dssmatrix::n, and swap().

{VERBOSE_REPORT;
  std::swap(A.n,B.n);
  std::swap(A.data,B.data);
  std::swap(A.line,B.line);
}
_dssmatrix _ ( dssmatrix mat) [inline]

convert user object to smart-temporary object

Definition at line 371 of file dssmatrix-misc.hpp.

References _dssmatrix::data, dssmatrix::data, dssmatrix::line, _dssmatrix::line, dssmatrix::n, _dssmatrix::n, and swap().

{VERBOSE_REPORT;
  _dssmatrix newmat;
  
  //////// shallow copy ////////
  newmat.n =mat.n;
  std::swap(newmat.data,mat.data);
  std::swap(newmat.line,mat.line);
  
  //////// nullify ////////
  mat.n =0;
  
  return newmat;
}
 All Classes Files Functions Variables Friends