Go to the documentation of this file.
15 void vddiv(std::vector<double> &x, std::vector<double>
const &y,
16 std::vector<double>
const &z);
26 void vdaxpy(std::vector<double> &x, std::vector<double>
const &y,
27 double alpha, std::vector<double>
const &z );
37 double dscapr(std::vector<double>
const &x, std::vector<double>
const &y);
41 double L2_scapr(std::vector<double>
const &x, std::vector<double>
const &y)
43 return dscapr(x, y) / x.size();
53 double par_scalar(std::vector<double>
const &x, std::vector<double>
const &y,
54 MPI_Comm
const& icomm=MPI_COMM_WORLD);
60 int ReadIn(std::string
const &ss = std::string(), MPI_Comm
const &icomm = MPI_COMM_WORLD)
64 MPI_Comm_rank(icomm, &myrank);
68 std::cout <<
"\n\n " << ss <<
" : Which process do you want to debug ? \n";
71 MPI_Bcast(&
id, 1, MPI_INT, 0, icomm);
85 void DebugVector(std::vector<T>
const &
v, std::string
const &ss = std::string(), MPI_Comm
const &icomm = MPI_COMM_WORLD)
90 MPI_Comm_size(icomm, &numprocs);
92 MPI_Comm_rank(icomm, &myrank);
96 while ( (0 <= readid) && (readid < numprocs) ) {
97 if (myrank == readid) {
98 std::cout <<
"\n\n process " << readid;
99 std::cout <<
"\n .... " << ss <<
" (nnode = " <<
v.size() <<
")\n";
100 for (
size_t j = 0; j <
v.size(); ++j) {
101 std::cout.setf(std::ios::right, std::ios::adjustfield);
102 std::cout <<
"[" << j <<
"] "<<
v[j] <<
" ";
104 std::cout << std::endl;
108 readid =
ReadIn(ss, icomm);
127 bool CompareVectors(std::vector<double>
const &x,
int n,
double const y[],
double const eps = 0.0);
137 std::ostream&
operator<<(std::ostream &s, std::vector<T>
const &
v)
154 void ExchangeAll(std::vector<double>
const &xin, std::vector<double> &yout, MPI_Comm
const &icomm = MPI_COMM_WORLD);
163 void ExchangeAllInPlace(std::vector<double> &xin, MPI_Comm
const &icomm = MPI_COMM_WORLD);
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.
bool CompareVectors(std::vector< double > const &x, int n, double const y[], double const eps=0.0)
Compares an STL vector with POD vector.
void DebugVector(std::vector< T > const &v, std::string const &ss=std::string(), MPI_Comm const &icomm=MPI_COMM_WORLD)
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).
std::ostream & operator<<(std::ostream &s, std::vector< T > const &v)
void ExchangeAllInPlace(std::vector< double > &xin, MPI_Comm const &icomm=MPI_COMM_WORLD)
int ReadIn(std::string const &ss=std::string(), MPI_Comm const &icomm=MPI_COMM_WORLD)
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)
double dscapr(std::vector< double > const &x, std::vector< double > const &y)
Calculates the Euclidean inner product of two vectors.
void ExchangeAll(std::vector< double > const &xin, std::vector< double > &yout, MPI_Comm const &icomm=MPI_COMM_WORLD)