#include "vdop.h"
#include <cassert>
#include <cmath>
#include <iostream>
#include <vector>
Go to the source code of this file.
|
void | vddiv (vector< double > &x, vector< double > const &y, vector< double > const &z) |
|
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 Euclidean inner product of two vectors. More...
|
|
bool | CompareVectors (std::vector< double > const &x, int const n, double const y[], double const eps) |
| Compares an STL vector with POD vector. More...
|
|
double | par_scalar (vector< double > const &x, vector< double > const &y, MPI_Comm const &icomm) |
|
void | ExchangeAll (vector< double > const &xin, vector< double > &yout, MPI_Comm const &icomm) |
|
void | ExchangeAllInPlace (vector< double > &xin, MPI_Comm const &icomm) |
|
◆ 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] | x | STL vector |
[in] | n | length of POD vector |
[in] | y | POD vector |
[in] | eps | relative accuracy criteria (default := 0.0). |
- Returns
- true iff pairwise vector elements are relatively close to each other.
Definition at line 56 of file vdop.cpp.
◆ dscapr()
double dscapr |
( |
std::vector< double > const & |
x, |
|
|
std::vector< double > const & |
y |
|
) |
| |
Calculates the Euclidean inner product of two vectors.
- Parameters
-
- Returns
- Euclidean inner product \(\langle x,y \rangle\)
Definition at line 40 of file vdop.cpp.
◆ ExchangeAll()
void ExchangeAll |
( |
vector< double > const & |
xin, |
|
|
vector< double > & |
yout, |
|
|
MPI_Comm const & |
icomm |
|
) |
| |
◆ ExchangeAllInPlace()
void ExchangeAllInPlace |
( |
vector< double > & |
xin, |
|
|
MPI_Comm const & |
icomm |
|
) |
| |
◆ par_scalar()
double par_scalar |
( |
vector< double > const & |
x, |
|
|
vector< double > const & |
y, |
|
|
MPI_Comm const & |
icomm |
|
) |
| |
◆ 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] | x | target vector |
[in] | y | source vector |
[in] | alpha | scalar |
[in] | z | source vector |
Definition at line 25 of file vdop.cpp.
◆ vddiv()
void vddiv |
( |
vector< double > & |
x, |
|
|
vector< double > const & |
y, |
|
|
vector< double > const & |
z |
|
) |
| |