1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-18 00:43:51 +02:00

fixed seg fault: incremented wrong counter

This commit is contained in:
Gianfranco Abrusci 2022-02-03 11:40:54 +01:00
parent 67f80532f9
commit 6a0c54f48c

View File

@ -1332,45 +1332,40 @@ integer function qmckl_compute_asymp_jasb_f(context, bord_num, bord_vector, resc
end function qmckl_compute_asymp_jasb_f
#+end_src
#+begin_src c :tangle (eval c)
#+begin_src c :comments org :tangle (eval c) :noweb yes
qmckl_exit_code qmckl_compute_asymp_jasb (
const qmckl_context context,
const int64_t bord_num,
const double* bord_vector,
const double rescale_factor_kappa_ee,
double* const asymp_jasb ) {
// Put some code here
int64_t info;
// What is wrong here?
double kappa_inv, x, asym_one;
kappa_inv = 1.0/ rescale_factor_kappa_ee;
info = QMCKL_SUCCESS;
kappa_inv = 1.0 / rescale_factor_kappa_ee;
if (context == QMCKL_NULL_CONTEXT){
info = QMCKL_INVALID_CONTEXT;
return info;
return QMCKL_INVALID_CONTEXT;
}
if (bord_num <= 0) {
info = QMCKL_INVALID_ARG_2;
return info;
return QMCKL_INVALID_ARG_2;
}
asym_one = bord_vector[0] * kappa_inv / (1.0 + bord_vector[1] * kappa_inv);
asymp_jasb[0] = asym_one;
asymp_jasb[1] = 0.5 * asym_one;
for (int i=0; i<=1; ++i) {
for (int i = 0 ; i <= 1; ++i) {
x = kappa_inv;
for (int p = 1; p < bord_num; ++i){
for (int p = 1; p < bord_num; ++p){
x = x * kappa_inv;
asymp_jasb[i] = asymp_jasb[i] + bord_vector[p + 1] * x;
}
}
return info;
} // end function qmckl_exit_code
return QMCKL_SUCCESS;
}
#+end_src
#+CALL: generate_c_header(table=qmckl_asymp_jasb_args,rettyp=get_value("CRetType"),fname=get_value("Name"))