Skip to content

Commit a57c48f

Browse files
Re-order the parameters of the OperatorCallback struct
1 parent d8a0e15 commit a57c48f

3 files changed

Lines changed: 30 additions & 30 deletions

File tree

examples/cpp/evolve-grid-identity.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ std::vector<std::size_t> unravel_index(std::size_t flat_index, const std::vector
2525
}
2626

2727
extern "C" void generate_fake_ekos(
28-
const int* /*pids_in*/,
29-
const double* /*x_in*/,
30-
const int* /*pids_out*/,
31-
const double* /*x_out*/,
32-
double* eko_buffer,
33-
void* params_state,
3428
pineappl_conv_type /*conv_type*/,
3529
double /*fac1*/,
3630
std::size_t pids_in_len,
31+
const int* /*pids_in*/,
3732
std::size_t x_in_len,
33+
const double* /*x_in*/,
3834
std::size_t pids_out_len,
39-
std::size_t x_out_len
35+
const int* /*pids_out*/,
36+
std::size_t x_out_len,
37+
const double* /*x_out*/,
38+
double* eko_buffer,
39+
void* params_state
4040
) {
4141
// Check to get the μ0 of the PDF from the `params_state`
4242
const double _ = static_cast<LHAPDF::PDF*> (params_state)->q2Min();

examples/cpp/evolve-grid.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ std::vector<std::size_t> unravel_index(std::size_t flat_index, const std::vector
8383
}
8484

8585
extern "C" void generate_fake_ekos(
86-
const int* /*pids_in*/,
87-
const double* /*x_in*/,
88-
const int* /*pids_out*/,
89-
const double* /*x_out*/,
90-
double* eko_buffer,
91-
void* params_state,
9286
pineappl_conv_type /*conv_type*/,
9387
double /*fac1*/,
9488
std::size_t /*pids_in_len*/,
89+
const int* /*pids_in*/,
9590
std::size_t /*x_in_len*/,
91+
const double* /*x_in*/,
9692
std::size_t /*pids_out_len*/,
97-
std::size_t /*x_out_len*/
93+
const int* /*pids_out*/,
94+
std::size_t /*x_out_len*/,
95+
const double* /*x_out*/,
96+
double* eko_buffer,
97+
void* params_state
9898
) {
9999
// Check to get the μ0 from the PDF
100100
const double _ = static_cast<LHAPDF::PDF*> (params_state)->q2Min();

pineappl_capi/src/lib.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,18 +2139,18 @@ pub unsafe extern "C" fn pineappl_grid_evolve_info(
21392139

21402140
/// Type alias for the operator callback
21412141
pub type OperatorCallback = unsafe extern "C" fn(
2142-
*const i32, // pids_in
2143-
*const f64, // x_in
2144-
*const i32, // pids_out
2145-
*const f64, // x_out
2146-
*mut f64, // Evolution Operator data buffer
2147-
*mut c_void, // Callable of PDF object
21482142
ConvType, // Convolution type
21492143
f64, // fac1
2150-
usize, // Length of pids_in
2151-
usize, // Length of x_in
2152-
usize, // Length of pids_out
2153-
usize, // Length of x_out
2144+
usize, // size of `pids_in`
2145+
*const i32, // `pids_in`
2146+
usize, // size of `x_in`
2147+
*const f64, // `x_in`
2148+
usize, // size of `pids_out`
2149+
*const i32, // `pids_out`
2150+
usize, // size of `x_out`
2151+
*const f64, // `x_out`
2152+
*mut f64, // Evolution Operator data buffer
2153+
*mut c_void, // Callable state of parameters
21542154
);
21552155

21562156
/// Evolve a grid with an evolution operator and dump the resulting FK table.
@@ -2247,22 +2247,22 @@ pub unsafe extern "C" fn pineappl_grid_evolve(
22472247

22482248
unsafe {
22492249
slices(
2250+
op_info.conv_type,
2251+
op_info.fac1,
2252+
pids_in.len(),
22502253
pids_in.as_ptr(),
2254+
x_in.len(),
22512255
x_in.as_ptr(),
2256+
pids_out.len(),
22522257
pids_out.as_ptr(),
2258+
x_out.len(),
22532259
x_out.as_ptr(),
22542260
array
22552261
.as_slice_mut()
22562262
// UNWRAP: `array` is by construction contiguous and in standard order
22572263
.unwrap()
22582264
.as_mut_ptr(),
22592265
state,
2260-
op_info.conv_type,
2261-
op_info.fac1,
2262-
pids_in.len(),
2263-
x_in.len(),
2264-
pids_out.len(),
2265-
x_out.len(),
22662266
);
22672267
}
22682268

0 commit comments

Comments
 (0)