Correa 1
C++ library with Python bindings to analyse the shape of simple closed curves in R^2
Loading...
Searching...
No Matches
VectorOps.h File Reference

Sets of routine for performing operations on vectors using pthreads. More...

#include <math.h>
#include <cstdlib>
#include <pthread.h>

Classes

struct  thread_data
 

Typedefs

typedef struct thread_data thread_data
 

Functions

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)
 

Variables

thread_data thread_datas [NUM_THREADS]
 
auto coupling
 
auto dcoupling
 

Detailed Description

Sets of routine for performing operations on vectors using pthreads.

Author
Patrice Koehl
Date
11/12/2018
Version
1

Variable Documentation

◆ coupling

auto 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

auto 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;
}