#include <iostream>
#include <mpi.h>
#include <string>
#include <vector>
Go to the source code of this file.
|
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 Euclidean inner product of two vectors. More...
|
|
double | L2_scapr (std::vector< double > const &x, std::vector< double > const &y) |
|
double | par_scalar (std::vector< double > const &x, std::vector< double > const &y, MPI_Comm const &icomm=MPI_COMM_WORLD) |
|
int | ReadIn (std::string const &ss=std::string(), MPI_Comm const &icomm=MPI_COMM_WORLD) |
|
template<class T > |
void | DebugVector (std::vector< T > const &v, std::string const &ss=std::string(), MPI_Comm const &icomm=MPI_COMM_WORLD) |
|
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...
|
|
template<class T > |
std::ostream & | operator<< (std::ostream &s, std::vector< T > const &v) |
|
void | ExchangeAll (std::vector< double > const &xin, std::vector< double > &yout, MPI_Comm const &icomm=MPI_COMM_WORLD) |
|
void | ExchangeAllInPlace (std::vector< double > &xin, MPI_Comm const &icomm=MPI_COMM_WORLD) |
|
◆ 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 69 of file vdop.cpp.
◆ DebugVector()
template<class T >
void DebugVector |
( |
std::vector< T > const & |
v, |
|
|
std::string const & |
ss = std::string() , |
|
|
MPI_Comm const & |
icomm = MPI_COMM_WORLD |
|
) |
| |
Print entries of a vector to standard output.
- Parameters
-
[in] | v | vector values |
[in] | ss | string containing the vector name |
[in] | icomm | communicator group for MPI |
Definition at line 86 of file vdop.h.
◆ 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 |
( |
std::vector< double > const & |
xin, |
|
|
std::vector< double > & |
yout, |
|
|
MPI_Comm const & |
icomm = MPI_COMM_WORLD |
|
) |
| |
Exchanges equal size partions of vector xin
with all MPI processes. The received data are return in vector yout
.
- Parameters
-
[in] | xin | input vector |
[out] | yout | output vector |
[in] | icomm | MPI communicator |
◆ ExchangeAllInPlace()
void ExchangeAllInPlace |
( |
std::vector< double > & |
xin, |
|
|
MPI_Comm const & |
icomm = MPI_COMM_WORLD |
|
) |
| |
Exchanges equal size partions of vector xin
with all MPI processes. The received data are return in vector xin
.
- Parameters
-
[in,out] | xin | input/output vector |
[in] | icomm | MPI communicator |
◆ L2_scapr()
double L2_scapr |
( |
std::vector< double > const & |
x, |
|
|
std::vector< double > const & |
y |
|
) |
| |
|
inline |
◆ operator<<()
template<class T >
std::ostream& operator<< |
( |
std::ostream & |
s, |
|
|
std::vector< T > const & |
v |
|
) |
| |
Output operator for vector
- Parameters
-
[in,out] | s | output stream, e.g. cout |
[in] | v | vector @return output stream
|
Definition at line 137 of file vdop.h.
◆ par_scalar()
double par_scalar |
( |
std::vector< double > const & |
x, |
|
|
std::vector< double > const & |
y, |
|
|
MPI_Comm const & |
icomm = MPI_COMM_WORLD |
|
) |
| |
Parallel inner product
- Parameters
-
[in] | x | vector |
[in] | y | vector |
[in] | icomm | MPI communicator |
- Returns
- resulting Euclidian inner product <x,y>
◆ ReadIn()
int ReadIn |
( |
std::string const & |
ss = std::string() , |
|
|
MPI_Comm const & |
icomm = MPI_COMM_WORLD |
|
) |
| |
|
inline |
◆ 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 |
( |
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] | x | target vector |
[in] | y | source vector |
[in] | z | source vector |