forked from IPKM/nmreval
16 lines
457 B
C
16 lines
457 B
C
/* integrands used in quadrature integration with scipy's LowLevelCallables */
|
|
#include <math.h>
|
|
|
|
double anistropicDiffusion(double x, void *user_data) {
|
|
double *c = (double *)user_data;
|
|
|
|
double q = c[0];
|
|
double t = c[1];
|
|
double d_perp = c[2];
|
|
double d_par = c[3];
|
|
|
|
double cos_theta = cos(x);
|
|
double sin_theta = sin(x);
|
|
|
|
return exp(-q * q * t * (d_par * cos_theta * cos_theta + d_perp * sin_theta * sin_theta)) * sin_theta;
|
|
} |