Skip to content

Commit

Permalink
Uninitialized intor in VHFOpt object
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Sep 10, 2023
1 parent fa74064 commit ed48497
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions pyscf/scf/_vhf.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,15 @@ def direct_mapdm(intor, aosym, jkdescript,
njk = len(jkdescripts)

if vhfopt is None:
cintor = _fpointer(intor)
cvhfopt = lib.c_null_ptr()
else:
vhfopt.set_dm(dms, atm, bas, env)
cvhfopt = vhfopt._this
cintopt = vhfopt._cintopt
if vhfopt is None or vhfopt._intor is None:
cintor = _fpointer(intor)
else:
cintor = getattr(libcvhf, vhfopt._intor)
cintopt = vhfopt._cintopt
if cintopt is None:
cintopt = make_cintopt(c_atm, c_bas, c_env, intor)

Expand Down Expand Up @@ -497,13 +499,15 @@ def direct_bindm(intor, aosym, jkdescript,
assert (njk == n_dm)

if vhfopt is None:
cintor = _fpointer(intor)
cvhfopt = lib.c_null_ptr()
else:
vhfopt.set_dm(dms, atm, bas, env)
cvhfopt = vhfopt._this
cintopt = vhfopt._cintopt
if vhfopt is None or vhfopt._intor is None:
cintor = _fpointer(intor)
else:
cintor = getattr(libcvhf, vhfopt._intor)
cintopt = vhfopt._cintopt
if cintopt is None:
cintopt = make_cintopt(c_atm, c_bas, c_env, intor)

Expand Down Expand Up @@ -588,13 +592,15 @@ def rdirect_mapdm(intor, aosym, jkdescript,
njk = len(jkdescript)

if vhfopt is None:
cintor = _fpointer(intor)
cvhfopt = lib.c_null_ptr()
else:
vhfopt.set_dm(dms, atm, bas, env)
cvhfopt = vhfopt._this
cintopt = vhfopt._cintopt
if vhfopt is None or vhfopt._intor is None:
cintor = _fpointer(intor)
else:
cintor = getattr(libcvhf, vhfopt._intor)
cintopt = vhfopt._cintopt
if cintopt is None:
cintopt = make_cintopt(c_atm, c_bas, c_env, intor)

Expand Down Expand Up @@ -660,13 +666,15 @@ def rdirect_bindm(intor, aosym, jkdescript,
assert njk == n_dm or njk*4 == n_dm*3

if vhfopt is None:
cintor = _fpointer(intor)
cvhfopt = lib.c_null_ptr()
else:
vhfopt.set_dm(dms, atm, bas, env)
cvhfopt = vhfopt._this
cintopt = vhfopt._cintopt
if vhfopt is None or vhfopt._intor is None:
cintor = _fpointer(intor)
else:
cintor = getattr(libcvhf, vhfopt._intor)
cintopt = vhfopt._cintopt
if cintopt is None:
cintopt = make_cintopt(c_atm, c_bas, c_env, intor)

Expand Down

0 comments on commit ed48497

Please sign in to comment.