Download this file
23 lines (20 with data), 511 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 | //=============================================================================
/*! return its largest absolute value */
inline double damax(const dgrmatrix& mat)
{CPPL_VERBOSE_REPORT;
//////// exception ////////
if(mat.a.size()==0){
return 0.;
}
//////// find ////////
const size_t mat_a_size =mat.a.size();
double amax =0.;
double vmax;
for(size_t k=0; k<mat_a_size; k++){
if( amax < fabs(mat.a[k]) ){
amax =fabs(mat.a[k]);
vmax =mat.a[k];
}
}
return vmax;
}
|
×
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.