Skip to content

Commit e39cc8e

Browse files
author
Unknown
committed
Syntax updates.
1 parent 1a2cd18 commit e39cc8e

4 files changed

Lines changed: 54 additions & 39 deletions

File tree

rss_ringoccs/diffrec/src/__fresnel_integral_cosine.c

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
/*----------------------Single Precision Functions----------------------------*/
1010

11-
float Fresnel_Cosine_Taylor_to_Asymptotic_Float(float x){
12-
11+
float Fresnel_Cosine_Taylor_to_Asymptotic_Float(float x)
12+
{
1313
/* Variables for S(x) and powers of x, respectively. */
1414
float cx, arg;
1515
arg = x*x;
@@ -72,7 +72,8 @@ float Fresnel_Cosine_Taylor_to_Asymptotic_Float(float x){
7272
}
7373
}
7474

75-
float Fresnel_Cosine_While_to_Asymptotic_Float(float x){
75+
float Fresnel_Cosine_While_to_Asymptotic_Float(float x)
76+
{
7677
float FRESNEL_COSINE_TAYLOR_COEFFICIENTS[30] = {
7778
FRESNEL_COSINE_TAYLOR_00, FRESNEL_COSINE_TAYLOR_01,
7879
FRESNEL_COSINE_TAYLOR_02, FRESNEL_COSINE_TAYLOR_03,
@@ -150,7 +151,8 @@ float Fresnel_Cosine_While_to_Asymptotic_Float(float x){
150151
}
151152
}
152153

153-
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Three_Float(float x){
154+
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Three_Float(float x)
155+
{
154156
float A, R, a, b, c, d, sgn_x;
155157
sgn_x = (x>0)-(x<0);
156158
x *= SQRT_2_BY_PI*sgn_x;
@@ -178,7 +180,8 @@ float Fresnel_Cosine_Heald_Rational_EPS_Minus_Three_Float(float x){
178180
return sgn_x*(SQRT_PI_BY_8 - R*sinf(A));
179181
}
180182

181-
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Four_Float(float x){
183+
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Four_Float(float x)
184+
{
182185
float A, R, a, b, c, d, sgn_x;
183186
sgn_x = (x>0)-(x<0);
184187
x *= SQRT_2_BY_PI*sgn_x;
@@ -208,7 +211,8 @@ float Fresnel_Cosine_Heald_Rational_EPS_Minus_Four_Float(float x){
208211
return sgn_x*(SQRT_PI_BY_8 - R*sinf(A));
209212
}
210213

211-
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Six_Float(float x){
214+
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Six_Float(float x)
215+
{
212216
float A, R, a, b, c, d, sgn_x;
213217
sgn_x = (x>0)-(x<0);
214218
x *= SQRT_2_BY_PI*sgn_x;
@@ -242,7 +246,8 @@ float Fresnel_Cosine_Heald_Rational_EPS_Minus_Six_Float(float x){
242246
return sgn_x*(SQRT_PI_BY_8 - R*sinf(A));
243247
}
244248

245-
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Eight_Float(float x){
249+
float Fresnel_Cosine_Heald_Rational_EPS_Minus_Eight_Float(float x)
250+
{
246251
float A, R, a, b, c, d, sgn_x;
247252
sgn_x = (x>0)-(x<0);
248253
x *= SQRT_2_BY_PI*sgn_x;
@@ -286,8 +291,8 @@ float Fresnel_Cosine_Heald_Rational_EPS_Minus_Eight_Float(float x){
286291

287292
/*----------------------Double Precision Functions----------------------------*/
288293

289-
double Fresnel_Cosine_Taylor_to_Asymptotic_Double(double x){
290-
294+
double Fresnel_Cosine_Taylor_to_Asymptotic_Double(double x)
295+
{
291296
/* Variables for S(x) and powers of x, respectively. */
292297
double cx, arg;
293298
arg = x*x;
@@ -356,7 +361,8 @@ double Fresnel_Cosine_Taylor_to_Asymptotic_Double(double x){
356361
}
357362
}
358363

359-
double Fresnel_Cosine_While_to_Asymptotic_Double(double x){
364+
double Fresnel_Cosine_While_to_Asymptotic_Double(double x)
365+
{
360366
double FRESNEL_COSINE_TAYLOR_COEFFICIENTS[27] = {
361367
FRESNEL_COSINE_TAYLOR_00, FRESNEL_COSINE_TAYLOR_01,
362368
FRESNEL_COSINE_TAYLOR_02, FRESNEL_COSINE_TAYLOR_03,
@@ -436,7 +442,8 @@ double Fresnel_Cosine_While_to_Asymptotic_Double(double x){
436442
}
437443
}
438444

439-
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Three_Double(double x){
445+
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Three_Double(double x)
446+
{
440447
double A, R, a, b, c, d, sgn_x;
441448
sgn_x = (x>0)-(x<0);
442449
x *= SQRT_2_BY_PI*sgn_x;
@@ -464,7 +471,8 @@ double Fresnel_Cosine_Heald_Rational_EPS_Minus_Three_Double(double x){
464471
return sgn_x*(SQRT_PI_BY_8 - R*sin(A));
465472
}
466473

467-
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Four_Double(double x){
474+
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Four_Double(double x)
475+
{
468476
double A, R, a, b, c, d, sgn_x;
469477
sgn_x = (x>0)-(x<0);
470478
x *= SQRT_2_BY_PI*sgn_x;
@@ -494,7 +502,8 @@ double Fresnel_Cosine_Heald_Rational_EPS_Minus_Four_Double(double x){
494502
return sgn_x*(SQRT_PI_BY_8 - R*sin(A));
495503
}
496504

497-
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Six_Double(double x){
505+
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Six_Double(double x)
506+
{
498507
double A, R, a, b, c, d, sgn_x;
499508
sgn_x = (x>0)-(x<0);
500509
x *= SQRT_2_BY_PI*sgn_x;
@@ -528,7 +537,8 @@ double Fresnel_Cosine_Heald_Rational_EPS_Minus_Six_Double(double x){
528537
return sgn_x*(SQRT_PI_BY_8 - R*sin(A));
529538
}
530539

531-
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Eight_Double(double x){
540+
double Fresnel_Cosine_Heald_Rational_EPS_Minus_Eight_Double(double x)
541+
{
532542
double A, R, a, b, c, d, sgn_x;
533543
sgn_x = (x>0)-(x<0);
534544
x *= SQRT_2_BY_PI*sgn_x;
@@ -572,8 +582,8 @@ double Fresnel_Cosine_Heald_Rational_EPS_Minus_Eight_Double(double x){
572582

573583
/*--------------------Long Double Precision Functions-------------------------*/
574584

575-
long double Fresnel_Cosine_Taylor_to_Asymptotic_Long_Double(long double x){
576-
585+
long double Fresnel_Cosine_Taylor_to_Asymptotic_Long_Double(long double x)
586+
{
577587
/* Variables for S(x) and powers of x, respectively. */
578588
long double cx, arg;
579589
arg = x*x;
@@ -646,7 +656,8 @@ long double Fresnel_Cosine_Taylor_to_Asymptotic_Long_Double(long double x){
646656
}
647657
}
648658

649-
long double Fresnel_Cosine_While_to_Asymptotic_Long_Long_Double(long double x){
659+
long double Fresnel_Cosine_While_to_Asymptotic_Long_Long_Double(long double x)
660+
{
650661
double FRESNEL_COSINE_TAYLOR_COEFFICIENTS[27] = {
651662
FRESNEL_COSINE_TAYLOR_00, FRESNEL_COSINE_TAYLOR_01,
652663
FRESNEL_COSINE_TAYLOR_02, FRESNEL_COSINE_TAYLOR_03,

rss_ringoccs/diffrec/src/__math_function_bessel.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
* the Taylor expansion. This, combined with trial and error, produced *
5151
* these selected ranges. *
5252
******************************************************************************/
53-
float BesselJ0_Float(float x){
54-
53+
float BesselJ0_Float(float x)
54+
{
5555
x = fabsf(x);
5656
float arg = x*x;
5757

@@ -97,8 +97,8 @@ float BesselJ0_Float(float x){
9797
}
9898
}
9999

100-
double BesselJ0_Double(double x){
101-
100+
double BesselJ0_Double(double x)
101+
{
102102
x = fabs(x);
103103
double arg = x*x;
104104

@@ -151,8 +151,8 @@ double BesselJ0_Double(double x){
151151
}
152152
}
153153

154-
long double BesselJ0_Long_Double(long double x){
155-
154+
long double BesselJ0_Long_Double(long double x)
155+
{
156156
x = fabsl(x);
157157
long double arg = x*x;
158158

@@ -209,7 +209,8 @@ long double BesselJ0_Long_Double(long double x){
209209
}
210210
}
211211

212-
float BesselI0_Float(float x){
212+
float BesselI0_Float(float x)
213+
{
213214

214215
x = fabsf(x);
215216
float bessel_I0, arg;
@@ -249,8 +250,8 @@ float BesselI0_Float(float x){
249250
}
250251
}
251252

252-
double BesselI0_Double(double x){
253-
253+
double BesselI0_Double(double x)
254+
{
254255
x = fabs(x);
255256
double bessel_I0, arg;
256257

@@ -298,8 +299,8 @@ double BesselI0_Double(double x){
298299
}
299300
}
300301

301-
long double BesselI0_Long_Double(long double x){
302-
302+
long double BesselI0_Long_Double(long double x)
303+
{
303304
x = fabsl(x);
304305
long double bessel_I0, arg;
305306

rss_ringoccs/diffrec/src/_fraunhofer_diffraction_wrappers.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
* Python level, see special_functions.py. *
3737
******************************************************************************/
3838
static void float_single_slit_diffraction(char **args, npy_intp *dimensions,
39-
npy_intp* steps, void* data){
40-
39+
npy_intp* steps, void* data)
40+
{
4141
/* Declare i for indexing, n is the number of elements in the array. */
4242
npy_intp i;
4343
npy_intp n = dimensions[0];
@@ -83,8 +83,8 @@ static void float_single_slit_diffraction(char **args, npy_intp *dimensions,
8383
* Python level, see special_functions.py. *
8484
******************************************************************************/
8585
static void double_single_slit_diffraction(char **args, npy_intp *dimensions,
86-
npy_intp* steps, void* data){
87-
86+
npy_intp* steps, void* data)
87+
{
8888
/* Declare i for indexing, n is the number of elements in the array. */
8989
npy_intp i;
9090
npy_intp n = dimensions[0];
@@ -131,8 +131,8 @@ static void double_single_slit_diffraction(char **args, npy_intp *dimensions,
131131
******************************************************************************/
132132
static void long_double_single_slit_diffraction(char **args,
133133
npy_intp *dimensions,
134-
npy_intp* steps, void* data){
135-
134+
npy_intp* steps, void* data)
135+
{
136136
/* Declare i for indexing, n is the number of elements in the array. */
137137
npy_intp i;
138138
npy_intp n = dimensions[0];

rss_ringoccs/diffrec/src/_window_function_kaiser_bessel_wrappers.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@
88
#include <numpy/ndarraytypes.h>
99

1010
static void float_kb20(char **args, npy_intp *dimensions,
11-
npy_intp *steps, void *data){
11+
npy_intp *steps, void *data)
12+
{
1213
npy_intp i;
13-
npy_intp n = dimensions[0];
14+
npy_intp n_elements = dimensions[0];
1415

1516
float *x = (float *)args[0];
1617
float W = *(float *)args[1];
1718
float *out = (float *)args[2];
1819

19-
for (i = 0; i < n; i++) {
20+
for (i = 0; i < n_elements; i++) {
2021
out[i] = Kaiser_Bessel_2_0_Float(x[i], W);
2122
}
2223
}
2324

2425
static void double_kb20(char **args, npy_intp *dimensions,
25-
npy_intp *steps, void *data){
26+
npy_intp *steps, void *data)
27+
{
2628
npy_intp i;
2729
npy_intp n = dimensions[0];
2830

@@ -36,7 +38,8 @@ static void double_kb20(char **args, npy_intp *dimensions,
3638
}
3739

3840
static void long_double_kb20(char **args, npy_intp *dimensions,
39-
npy_intp *steps, void *data){
41+
npy_intp *steps, void *data)
42+
{
4043
npy_intp i;
4144
npy_intp n = dimensions[0];
4245

0 commit comments

Comments
 (0)