CPPLapack
 All Classes Files Functions Variables Friends Pages
Functions
_zgsmatrix-calc.hpp File Reference

Go to the source code of this file.

Functions

_zgsmatrix t (const _zgsmatrix &mat)
 
void idamax (CPPL_INT &i, CPPL_INT &j, const _zgsmatrix &mat)
 
comple damax (const _zgsmatrix &mat)
 

Function Documentation

_zgsmatrix t ( const _zgsmatrix mat)
inline

return transposed _zgsmatrix

Definition at line 3 of file _zgsmatrix-calc.hpp.

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

4 {CPPL_VERBOSE_REPORT;
5  const std::vector<zcomponent>::iterator mat_data_end =mat.data.end();
6  for(std::vector<zcomponent>::iterator it=mat.data.begin(); it!=mat_data_end; it++){
7  std::swap(it->i,it->j);
8  }
9 
10  std::swap(mat.rows,mat.cols);
11 
12  return mat;
13 }
std::vector< std::vector< CPPL_INT > > rows
array of vector to store the entry information of component for each row
Definition: _zgsmatrix.hpp:12
std::vector< std::vector< CPPL_INT > > cols
array of vector to store the entry information of component for each column
Definition: _zgsmatrix.hpp:13
void swap(dcovector &u, dcovector &v)
std::vector< zcomponent > data
matrix data
Definition: _zgsmatrix.hpp:11
void idamax ( CPPL_INT &  i,
CPPL_INT &  j,
const _zgsmatrix mat 
)
inline

search the index of element having the largest absolute value in 0-based numbering system

Definition at line 21 of file _zgsmatrix-calc.hpp.

References _zgsmatrix::data, and _zgsmatrix::destroy().

22 {CPPL_VERBOSE_REPORT;
23  std::vector<zcomponent>::const_iterator itx(mat.data.begin());
24  double vmax =0.;
25 
26  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
27  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
28  if( vmax < norm(it->v) ){
29  vmax =norm(it->v);
30  itx =it;
31  }
32  }
33 
34  i=itx->i;
35  j=itx->j;
36 
37  mat.destroy();
38 }
_dgematrix i(const _dgbmatrix &mat)
friend _dgematrix i(const _dgematrix &)
void destroy() const
std::vector< zcomponent > data
matrix data
Definition: _zgsmatrix.hpp:11
comple damax ( const _zgsmatrix mat)
inline

return its largest absolute value

Definition at line 42 of file _zgsmatrix-calc.hpp.

References _zgsmatrix::data, and _zgsmatrix::destroy().

43 {CPPL_VERBOSE_REPORT;
44  std::vector<zcomponent>::const_iterator itx(mat.data.begin());
45  double vmax =0.;
46 
47  const std::vector<zcomponent>::const_iterator mat_data_end =mat.data.end();
48  for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
49  if( vmax < norm(it->v) ){
50  vmax =norm(it->v);
51  itx =it;
52  }
53  }
54 
55  mat.destroy();
56  return itx->v;
57 }
void destroy() const
std::vector< zcomponent > data
matrix data
Definition: _zgsmatrix.hpp:11