Sets of routine for performing operations on vectors using pthreads.
More...
#include <math.h>
#include <cstdlib>
#include <pthread.h>
|
typedef struct thread_data | thread_data |
|
|
void * | vect_coupling_thread (void *data) |
|
void * | vect_dcoupling_thread (void *data) |
|
void | vect_coupling (int N, double *X, double fact, int nthreads) |
|
void | vect_dcoupling (int N, double *X, double fact, int nthreads) |
|
Sets of routine for performing operations on vectors using pthreads.
- Author
- Patrice Koehl
- Date
- 11/12/2018
- Version
- 1
- Copyright
- BSD 3-Clause License.
◆ coupling
Initial value:= [](double xb, double beta)
{
double vexp, val;
double x = xb*beta;
double tol = 1.e-10;
if(std::abs(x) < tol) {
val = 0.5;
} else if(x < 0) {
vexp = std::exp(x);
val = 1./(1-vexp) + 1/x;
} else {
vexp = std::exp(-x);
val = vexp/(vexp-1.0) + 1/x;
}
return val;
}
◆ dcoupling
Initial value:= [](double xb, double beta)
{
double vexp, val;
double x = xb*beta;
double tol = 1.e-10;
if(std::abs(x) < tol) {
val = -1.0/12;
} else if(x < 0) {
vexp = std::exp(x);
val = vexp/((1-vexp)*(1-vexp)) - 1/(x*x);
} else {
vexp = std::exp(-x);
val = vexp/((1-vexp)*(1-vexp)) - 1/(x*x);
}
return val;
}