1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-23 04:44:03 +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; 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 #+end_src
#+NAME:post #+NAME:post
@ -320,6 +327,9 @@ return QMCKL_SUCCESS;
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none #+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) { qmckl_exit_code qmckl_set_mo_basis_mo_num(qmckl_context context, const int64_t mo_num) {
int32_t mask = 1 ;
<<pre>> <<pre>>
if (mo_num <= 0) { 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"); "mo_num <= 0");
} }
int32_t mask = 1 ;
ctx->mo_basis.mo_num = mo_num; ctx->mo_basis.mo_num = mo_num;
<<post>> <<post>>
} }
qmckl_exit_code qmckl_set_mo_basis_coefficient(qmckl_context context, const double* coefficient) { qmckl_exit_code qmckl_set_mo_basis_coefficient(qmckl_context context, const double* coefficient) {
<<pre>>
int32_t mask = 1 << 1; int32_t mask = 1 << 1;
<<pre>>
if (ctx->mo_basis.coefficient != NULL) { if (ctx->mo_basis.coefficient != NULL) {
qmckl_exit_code rc = qmckl_free(context, ctx->mo_basis.coefficient); qmckl_exit_code rc = qmckl_free(context, ctx->mo_basis.coefficient);
if (rc != QMCKL_SUCCESS) { if (rc != QMCKL_SUCCESS) {