jacobi.template
Functions
vdop.cpp File Reference
#include "vdop.h"
#include <cassert>
#include <cmath>
#include <iostream>
#include <vector>

Go to the source code of this file.

Functions

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)
 

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 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
[in]xvector
[in]yvector
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 
)

Definition at line 87 of file vdop.cpp.

◆ ExchangeAllInPlace()

void ExchangeAllInPlace ( vector< double > &  xin,
MPI_Comm const &  icomm 
)

Definition at line 107 of file vdop.cpp.

◆ par_scalar()

double par_scalar ( vector< double > const &  x,
vector< double > const &  y,
MPI_Comm const &  icomm 
)

Definition at line 77 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 25 of file vdop.cpp.

◆ vddiv()

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

Definition at line 9 of file vdop.cpp.