Skip to content

Commit

Permalink
Fix bug in boundary check for CIntOpt
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Dec 6, 2022
1 parent 9105ce5 commit 317df07
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.5)
project (qcint C)
set(qcint_VERSION_MAJOR "5")
set(qcint_VERSION_MINOR "1")
set(qcint_VERSION_PATCH "6")
set(qcint_VERSION_PATCH "7")
set(qcint_VERSION_TWEAK "0")
set(qcint_VERSION "${qcint_VERSION_MAJOR}.${qcint_VERSION_MINOR}.${qcint_VERSION_PATCH}")
set(qcint_SOVERSION "${qcint_VERSION_MAJOR}")
Expand Down
2 changes: 1 addition & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version 5.1.6 (2022-12-05):
Version 5.1.7 (2022-12-06):
* Boundary check when initializing CINTOpt

Version 5.1.5 (2022-08-24):
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ qcint (quick libcint)

An optimized libcint branch for X86 platform

version 5.1.6
2022-12-05
version 5.1.7
2022-12-06


What is qcint
Expand Down
10 changes: 4 additions & 6 deletions src/optimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,14 @@ static int *_allocate_index_xyz(CINTOpt *opt, int max_l, int order)
return buf;
}
static void gen_idx(CINTOpt *opt, void (*finit)(), void (*findex_xyz)(),
int order, int max_l, int *ng,
int order, int l_allow, int *ng,
int *atm, int natm, int *bas, int nbas, double *env)
{
int i, j, k, l, ptr;
int fakebas[BAS_SLOTS*LMAX1];
int max_l1 = _make_fakebas(fakebas, bas, nbas, env);
if (max_l == 0) {
max_l = max_l1;
} else {
assert(max_l1 < max_l);
int max_l = _make_fakebas(fakebas, bas, nbas, env);
if (l_allow != 0) {
assert(max_l < l_allow);
}
int fakenbas = max_l+1;
int *buf = _allocate_index_xyz(opt, max_l, order);
Expand Down

0 comments on commit 317df07

Please sign in to comment.