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

Go to the source code of this file.

Functions

_dssmatrix t (const dssmatrix &mat)
 
void idamax (CPPL_INT &i, CPPL_INT &j, const dssmatrix &mat)
 
double damax (const dssmatrix &mat)
 

Function Documentation

_dssmatrix t ( const dssmatrix mat)
inline

return transposed dssmatrix

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

References _().

4 {CPPL_VERBOSE_REPORT;
5 #ifdef CPPL_DEBUG
6  WARNING_REPORT;
7  std::cerr << "This function call has no effect since the matrix is symmetric." << std::endl;
8 #endif//CPPL_DEBUG
9 
10  dssmatrix newmat(mat);
11  return _(newmat);
12 }
Real Double-precision Symmetric Sparse Matrix Class.
Definition: dssmatrix.hpp:3
_dcovector _(dcovector &vec)
void idamax ( CPPL_INT &  i,
CPPL_INT &  j,
const dssmatrix mat 
)
inline

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

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

References dssmatrix::data.

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

return its largest absolute value

Definition at line 40 of file dssmatrix-calc.hpp.

References dssmatrix::data.

41 {CPPL_VERBOSE_REPORT;
42  std::vector<dcomponent>::const_iterator itx(mat.data.begin());
43  double vmax =0.;
44 
45  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
46  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
47  if( vmax < fabs(it->v) ){
48  vmax =fabs(it->v);
49  itx =it;
50  }
51  }
52 
53  return itx->v;
54 }
std::vector< dcomponent > data
matrix data
Definition: dssmatrix.hpp:11