Download this file
47 lines (43 with data), 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 | //=============================================================================
/*! */
template<long l>
inline drovector_small<l> t(const dcovector_small<l>& A)
{
drovector_small<l> X;
for(long i=0; i<l; i++){
X(i)=A(i);
}
return X;
}
//=============================================================================
/*! */
template<long l>
inline double nrm2(const dcovector_small<l>& A)
{
double v(0);
for(long i=0; i<l; i++){
v+=A(i)*A(i);
}
return sqrt(v);
}
//=============================================================================
template<long l>
inline void idamax(long& K, const dcovector_small<l>& A)
{
double max(-1.);
for(int k=0; k<l; k++){
if( max<fabs(A(k)) ){
K=k;
max =fabs(A(k));
}
}
return;
}
//=============================================================================
template<long l>
inline double damax(const dcovector_small<l>& A)
{
long k(0);
idamax(k,A);
return A(k);
}
|
×
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.