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

Go to the source code of this file.

Functions

drovector t (const _dcovector &covec)
 
double nrm2 (const _dcovector &vec)
 
CPPL_INT idamax (const _dcovector &vec)
 
double damax (const _dcovector &vec)
 

Function Documentation

drovector t ( const _dcovector covec)
inline

return a transposed row vector

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

References _drovector::array, _dcovector::array, _drovector::cap, _dcovector::cap, _dcovector::l, _drovector::l, and _dcovector::nullify().

Referenced by m2q(), and rotate().

4 {CPPL_VERBOSE_REPORT;
5  _drovector rovec;
6  rovec.l =covec.l;
7  rovec.cap =covec.cap;
8  delete [] rovec.array;
9  rovec.array =covec.array;
10 
11  covec.nullify();
12  return rovec;
13 }
CPPL_INT l
vector size
Definition: _dcovector.hpp:9
double * array
1D array to store vector data
Definition: _drovector.hpp:11
CPPL_INT l
vector size
Definition: _drovector.hpp:9
CPPL_INT cap
vector capacity
Definition: _dcovector.hpp:10
CPPL_INT cap
vector capacity
Definition: _drovector.hpp:10
(DO NOT USE) Smart-temporary Real Double-precision Row Vector Class
Definition: _drovector.hpp:3
double * array
1D array to store vector data
Definition: _dcovector.hpp:11
void nullify() const
double nrm2 ( const _dcovector vec)
inline

return its Euclidean norm

Definition at line 17 of file _dcovector-calc.hpp.

References _dcovector::array, _dcovector::destroy(), and _dcovector::l.

Referenced by inv(), and vt2q().

18 {CPPL_VERBOSE_REPORT;
19  CPPL_INT inc =1;
20  double val =dnrm2_(&vec.l, vec.array, &inc);
21  vec.destroy();
22  return val;
23 }
CPPL_INT l
vector size
Definition: _dcovector.hpp:9
void destroy() const
double * array
1D array to store vector data
Definition: _dcovector.hpp:11
CPPL_INT idamax ( const _dcovector vec)
inline

return the index of element having the largest absolute value in 0-based numbering system

Definition at line 28 of file _dcovector-calc.hpp.

References _dcovector::array, _dcovector::destroy(), i(), and _dcovector::l.

29 {CPPL_VERBOSE_REPORT;
30  CPPL_INT inc =1;
31  CPPL_INT i =idamax_(&vec.l, vec.array, &inc) -1 ;
32  vec.destroy();
33  return i;
34 }
CPPL_INT l
vector size
Definition: _dcovector.hpp:9
_dgematrix i(const _dgbmatrix &mat)
void destroy() const
double * array
1D array to store vector data
Definition: _dcovector.hpp:11
double damax ( const _dcovector vec)
inline

return its largest absolute value

Definition at line 38 of file _dcovector-calc.hpp.

References _dcovector::array, _dcovector::destroy(), and _dcovector::l.

39 {CPPL_VERBOSE_REPORT;
40  CPPL_INT inc =1;
41  double val =vec.array[idamax_(&vec.l, vec.array, &inc) -1];
42  vec.destroy();
43  return val;
44 }
CPPL_INT l
vector size
Definition: _dcovector.hpp:9
void destroy() const
double * array
1D array to store vector data
Definition: _dcovector.hpp:11