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

Go to the source code of this file.

Functions

double damax (const dgrmatrix &mat)
 

Function Documentation

double damax ( const dgrmatrix mat)
inline

return its largest absolute value

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

References dgrmatrix::a.

4 {CPPL_VERBOSE_REPORT;
5  //////// exception ////////
6  if(mat.a.size()==0){
7  return 0.;
8  }
9 
10  //////// find ////////
11  const size_t mat_a_size =mat.a.size();
12  double amax =0.;
13  double vmax;
14  for(size_t k=0; k<mat_a_size; k++){
15  if( amax < fabs(mat.a[k]) ){
16  amax =fabs(mat.a[k]);
17  vmax =mat.a[k];
18  }
19  }
20 
21  return vmax;
22 }
std::vector< double > a
matrix component values
Definition: dgrmatrix.hpp:11