1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 12:23:56 +01:00

mask in MOs

This commit is contained in:
Anthony Scemama 2022-07-09 11:17:52 +02:00
parent 6ba83ee33f
commit 21a9d6c51e

View File

@ -305,6 +305,13 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
}
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
if (!(ctx->mo_basis.uninitialized & mask)) {
return qmckl_failwith( context,
QMCKL_ALREADY_SET,
"qmckl_set_mo_*",
NULL);
}
#+end_src
#+NAME:post
@ -320,6 +327,9 @@ return QMCKL_SUCCESS;
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
qmckl_exit_code qmckl_set_mo_basis_mo_num(qmckl_context context, const int64_t mo_num) {
int32_t mask = 1 ;
<<pre>>
if (mo_num <= 0) {
@ -329,17 +339,17 @@ qmckl_exit_code qmckl_set_mo_basis_mo_num(qmckl_context context, const int64_t m
"mo_num <= 0");
}
int32_t mask = 1 ;
ctx->mo_basis.mo_num = mo_num;
<<post>>
}
qmckl_exit_code qmckl_set_mo_basis_coefficient(qmckl_context context, const double* coefficient) {
<<pre>>
int32_t mask = 1 << 1;
<<pre>>
if (ctx->mo_basis.coefficient != NULL) {
qmckl_exit_code rc = qmckl_free(context, ctx->mo_basis.coefficient);
if (rc != QMCKL_SUCCESS) {