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

References dgsmatrix::cols, dgsmatrix::data, dgsmatrix::m, dgsmatrix::n, and dgsmatrix::rows.

Referenced by _().

349 {CPPL_VERBOSE_REPORT;
350  std::swap(A.n,B.n);
351  std::swap(A.m,B.m);
352  std::swap(A.data,B.data);
353  std::swap(A.rows,B.rows);
354  std::swap(A.cols,B.cols);
355 }
void swap(dgsmatrix &A, dgsmatrix &B)
std::vector< dcomponent > data
matrix data
Definition: dgsmatrix.hpp:11
CPPL_INT n
matrix column size
Definition: dgsmatrix.hpp:10
std::vector< std::vector< CPPL_INT > > cols
array of vector to store the entry information of component for each column
Definition: dgsmatrix.hpp:13
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
Definition: dgsmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: dgsmatrix.hpp:9
_dgsmatrix _ ( dgsmatrix mat)
inline

convert user object to smart-temporary object

Definition at line 359 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().

360 {CPPL_VERBOSE_REPORT;
361  _dgsmatrix newmat;
362 
363  //////// shallow copy ////////
364  newmat.n =mat.n;
365  newmat.m =mat.m;
366  std::swap(newmat.data,mat.data);
367  std::swap(newmat.rows,mat.rows);
368  std::swap(newmat.cols,mat.cols);
369 
370  //////// nullify ////////
371  mat.m =0;
372  mat.n =0;
373 
374  return newmat;
375 }
void swap(dgsmatrix &A, dgsmatrix &B)
std::vector< std::vector< CPPL_INT > > cols
array of vector to store the entry information of component for each column
Definition: _dgsmatrix.hpp:13
std::vector< dcomponent > data
matrix data
Definition: dgsmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
Definition: _dgsmatrix.hpp:12
CPPL_INT n
matrix column size
Definition: _dgsmatrix.hpp:10
CPPL_INT n
matrix column size
Definition: dgsmatrix.hpp:10
std::vector< std::vector< CPPL_INT > > cols
array of vector to store the entry information of component for each column
Definition: dgsmatrix.hpp:13
(DO NOT USE) Smart-temporary Real Double-precision General Sparse Matrix Class
Definition: _dgsmatrix.hpp:3
CPPL_INT m
matrix row size
Definition: _dgsmatrix.hpp:9
std::vector< dcomponent > data
matrix data
Definition: _dgsmatrix.hpp:11
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
Definition: dgsmatrix.hpp:12
CPPL_INT m
matrix row size
Definition: dgsmatrix.hpp:9