jacobi_oo_STL
Functions
vdop.h File Reference
#include <vector>

Go to the source code of this file.

Functions

void vddiv (std::vector< double > &x, std::vector< double > const &y, std::vector< double > const &z)
 Element-wise vector divison x_k = y_k/z_k. More...
 
void vdaxpy (std::vector< double > &x, std::vector< double > const &y, double alpha, std::vector< double > const &z)
 Element-wise daxpy operation x(k) = y(k) + alpha*z(k). More...
 
double dscapr (std::vector< double > const &x, std::vector< double > const &y)
 Calculates the Euclidian inner product of two vectors. More...
 
void DebugVector (std::vector< double > const &v)
 
bool CompareVectors (std::vector< double > const &x, int n, double const y[], double const eps=0.0)
 Compares an STL vector with POD vector. More...
 

Function Documentation

◆ CompareVectors()

bool CompareVectors ( std::vector< double > const &  x,
int  n,
double const  y[],
double const  eps = 0.0 
)

Compares an STL vector with POD vector.

The accuracy criteria \( |x_k-y_k| < \varepsilon \left({1+0.5(|x_k|+|y_k|)}\right) \) follows the book by Stoyan/Baran, p.8.

Parameters
[in]xSTL vector
[in]nlength of POD vector
[in]yPOD vector
[in]epsrelative accuracy criteria (default := 0.0).
Returns
true iff pairwise vector elements are relatively close to each other.

Definition at line 66 of file vdop.cpp.

◆ DebugVector()

void DebugVector ( std::vector< double > const &  v)

Print entries of a vector.

Parameters
[in]vvector values

◆ dscapr()

double dscapr ( std::vector< double > const &  x,
std::vector< double > const &  y 
)

Calculates the Euclidian inner product of two vectors.

Parameters
[in]xvector
[in]yvector
Returns
Euclidian inner product \(\langle x,y \rangle\)

Definition at line 38 of file vdop.cpp.

◆ vdaxpy()

void vdaxpy ( std::vector< double > &  x,
std::vector< double > const &  y,
double  alpha,
std::vector< double > const &  z 
)

Element-wise daxpy operation x(k) = y(k) + alpha*z(k).

Parameters
[out]xtarget vector
[in]ysource vector
[in]alphascalar
[in]zsource vector

Definition at line 24 of file vdop.cpp.

◆ vddiv()

void vddiv ( std::vector< double > &  x,
std::vector< double > const &  y,
std::vector< double > const &  z 
)

Element-wise vector divison x_k = y_k/z_k.

Parameters
[out]xtarget vector
[in]ysource vector
[in]zsource vector