9 void linspace(
double a,
double b,
int num,
double *arr);
22 int exDOS(
double *vals,
int n,
int npts,
23 double *x,
double *y,
double *intv) {
28 double h, xi, t, scaling;
29 const double lm = intv[2];
30 const double lM = intv[3];
31 const double kappa = 1.25;
32 const int M =
min(n, 30);
33 const double H = (lM - lm) / (M - 1);
34 const double sigma = H / sqrt(8 * log(kappa));
35 const double a = intv[0];
36 const double b = intv[1];
37 double sigma2 = 2 * sigma * sigma;
40 const double tol = 1e-08;
41 double width = sigma * sqrt(-2.0 * log(tol));
45 memset(y, 0.0, npts*
sizeof(
double));
53 j =
max((
int) ((t-a-width)/h),0);
56 for (xi = a+j*h; xi <=
min(t+width,b) ; xi+=h)
57 y[j++] += exp(-(xi-t)*(xi-t)/sigma2);
66 scaling = 1.0 / (n*sqrt(sigma2*
PI));
67 DSCAL(&npts, &scaling, y, &one);
void DSCAL(int *n, double *a, double *x, int *incx)
int exDOS(double *vals, int n, int npts, double *x, double *y, double *intv)
Defs for blaslapack routines.
void linspace(double a, double b, int num, double *arr)