1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-09-27 03:51:09 +02:00
This commit is contained in:
Anthony Scemama 2022-04-05 11:03:38 +02:00
commit 6fb261d635
13 changed files with 253 additions and 261 deletions

View File

@ -201,7 +201,7 @@ AS_IF([test "$BLAS_LIBS" == "$LAPACK_LIBS"], [BLAS_LIBS=""])
case $FC in
*ifort*)
FCFLAGS="$FCFLAGS -nofor-main -mp -target=gpu"
FCFLAGS="$FCFLAGS -nofor-main"
;;
*nvfortran*)
@ -213,7 +213,7 @@ esac
case $CC in
*nvc*)
CFLAGS="$CFLAGS -fPIC"
CFLAGS="$CFLAGS -fPIC -mp -target=gpu"
;;
esac

View File

@ -331,7 +331,7 @@ qmckl_exit_code qmckl_init_ao_basis(qmckl_context context) {
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
ctx->ao_basis.uninitialized = (1 << 14) - 1;
@ -359,7 +359,7 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
#+end_src
#+NAME:post2
@ -1376,7 +1376,7 @@ qmckl_get_ao_basis_type (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1;
@ -1416,7 +1416,7 @@ qmckl_get_ao_basis_shell_num (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 1;
@ -1454,7 +1454,7 @@ qmckl_get_ao_basis_prim_num (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 2;
@ -1495,7 +1495,7 @@ qmckl_get_ao_basis_nucleus_shell_num (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 3;
@ -1550,7 +1550,7 @@ qmckl_get_ao_basis_nucleus_index (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 4;
@ -1606,7 +1606,7 @@ qmckl_get_ao_basis_shell_ang_mom (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 5;
@ -1662,7 +1662,7 @@ qmckl_get_ao_basis_shell_prim_num (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 6;
@ -1718,7 +1718,7 @@ qmckl_get_ao_basis_shell_prim_index (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 7;
@ -1772,7 +1772,7 @@ qmckl_get_ao_basis_shell_factor (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 8;
@ -1828,7 +1828,7 @@ qmckl_get_ao_basis_exponent (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 9;
@ -1882,7 +1882,7 @@ qmckl_get_ao_basis_coefficient (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 10;
@ -1937,7 +1937,7 @@ qmckl_get_ao_basis_prim_factor (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 11;
@ -1990,7 +1990,7 @@ qmckl_get_ao_basis_ao_num (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 12;
@ -2032,7 +2032,7 @@ qmckl_get_ao_basis_ao_factor (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 13;
@ -2079,7 +2079,7 @@ bool qmckl_ao_basis_provided(const qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
return ctx->ao_basis.provided;
@ -2518,7 +2518,7 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t nucl_num = 0;
@ -2696,7 +2696,7 @@ int compare_basis( const void * l, const void * r )
#ifdef HAVE_HPC
qmckl_exit_code qmckl_finalize_basis_hpc (qmckl_context context)
{
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = ctx->nucleus.num * sizeof(int32_t);
@ -2867,7 +2867,7 @@ qmckl_get_ao_basis_primitive_vgl (qmckl_context context,
rc = qmckl_provide_ao_basis_primitive_vgl(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->ao_basis.prim_num * 5 * ctx->point.num;
@ -2928,7 +2928,7 @@ qmckl_get_ao_basis_shell_vgl (qmckl_context context,
rc = qmckl_provide_ao_basis_shell_vgl(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->ao_basis.shell_num * 5 * ctx->point.num;
@ -2991,7 +2991,7 @@ qmckl_get_ao_basis_ao_vgl (qmckl_context context,
rc = qmckl_provide_ao_vgl(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->ao_basis.ao_num * 5 * ctx->point.num;
@ -3046,7 +3046,7 @@ qmckl_get_ao_basis_ao_vgl_inplace (qmckl_context context,
qmckl_exit_code rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->ao_basis.ao_num * 5 * ctx->point.num;
@ -3487,7 +3487,7 @@ qmckl_exit_code qmckl_provide_ao_basis_primitive_vgl(qmckl_context context)
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->ao_basis.provided) {
@ -3888,7 +3888,7 @@ qmckl_exit_code qmckl_provide_ao_basis_shell_vgl(qmckl_context context)
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->ao_basis.provided) {
@ -4802,7 +4802,7 @@ qmckl_ao_polynomial_transp_vgl_hpc (const qmckl_context context,
double* restrict const VGL,
const int64_t ldv )
{
const qmckl_context_struct* ctx = (qmckl_context_struct* const) context;
const qmckl_context_struct* ctx = (qmckl_context_struct*) context;
assert (ctx != NULL && X != NULL && R != NULL && n != NULL && L != NULL && VGL != NULL);
if (lmax < 0) return QMCKL_INVALID_ARG_4;
if (ldl < 3) return QMCKL_INVALID_ARG_7;
@ -5912,7 +5912,7 @@ qmckl_exit_code qmckl_provide_ao_vgl(qmckl_context context)
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->ao_basis.provided) {

View File

@ -169,7 +169,7 @@ qmckl_context qmckl_context_check(const qmckl_context context) {
if (context == QMCKL_NULL_CONTEXT)
return QMCKL_NULL_CONTEXT;
const qmckl_context_struct* const ctx = (const qmckl_context_struct*) context;
const qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
/* Try to access memory */
if (ctx->tag != VALID_TAG) {
@ -267,7 +267,7 @@ qmckl_context qmckl_context_create() {
{
ctx->tag = VALID_TAG;
const qmckl_context context = (const qmckl_context) ctx;
const qmckl_context context = (qmckl_context) ctx;
assert ( qmckl_context_check(context) != QMCKL_NULL_CONTEXT );
qmckl_exit_code rc;

View File

@ -182,7 +182,7 @@ qmckl_exit_code qmckl_init_determinant(qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
ctx->det.uninitialized = (1 << 6) - 1;
@ -216,7 +216,7 @@ bool qmckl_determinant_provided(const qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
return ctx->det.provided;
@ -238,7 +238,7 @@ char qmckl_get_determinant_type (const qmckl_context context) {
return (char) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1;
@ -256,7 +256,7 @@ int64_t qmckl_get_determinant_walk_num (const qmckl_context context) {
return (int64_t) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 1;
@ -274,7 +274,7 @@ int64_t qmckl_get_determinant_det_num_alpha (const qmckl_context context) {
return (int64_t) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 2;
@ -292,7 +292,7 @@ int64_t qmckl_get_determinant_det_num_beta (const qmckl_context context) {
return (int64_t) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 3;
@ -310,7 +310,7 @@ int64_t* qmckl_get_determinant_mo_index_alpha (const qmckl_context context) {
return NULL;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 4;
@ -328,7 +328,7 @@ int64_t* qmckl_get_determinant_mo_index_beta (const qmckl_context context) {
return NULL;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 5;
@ -363,7 +363,7 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
#+end_src
#+NAME:post2
@ -525,7 +525,7 @@ qmckl_exit_code qmckl_finalize_determinant(qmckl_context context) {
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
qmckl_exit_code rc;
@ -596,7 +596,7 @@ qmckl_exit_code qmckl_get_det_vgl_alpha(qmckl_context context, double * const de
rc = qmckl_provide_det_vgl_alpha(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = 5 * ctx->det.det_num_alpha * ctx->det.walk_num *
@ -623,7 +623,7 @@ qmckl_exit_code qmckl_get_det_vgl_beta(qmckl_context context, double * const det
rc = qmckl_provide_det_vgl_beta(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = 5 * ctx->det.det_num_beta * ctx->det.walk_num *
@ -649,7 +649,7 @@ qmckl_exit_code qmckl_provide_det_vgl_alpha(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if(!(ctx->nucleus.provided)) {
@ -748,7 +748,7 @@ qmckl_exit_code qmckl_provide_det_vgl_beta(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if(!(ctx->nucleus.provided)) {
@ -1338,7 +1338,7 @@ qmckl_exit_code qmckl_get_det_inv_matrix_alpha(qmckl_context context, double * c
rc = qmckl_provide_det_inv_matrix_alpha(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->det.det_num_alpha * ctx->det.walk_num * ctx->electron.up_num * ctx->electron.up_num;
@ -1367,7 +1367,7 @@ qmckl_exit_code qmckl_get_det_inv_matrix_beta(qmckl_context context, double * co
rc = qmckl_provide_det_inv_matrix_beta(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->det.det_num_alpha * ctx->det.walk_num * ctx->electron.down_num * ctx->electron.down_num;
@ -1396,7 +1396,7 @@ qmckl_exit_code qmckl_get_det_adj_matrix_alpha(qmckl_context context, double * c
rc = qmckl_provide_det_inv_matrix_alpha(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->det.det_num_alpha * ctx->det.walk_num * ctx->electron.up_num * ctx->electron.up_num;
@ -1425,7 +1425,7 @@ qmckl_exit_code qmckl_get_det_adj_matrix_beta(qmckl_context context, double * co
rc = qmckl_provide_det_inv_matrix_beta(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->det.det_num_alpha * ctx->det.walk_num * ctx->electron.down_num * ctx->electron.down_num;
@ -1454,7 +1454,7 @@ qmckl_exit_code qmckl_get_det_alpha(qmckl_context context, double * const det_va
rc = qmckl_provide_det_inv_matrix_alpha(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->det.det_num_alpha * ctx->det.walk_num;
@ -1483,7 +1483,7 @@ qmckl_exit_code qmckl_get_det_beta(qmckl_context context, double * const det_val
rc = qmckl_provide_det_inv_matrix_beta(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->det.det_num_alpha * ctx->det.walk_num;
@ -1508,7 +1508,7 @@ qmckl_exit_code qmckl_provide_det_inv_matrix_alpha(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if(!(ctx->nucleus.provided)) {
@ -1631,7 +1631,7 @@ qmckl_exit_code qmckl_provide_det_inv_matrix_beta(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if(!(ctx->nucleus.provided)) {

View File

@ -157,7 +157,7 @@ qmckl_exit_code qmckl_init_electron(qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
ctx->electron.uninitialized = (1 << 2) - 1;
@ -182,7 +182,7 @@ bool qmckl_electron_provided(const qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
return ctx->electron.provided;
@ -228,7 +228,7 @@ qmckl_get_electron_num (const qmckl_context context, int64_t* const num) {
"num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 0;
@ -256,7 +256,7 @@ qmckl_get_electron_up_num (const qmckl_context context, int64_t* const up_num) {
"up_num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 0;
@ -284,7 +284,7 @@ qmckl_get_electron_down_num (const qmckl_context context, int64_t* const down_nu
"down_num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 0;
@ -323,7 +323,7 @@ qmckl_get_electron_walk_num (const qmckl_context context, int64_t* const walk_nu
"walk_num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 1;
@ -360,7 +360,7 @@ qmckl_get_electron_rescale_factor_ee (const qmckl_context context, double* const
"rescale_factor_kappa_ee is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
assert (ctx->electron.rescale_factor_kappa_ee > 0.0);
@ -383,7 +383,7 @@ qmckl_get_electron_rescale_factor_en (const qmckl_context context, double* const
"rescale_factor_kappa_en is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
assert (ctx->electron.rescale_factor_kappa_en > 0.0);
@ -448,7 +448,7 @@ qmckl_get_electron_coord (const qmckl_context context,
return QMCKL_INVALID_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->electron.provided) {
@ -489,7 +489,7 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
#+end_src
#+NAME:post2
@ -897,7 +897,7 @@ qmckl_exit_code qmckl_get_electron_ee_distance(qmckl_context context, double* co
rc = qmckl_provide_ee_distance(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.num * ctx->electron.num * ctx->electron.walk_num;
@ -921,7 +921,7 @@ qmckl_exit_code qmckl_provide_ee_distance(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
@ -1138,7 +1138,7 @@ qmckl_exit_code qmckl_get_electron_ee_distance_rescaled(qmckl_context context, d
rc = qmckl_provide_ee_distance_rescaled(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.num * ctx->electron.num * ctx->electron.walk_num;
@ -1162,7 +1162,7 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
@ -1384,7 +1384,7 @@ qmckl_exit_code qmckl_get_electron_ee_distance_rescaled_deriv_e(qmckl_context co
rc = qmckl_provide_ee_distance_rescaled_deriv_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = 4 * ctx->electron.num * ctx->electron.num * ctx->electron.walk_num;
@ -1408,7 +1408,7 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled_deriv_e(qmckl_context context
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
@ -1613,7 +1613,7 @@ qmckl_exit_code qmckl_get_electron_ee_potential(qmckl_context context, double* c
rc = qmckl_provide_ee_potential(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.walk_num * sizeof(double);
@ -1637,7 +1637,7 @@ qmckl_exit_code qmckl_provide_ee_potential(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->electron.provided) return QMCKL_NOT_PROVIDED;
@ -1818,7 +1818,7 @@ qmckl_exit_code qmckl_get_electron_en_distance(qmckl_context context, double* di
rc = qmckl_provide_en_distance(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num;
@ -1842,7 +1842,7 @@ qmckl_exit_code qmckl_provide_en_distance(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!(ctx->nucleus.provided)) {
@ -2097,7 +2097,7 @@ qmckl_exit_code qmckl_get_electron_en_distance_rescaled(qmckl_context context, d
rc = qmckl_provide_en_distance_rescaled(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num;
@ -2121,7 +2121,7 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!(ctx->nucleus.provided)) {
@ -2385,7 +2385,7 @@ qmckl_exit_code qmckl_get_electron_en_distance_rescaled_deriv_e(qmckl_context co
rc = qmckl_provide_en_distance_rescaled_deriv_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = 4 * ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num;
@ -2409,7 +2409,7 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled_deriv_e(qmckl_context context
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!(ctx->nucleus.provided)) {
@ -2656,7 +2656,7 @@ qmckl_exit_code qmckl_get_electron_en_potential(qmckl_context context, double* c
rc = qmckl_provide_en_potential(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.walk_num * sizeof(double);
@ -2680,7 +2680,7 @@ qmckl_exit_code qmckl_provide_en_potential(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->electron.provided) return QMCKL_NOT_PROVIDED;

View File

@ -239,7 +239,7 @@ for (text, code, message) in table:
message = message.replace("'",'"')
result += [ f"""case {text}:
return {message};
break;""" ]
""" ]
return '\n'.join(result)
#+end_src
@ -247,89 +247,91 @@ return '\n'.join(result)
#+RESULTS: cases
#+begin_example
case QMCKL_SUCCESS:
return "Success";
break;
return "Success";
case QMCKL_INVALID_ARG_1:
return "Invalid argument 1";
break;
return "Invalid argument 1";
case QMCKL_INVALID_ARG_2:
return "Invalid argument 2";
break;
return "Invalid argument 2";
case QMCKL_INVALID_ARG_3:
return "Invalid argument 3";
break;
return "Invalid argument 3";
case QMCKL_INVALID_ARG_4:
return "Invalid argument 4";
break;
return "Invalid argument 4";
case QMCKL_INVALID_ARG_5:
return "Invalid argument 5";
break;
return "Invalid argument 5";
case QMCKL_INVALID_ARG_6:
return "Invalid argument 6";
break;
return "Invalid argument 6";
case QMCKL_INVALID_ARG_7:
return "Invalid argument 7";
break;
return "Invalid argument 7";
case QMCKL_INVALID_ARG_8:
return "Invalid argument 8";
break;
return "Invalid argument 8";
case QMCKL_INVALID_ARG_9:
return "Invalid argument 9";
break;
return "Invalid argument 9";
case QMCKL_INVALID_ARG_10:
return "Invalid argument 10";
break;
return "Invalid argument 10";
case QMCKL_INVALID_ARG_11:
return "Invalid argument 11";
break;
return "Invalid argument 11";
case QMCKL_INVALID_ARG_12:
return "Invalid argument 12";
break;
return "Invalid argument 12";
case QMCKL_INVALID_ARG_13:
return "Invalid argument 13";
break;
return "Invalid argument 13";
case QMCKL_INVALID_ARG_14:
return "Invalid argument 14";
break;
return "Invalid argument 14";
case QMCKL_INVALID_ARG_15:
return "Invalid argument 15";
break;
return "Invalid argument 15";
case QMCKL_INVALID_ARG_16:
return "Invalid argument 16";
break;
return "Invalid argument 16";
case QMCKL_INVALID_ARG_17:
return "Invalid argument 17";
break;
return "Invalid argument 17";
case QMCKL_INVALID_ARG_18:
return "Invalid argument 18";
break;
return "Invalid argument 18";
case QMCKL_INVALID_ARG_19:
return "Invalid argument 19";
break;
return "Invalid argument 19";
case QMCKL_INVALID_ARG_20:
return "Invalid argument 20";
break;
return "Invalid argument 20";
case QMCKL_FAILURE:
return "Failure";
break;
return "Failure";
case QMCKL_ERRNO:
return strerror(errno);
break;
return strerror(errno);
case QMCKL_INVALID_CONTEXT:
return "Invalid context";
break;
return "Invalid context";
case QMCKL_ALLOCATION_FAILED:
return "Allocation failed";
break;
return "Allocation failed";
case QMCKL_DEALLOCATION_FAILED:
return "De-allocation failed";
break;
return "De-allocation failed";
case QMCKL_NOT_PROVIDED:
return "Not provided";
break;
return "Not provided";
case QMCKL_OUT_OF_BOUNDS:
return "Index out of bounds";
case QMCKL_INVALID_EXIT_CODE:
return "Invalid exit code";
break;
return "Invalid exit code";
#+end_example
# Source
@ -414,7 +416,7 @@ qmckl_set_error(qmckl_context context,
qmckl_lock(context);
{
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL); /* Impossible because the context is valid. */
ctx->error.exit_code = exit_code;
@ -460,7 +462,7 @@ qmckl_get_error(qmckl_context context,
qmckl_lock(context);
{
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL); /* Impossible because the context is valid. */
/* Turn off annoying GCC warning */

View File

@ -394,7 +394,7 @@ qmckl_exit_code qmckl_init_jastrow(qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
ctx->jastrow.uninitialized = (1 << 5) - 1;
@ -436,7 +436,7 @@ bool qmckl_jastrow_provided(const qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
return ctx->jastrow.provided;
@ -464,7 +464,7 @@ qmckl_exit_code qmckl_get_jastrow_aord_num (const qmckl_context context, int64_t
"aord_num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 0;
@ -491,7 +491,7 @@ qmckl_exit_code qmckl_get_jastrow_bord_num (const qmckl_context context, int64_t
"aord_num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 0;
@ -518,7 +518,7 @@ qmckl_exit_code qmckl_get_jastrow_cord_num (const qmckl_context context, int64_t
"aord_num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 0;
@ -545,7 +545,7 @@ qmckl_exit_code qmckl_get_jastrow_type_nucl_num (const qmckl_context context, in
"type_nucl_num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 1;
@ -576,7 +576,7 @@ qmckl_get_jastrow_type_nucl_vector (const qmckl_context context,
"type_nucl_vector is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 2;
@ -613,7 +613,7 @@ qmckl_get_jastrow_aord_vector (const qmckl_context context,
"aord_vector is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 3;
@ -650,7 +650,7 @@ qmckl_get_jastrow_bord_vector (const qmckl_context context,
"bord_vector is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 4;
@ -687,7 +687,7 @@ qmckl_get_jastrow_cord_vector (const qmckl_context context,
"cord_vector is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 5;
@ -735,7 +735,7 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
#+end_src
#+NAME:post2
@ -1080,7 +1080,7 @@ qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) {
return QMCKL_INVALID_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* ----------------------------------- */
@ -1330,7 +1330,7 @@ qmckl_get_jastrow_asymp_jasb(qmckl_context context,
rc = qmckl_provide_asymp_jasb(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = 2;
@ -1361,7 +1361,7 @@ qmckl_exit_code qmckl_provide_asymp_jasb(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if ee kappa is provided */
@ -1615,7 +1615,7 @@ qmckl_get_jastrow_factor_ee(qmckl_context context,
rc = qmckl_provide_factor_ee(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze=ctx->electron.walk_num;
@ -1646,7 +1646,7 @@ qmckl_exit_code qmckl_provide_factor_ee(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if ee rescaled distance is provided */
@ -1952,7 +1952,7 @@ qmckl_get_jastrow_factor_ee_deriv_e(qmckl_context context,
rc = qmckl_provide_factor_ee_deriv_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.walk_num * 4 * ctx->electron.num;
@ -1984,7 +1984,7 @@ qmckl_exit_code qmckl_provide_factor_ee_deriv_e(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if ee rescaled distance is provided */
@ -2380,7 +2380,7 @@ qmckl_get_jastrow_factor_en(qmckl_context context,
rc = qmckl_provide_factor_en(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze=ctx->electron.walk_num;
@ -2411,7 +2411,7 @@ qmckl_exit_code qmckl_provide_factor_en(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if en rescaled distance is provided */
@ -2723,7 +2723,7 @@ qmckl_get_jastrow_factor_en_deriv_e(qmckl_context context,
rc = qmckl_provide_factor_en_deriv_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.walk_num * 4 * ctx->electron.num;
@ -2754,7 +2754,7 @@ qmckl_exit_code qmckl_provide_factor_en_deriv_e(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if en rescaled distance is provided */
@ -3146,7 +3146,7 @@ qmckl_get_jastrow_een_rescaled_e(qmckl_context context,
rc = qmckl_provide_een_rescaled_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.num * ctx->electron.num * ctx->electron.walk_num * (ctx->jastrow.cord_num + 1);
@ -3176,7 +3176,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_e(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if ee distance is provided */
@ -3480,7 +3480,7 @@ qmckl_get_jastrow_een_rescaled_e_deriv_e(qmckl_context context,
rc = qmckl_provide_een_rescaled_e_deriv_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.num * 4 * ctx->electron.num * ctx->electron.walk_num * (ctx->jastrow.cord_num + 1);
@ -3510,7 +3510,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if ee distance is provided */
@ -3860,7 +3860,7 @@ qmckl_get_jastrow_een_rescaled_n(qmckl_context context,
rc = qmckl_provide_een_rescaled_n(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num * (ctx->jastrow.cord_num + 1);
@ -3890,7 +3890,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_n(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if ee distance is provided */
@ -4195,7 +4195,7 @@ qmckl_get_jastrow_een_rescaled_n_deriv_e(qmckl_context context,
rc = qmckl_provide_een_rescaled_n_deriv_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.num * 4 * ctx->nucleus.num * ctx->electron.walk_num * (ctx->jastrow.cord_num + 1);
@ -4225,7 +4225,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if ee distance is provided */
@ -4578,7 +4578,7 @@ qmckl_exit_code qmckl_get_jastrow_dim_cord_vect(qmckl_context context, int64_t*
rc = qmckl_provide_dim_cord_vect(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
*dim_cord_vect = ctx->jastrow.dim_cord_vect;
@ -4600,7 +4600,7 @@ qmckl_exit_code qmckl_get_jastrow_cord_vect_full(qmckl_context context, double*
rc = qmckl_provide_cord_vect_full(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->jastrow.dim_cord_vect * ctx->nucleus.num;
@ -4623,7 +4623,7 @@ qmckl_exit_code qmckl_get_jastrow_lkpm_combined_index(qmckl_context context, int
rc = qmckl_provide_cord_vect_full(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->jastrow.dim_cord_vect * 4;
@ -4649,7 +4649,7 @@ qmckl_exit_code qmckl_get_jastrow_tmp_c(qmckl_context context, double* const tmp
rc = qmckl_provide_tmp_c(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1)
@ -4676,7 +4676,7 @@ qmckl_exit_code qmckl_get_jastrow_dtmp_c(qmckl_context context, double* const dt
rc = qmckl_provide_dtmp_c(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1)
@ -4705,7 +4705,7 @@ qmckl_exit_code qmckl_provide_dim_cord_vect(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Compute if necessary */
@ -4732,7 +4732,7 @@ qmckl_exit_code qmckl_provide_cord_vect_full(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if dim_cord_vect is provided */
@ -4783,7 +4783,7 @@ qmckl_exit_code qmckl_provide_lkpm_combined_index(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if dim_cord_vect is provided */
@ -4831,7 +4831,7 @@ qmckl_exit_code qmckl_provide_tmp_c(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if dim_cord_vect is provided */
@ -4884,7 +4884,7 @@ qmckl_exit_code qmckl_provide_dtmp_c(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if dim_cord_vect is provided */
@ -5870,7 +5870,7 @@ qmckl_get_jastrow_factor_een(qmckl_context context,
rc = qmckl_provide_factor_een(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.walk_num;
@ -5901,7 +5901,7 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if en rescaled distance is provided */
@ -6371,7 +6371,7 @@ qmckl_get_jastrow_factor_een_deriv_e(qmckl_context context,
rc = qmckl_provide_factor_een_deriv_e(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t sze = ctx->electron.walk_num * 4 * ctx->electron.num;
@ -6402,7 +6402,7 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
/* Check if en rescaled distance is provided */

View File

@ -226,7 +226,7 @@ qmckl_exit_code qmckl_get_kinetic_energy(qmckl_context context, double * const k
rc = qmckl_provide_kinetic_energy(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.walk_num * sizeof(double);
@ -250,7 +250,7 @@ qmckl_exit_code qmckl_provide_kinetic_energy(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if(!(ctx->nucleus.provided)) {
@ -549,37 +549,28 @@ end function qmckl_compute_kinetic_energy_f
*** Test
#+begin_src c :tangle (eval c_test) :exports none
#define walk_num chbrclf_walk_num
#define elec_num chbrclf_elec_num
#define shell_num chbrclf_shell_num
#define ao_num chbrclf_ao_num
int64_t elec_up_num = chbrclf_elec_up_num;
int64_t elec_dn_num = chbrclf_elec_dn_num;
double* elec_coord = &(chbrclf_elec_coord[0][0][0]);
const int64_t nucl_num = chbrclf_nucl_num;
const double* nucl_charge = chbrclf_charge;
const double* nucl_coord = &(chbrclf_nucl_coord[0][0]);
rc = qmckl_set_electron_num (context, elec_up_num, elec_dn_num);
rc = qmckl_set_electron_num (context, chbrclf_elec_up_num, chbrclf_elec_dn_num);
assert (rc == QMCKL_SUCCESS);
rc = qmckl_set_electron_walk_num (context, walk_num);
rc = qmckl_set_electron_walk_num (context, chbrclf_walk_num);
assert (rc == QMCKL_SUCCESS);
assert(qmckl_electron_provided(context));
rc = qmckl_set_electron_coord (context, 'N', elec_coord, walk_num*elec_num*3);
rc = qmckl_set_electron_coord (context, 'N', elec_coord, chbrclf_walk_num*chbrclf_elec_num*3);
assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_nucleus_num (context, nucl_num);
rc = qmckl_set_nucleus_num (context, chbrclf_nucl_num);
assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]), nucl_num*3);
rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]), chbrclf_nucl_num*3);
assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_nucleus_charge(context, nucl_charge, nucl_num);
rc = qmckl_set_nucleus_charge(context, nucl_charge, chbrclf_nucl_num);
assert(rc == QMCKL_SUCCESS);
assert(qmckl_nucleus_provided(context));
@ -611,11 +602,11 @@ rc = qmckl_set_ao_basis_prim_num (context, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index, nucl_num);
rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index, chbrclf_nucl_num);
assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num, nucl_num);
rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num, chbrclf_nucl_num);
assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context));
@ -655,10 +646,10 @@ assert(rc == QMCKL_SUCCESS);
assert(qmckl_ao_basis_provided(context));
double ao_vgl[walk_num*elec_num][5][chbrclf_ao_num];
double ao_vgl[chbrclf_walk_num*chbrclf_elec_num][5][chbrclf_ao_num];
rc = qmckl_get_ao_basis_ao_vgl(context, &(ao_vgl[0][0][0]),
(int64_t) 5*walk_num*elec_num*chbrclf_ao_num);
(int64_t) 5*chbrclf_walk_num*chbrclf_elec_num*chbrclf_ao_num);
assert (rc == QMCKL_SUCCESS);
/* Set up MO data */
@ -673,31 +664,31 @@ assert (rc == QMCKL_SUCCESS);
assert(qmckl_mo_basis_provided(context));
double mo_vgl[walk_num*elec_num][5][chbrclf_mo_num];
rc = qmckl_get_mo_basis_mo_vgl(context, &(mo_vgl[0][0][0]), 5*walk_num*elec_num*chbrclf_mo_num);
double mo_vgl[chbrclf_walk_num*chbrclf_elec_num][5][chbrclf_mo_num];
rc = qmckl_get_mo_basis_mo_vgl(context, &(mo_vgl[0][0][0]), 5*chbrclf_walk_num*chbrclf_elec_num*chbrclf_mo_num);
assert (rc == QMCKL_SUCCESS);
/* Set up determinant data */
const int64_t det_num_alpha = 1;
const int64_t det_num_beta = 1;
int64_t mo_index_alpha[det_num_alpha][walk_num][elec_up_num];
int64_t mo_index_beta[det_num_alpha][walk_num][elec_dn_num];
#define det_num_alpha 1
#define det_num_beta 1
int64_t mo_index_alpha[det_num_alpha][chbrclf_walk_num][chbrclf_elec_up_num];
int64_t mo_index_beta[det_num_alpha][chbrclf_walk_num][chbrclf_elec_dn_num];
int i, j, k;
for(k = 0; k < det_num_alpha; ++k)
for(i = 0; i < walk_num; ++i)
for(j = 0; j < elec_up_num; ++j)
for(i = 0; i < chbrclf_walk_num; ++i)
for(j = 0; j < chbrclf_elec_up_num; ++j)
mo_index_alpha[k][i][j] = j + 1;
for(k = 0; k < det_num_beta; ++k)
for(i = 0; i < walk_num; ++i)
for(j = 0; j < elec_up_num; ++j)
for(i = 0; i < chbrclf_walk_num; ++i)
for(j = 0; j < chbrclf_elec_up_num; ++j)
mo_index_beta[k][i][j] = j + 1;
rc = qmckl_set_determinant_type (context, typ);
assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_determinant_walk_num (context, walk_num);
rc = qmckl_set_determinant_walk_num (context, chbrclf_walk_num);
assert (rc == QMCKL_SUCCESS);
rc = qmckl_set_determinant_det_num_alpha (context, det_num_alpha);
@ -714,8 +705,8 @@ assert (rc == QMCKL_SUCCESS);
// Get alpha determinant
double det_vgl_alpha[det_num_alpha][walk_num][5][elec_up_num][elec_up_num];
double det_vgl_beta[det_num_beta][walk_num][5][elec_dn_num][elec_dn_num];
double det_vgl_alpha[det_num_alpha][chbrclf_walk_num][5][chbrclf_elec_up_num][chbrclf_elec_up_num];
double det_vgl_beta[det_num_beta][chbrclf_walk_num][5][chbrclf_elec_dn_num][chbrclf_elec_dn_num];
rc = qmckl_get_det_vgl_alpha(context, &(det_vgl_alpha[0][0][0][0][0]));
assert (rc == QMCKL_SUCCESS);
@ -725,8 +716,8 @@ assert (rc == QMCKL_SUCCESS);
// Get adjoint of the slater-determinant
double det_inv_matrix_alpha[det_num_alpha][walk_num][elec_up_num][elec_up_num];
double det_inv_matrix_beta[det_num_beta][walk_num][elec_dn_num][elec_dn_num];
double det_inv_matrix_alpha[det_num_alpha][chbrclf_walk_num][chbrclf_elec_up_num][chbrclf_elec_up_num];
double det_inv_matrix_beta[det_num_beta][chbrclf_walk_num][chbrclf_elec_dn_num][chbrclf_elec_dn_num];
rc = qmckl_get_det_inv_matrix_alpha(context, &(det_inv_matrix_alpha[0][0][0][0]));
assert (rc == QMCKL_SUCCESS);
@ -736,7 +727,7 @@ assert (rc == QMCKL_SUCCESS);
// Calculate the Kinetic energy
double kinetic_energy[walk_num];
double kinetic_energy[chbrclf_walk_num];
rc = qmckl_get_kinetic_energy(context, &(kinetic_energy[0]));
assert (rc == QMCKL_SUCCESS);
@ -799,7 +790,7 @@ qmckl_exit_code qmckl_get_potential_energy(qmckl_context context, double * const
rc = qmckl_provide_potential_energy(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.walk_num * sizeof(double);
@ -822,7 +813,7 @@ qmckl_exit_code qmckl_provide_potential_energy(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
qmckl_exit_code rc;
@ -1034,7 +1025,7 @@ end function qmckl_compute_potential_energy_f
#+begin_src c :tangle (eval c_test) :exports none
// Calculate the Potential energy
double potential_energy[walk_num];
double potential_energy[chbrclf_walk_num];
rc = qmckl_get_potential_energy(context, &(potential_energy[0]));
assert (rc == QMCKL_SUCCESS);
@ -1083,7 +1074,7 @@ qmckl_exit_code qmckl_get_local_energy(qmckl_context context, double * const loc
rc = qmckl_provide_local_energy(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.walk_num * sizeof(double);
@ -1106,7 +1097,7 @@ qmckl_exit_code qmckl_provide_local_energy(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if(!(ctx->nucleus.provided)) {
@ -1290,7 +1281,7 @@ end function qmckl_compute_local_energy_f
#+begin_src c :tangle (eval c_test) :exports none
// Calculate the Local energy
double local_energy[walk_num];
double local_energy[chbrclf_walk_num];
rc = qmckl_get_local_energy(context, &(local_energy[0]));
assert (rc == QMCKL_SUCCESS);
@ -1339,7 +1330,7 @@ qmckl_exit_code qmckl_get_drift_vector(qmckl_context context, double * const dri
rc = qmckl_provide_drift_vector(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
size_t sze = ctx->electron.walk_num * ctx->electron.num * 3 * sizeof(double);
@ -1362,7 +1353,7 @@ qmckl_exit_code qmckl_provide_drift_vector(qmckl_context context) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if(!(ctx->nucleus.provided)) {
@ -1645,7 +1636,7 @@ end function qmckl_compute_drift_vector_f
#+begin_src c :tangle (eval c_test) :exports none
// Calculate the Drift vector
double drift_vector[walk_num][elec_num][3];
double drift_vector[chbrclf_walk_num][chbrclf_elec_num][3];
rc = qmckl_get_drift_vector(context, &(drift_vector[0][0][0]));
assert (rc == QMCKL_SUCCESS);

View File

@ -116,7 +116,7 @@ void* qmckl_malloc(qmckl_context context, const qmckl_memory_info_struct info) {
assert (qmckl_context_check(context) != QMCKL_NULL_CONTEXT);
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
/* Allocate memory and zero it */
void * pointer = malloc(info.size);
@ -217,7 +217,7 @@ qmckl_exit_code qmckl_free(qmckl_context context, void * const ptr) {
"NULL pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
qmckl_lock(context);
{

View File

@ -131,7 +131,7 @@ qmckl_exit_code qmckl_init_mo_basis(qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
ctx->mo_basis.uninitialized = (1 << 2) - 1;
@ -158,10 +158,9 @@ qmckl_get_mo_basis_mo_num (const qmckl_context context,
QMCKL_INVALID_CONTEXT,
"qmckl_get_mo_basis_mo_num",
NULL);
return (int64_t) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1;
@ -200,7 +199,7 @@ qmckl_get_mo_basis_coefficient (const qmckl_context context,
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 1;
@ -248,7 +247,7 @@ bool qmckl_mo_basis_provided(const qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
return ctx->mo_basis.provided;
@ -273,7 +272,7 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
#+end_src
#+NAME:post
@ -354,7 +353,7 @@ qmckl_exit_code qmckl_finalize_mo_basis(qmckl_context context) {
NULL);
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
@ -422,7 +421,7 @@ qmckl_get_mo_basis_mo_vgl(qmckl_context context,
rc = qmckl_provide_mo_vgl(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
const int64_t sze = ctx->point.num * 5 * ctx->mo_basis.mo_num;
@ -478,7 +477,7 @@ qmckl_get_mo_basis_mo_vgl_inplace (qmckl_context context,
qmckl_exit_code rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
const int64_t sze = ctx->mo_basis.mo_num * 5 * ctx->point.num;
@ -534,7 +533,7 @@ qmckl_exit_code qmckl_provide_mo_vgl(qmckl_context context)
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->ao_basis.provided) {

View File

@ -125,7 +125,7 @@ qmckl_exit_code qmckl_init_nucleus(qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
ctx->nucleus.uninitialized = (1 << 3) - 1;
@ -167,7 +167,7 @@ qmckl_get_nucleus_num (const qmckl_context context, int64_t* const num) {
"num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 0;
@ -226,7 +226,7 @@ qmckl_get_nucleus_charge (const qmckl_context context,
"charge is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 1;
@ -293,7 +293,7 @@ qmckl_get_nucleus_rescale_factor (const qmckl_context context,
"rescale_factor_kappa is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
assert (ctx->nucleus.rescale_factor_kappa > 0.0);
@ -351,7 +351,7 @@ qmckl_get_nucleus_coord (const qmckl_context context,
"coord is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int32_t mask = 1 << 2;
@ -410,7 +410,7 @@ bool qmckl_nucleus_provided(const qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
return ctx->nucleus.provided;
@ -425,7 +425,7 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
return QMCKL_NULL_CONTEXT;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
#+end_src
#+NAME:post2
@ -783,7 +783,7 @@ qmckl_get_nucleus_nn_distance(qmckl_context context,
qmckl_exit_code rc = qmckl_provide_nn_distance(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
const int64_t sze = ctx->nucleus.num * ctx->nucleus.num;
@ -827,7 +827,7 @@ qmckl_exit_code qmckl_provide_nn_distance(qmckl_context context)
return (char) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->nucleus.provided) return QMCKL_NOT_PROVIDED;
@ -972,7 +972,7 @@ qmckl_get_nucleus_nn_distance_rescaled(qmckl_context context,
qmckl_exit_code rc = qmckl_provide_nn_distance_rescaled(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
const int64_t sze = ctx->nucleus.num * ctx->nucleus.num;
@ -1018,7 +1018,7 @@ qmckl_exit_code qmckl_provide_nn_distance_rescaled(qmckl_context context)
return (char) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
if (!ctx->nucleus.provided) return QMCKL_NOT_PROVIDED;
@ -1166,7 +1166,7 @@ qmckl_exit_code qmckl_get_nucleus_repulsion(qmckl_context context, double* const
qmckl_exit_code rc = qmckl_provide_nucleus_repulsion(context);
if (rc != QMCKL_SUCCESS) return rc;
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
*energy = ctx->nucleus.repulsion;
@ -1202,7 +1202,7 @@ qmckl_exit_code qmckl_provide_nucleus_repulsion(qmckl_context context)
return (char) 0;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
qmckl_exit_code rc;

View File

@ -141,7 +141,7 @@ qmckl_exit_code qmckl_set_numprec_precision(const qmckl_context context, const i
"precision > 53");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
/* This should be always true because the context is valid */
assert (ctx != NULL);
@ -185,7 +185,7 @@ int qmckl_get_numprec_precision(const qmckl_context context) {
"");
}
const qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
const qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
return ctx->numprec.precision;
}
#+end_src
@ -232,7 +232,7 @@ qmckl_exit_code qmckl_set_numprec_range(const qmckl_context context, const int r
"range > 11");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
/* This should be always true because the context is valid */
assert (ctx != NULL);
@ -275,7 +275,7 @@ int qmckl_get_numprec_range(const qmckl_context context) {
"");
}
const qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
const qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
return ctx->numprec.range;
}
#+end_src

View File

@ -108,7 +108,7 @@ qmckl_exit_code qmckl_init_point(qmckl_context context) {
return false;
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
memset(&(ctx->point), 0, sizeof(qmckl_point_struct));
@ -148,7 +148,7 @@ qmckl_get_point_num (const qmckl_context context, int64_t* const num) {
"num is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
assert (ctx->point.num >= (int64_t) 0);
@ -202,7 +202,7 @@ qmckl_get_point(const qmckl_context context,
"coord is a null pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
int64_t point_num = ctx->point.num;
@ -295,7 +295,7 @@ qmckl_set_point (qmckl_context context,
"coord is a NULL pointer");
}
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL);
qmckl_exit_code rc;