CPPLapack
 All Classes Files Functions Variables Friends Pages
dgrmatrix-calc.hpp
Go to the documentation of this file.
1 //=============================================================================
2 /*! return its largest absolute value */
3 inline double damax(const dgrmatrix& mat)
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
double damax(const dgrmatrix &mat)
Real Double-precision General Compressed Sparse Row (CSR) Matrix Class.
Definition: dgrmatrix.hpp:3