Menu

[r131]: / trunk / include / drovector- / drovector-calc.hpp  Maximize  Restore  History

Download this file

32 lines (27 with data), 1.0 kB

 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
//=============================================================================
/*! return a transposed column vector */
inline _dcovector t(const drovector& rovec)
{VERBOSE_REPORT;
dcovector covec(rovec.l);
dcopy_(rovec.l, rovec.array, 1, covec.array, 1);
return _(covec);
}
//=============================================================================
/*! return its Euclidean norm */
inline double nrm2(const drovector& vec)
{VERBOSE_REPORT;
return dnrm2_(vec.l, vec.array, 1);
}
//=============================================================================
/*! return the index of element having the largest absolute value
in 0-based numbering system */
inline long idamax(const drovector& vec)
{VERBOSE_REPORT;
return idamax_(vec.l, vec.array, 1) -1;
}
//=============================================================================
/*! return its largest absolute value */
inline double damax(const drovector& vec)
{VERBOSE_REPORT;
return vec.array[idamax_(vec.l, vec.array, 1) -1];
}
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.