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

References dssmatrix::data, dssmatrix::line, and dssmatrix::n.

Referenced by _().

391 {CPPL_VERBOSE_REPORT;
392  std::swap(A.n,B.n);
393  std::swap(A.data,B.data);
394  std::swap(A.line,B.line);
395 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: dssmatrix.hpp:12
void swap(dssmatrix &A, dssmatrix &B)
CPPL_INT n
matrix column size
Definition: dssmatrix.hpp:10
_dssmatrix _ ( dssmatrix mat)
inline

convert user object to smart-temporary object

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

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

400 {CPPL_VERBOSE_REPORT;
401  _dssmatrix newmat;
402 
403  //////// shallow copy ////////
404  newmat.n =mat.n;
405  std::swap(newmat.data,mat.data);
406  std::swap(newmat.line,mat.line);
407 
408  //////// nullify ////////
409  mat.n =0;
410 
411  return newmat;
412 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: dssmatrix.hpp:12
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
(DO NOT USE) Smart-temporary Real Double-precision Symmetric Sparse Matrix Class
Definition: _dssmatrix.hpp:3
CPPL_INT n
matrix column size
Definition: _dssmatrix.hpp:11
void swap(dssmatrix &A, dssmatrix &B)
CPPL_INT n
matrix column size
Definition: dssmatrix.hpp:10
std::vector< std::vector< CPPL_INT > > line
vector of vector to store the entry information of component for each row and column ...
Definition: _dssmatrix.hpp:13