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.

4 {CPPL_VERBOSE_REPORT;
5  return mat;
6 }
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 15 of file _dssmatrix-calc.hpp.

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

16 {CPPL_VERBOSE_REPORT;
17  std::vector<dcomponent>::const_iterator itx(mat.data.begin());
18  double vmax(0);
19 
20  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
21  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
22  if(vmax < it->v){
23  vmax=fabs(it->v);
24  itx=it;
25  }
26  }
27 
28  i=itx->i;
29  j=itx->j;
30 
31  mat.destroy();
32 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
_dgematrix i(const _dgbmatrix &mat)
friend _dgematrix i(const _dgematrix &)
void destroy() const
double damax ( const _dssmatrix mat)
inline

return its largest absolute value

Definition at line 36 of file _dssmatrix-calc.hpp.

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

37 {CPPL_VERBOSE_REPORT;
38  std::vector<dcomponent>::const_iterator itx(mat.data.begin());
39  double vmax(0);
40 
41  const std::vector<dcomponent>::const_iterator mat_data_end =mat.data.end();
42  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat_data_end; it++){
43  if(vmax < it->v){
44  vmax=fabs(it->v);
45  itx=it;
46  }
47  }
48 
49  double val(itx->v);
50  mat.destroy();
51  return val;
52 }
std::vector< dcomponent > data
matrix data
Definition: _dssmatrix.hpp:12
void destroy() const