28 #ifndef _chemistry_qc_basis_gpetite_h
29 #define _chemistry_qc_basis_gpetite_h
38 #include <util/misc/scint.h>
39 #include <chemistry/qc/basis/basis.h>
40 #include <chemistry/qc/basis/petite.h>
55 sc_int_least64_t offset(
int i,
int j,
int k,
int l) {
56 long ij = (i>j?(((i*long(i+1))>>1)+j):(((j*
long(j+1))>>1)+i));
57 long kl = (k>l?(((k*long(k+1))>>1)+l):(((l*
long(l+1))>>1)+k));
59 off = (ij>kl?(((ij*sc_int_least64_t(ij+1))>>1)+kl)
60 :(((kl*sc_int_least64_t(kl+1))>>1)+ij));
77 sc_int_least64_t offset(
int i,
int j,
int k,
int l) {
78 long ij = (i>j?(((i*long(i+1))>>1)+j):(((j*
long(j+1))>>1)+i));
79 return k + nk_*sc_int_least64_t(l + nl_*ij);
95 sc_int_least64_t offset(
int i,
int j,
int k,
int l) {
96 long ij = (i>j?(((i*long(i+1))>>1)+j):(((j*
long(j+1))>>1)+i));
97 long kl = (k>l?(((k*long(k+1))>>1)+l):(((l*
long(l+1))>>1)+k));
98 return ij + nij_*sc_int_least64_t(kl);
113 sc_int_least64_t offset(
int i,
int j,
int k,
int l) {
114 return (i + ni_*sc_int_least64_t(j + nj_*
long(k + nk_*l)));
135 virtual int in_p4(
int i,
int j,
int k,
int l) = 0;
162 int in_p4(
int i,
int j,
int k,
int l);
171 sc_int_least64_t ijkl = c_.offset(i,j,k,l);
174 for (
int g=1; g < ng_; g++) {
175 int gi = shell_map_i_[i][g];
176 int gj = shell_map_j_[j][g];
177 int gk = shell_map_k_[k][g];
178 int gl = shell_map_l_[l][g];
179 sc_int_least64_t gijkl = c_.offset(gi,gj,gk,gl);
181 if (gijkl > ijkl)
return 0;
182 else if (gijkl == ijkl) nijkl++;