8#define GRID_DO_COLLOCATE 1
10#include "../common/grid_common.h"
20 const bool orthorhombic,
const int border_mask,
const enum grid_func func,
21 const int la_max,
const int la_min,
const int lb_max,
const int lb_min,
22 const double zeta,
const double zetb,
const double rscale,
23 const double dh[3][3],
const double dh_inv[3][3],
const double ra[3],
24 const double rab[3],
const int npts_global[3],
const int npts_local[3],
25 const int shift_local[3],
const int border_width[3],
const double radius,
26 const int o1,
const int o2,
const int n1,
const int n2,
27 const double pab[n2][n1],
double *
grid) {
29 int la_min_diff, la_max_diff, lb_min_diff, lb_max_diff;
33 const int la_min_cab =
imax(la_min + la_min_diff, 0);
34 const int lb_min_cab =
imax(lb_min + lb_min_diff, 0);
35 const int la_max_cab = la_max + la_max_diff;
36 const int lb_max_cab = lb_max + lb_max_diff;
37 const int n1_cab = ncoset(la_max_cab);
38 const int n2_cab = ncoset(lb_max_cab);
40 const size_t cab_size = n2_cab * n1_cab;
42 memset(cab, 0, cab_size *
sizeof(
double));
45 n1, n2, pab, n1_cab, n2_cab, (
double(*)[n1_cab])cab);
46 cab_to_grid(orthorhombic, border_mask, la_max_cab, la_min_cab, lb_max_cab,
47 lb_min_cab, zeta, zetb, rscale, dh, dh_inv, ra, rab, npts_global,
static int imax(int x, int y)
Returns the larger of two given integers (missing from the C standard)
static void const int const int const int const int const int const double const int const int const int int GRID_CONST_WHEN_COLLOCATE double GRID_CONST_WHEN_INTEGRATE double * grid
static void const int const int const int const int const int const double const int const int const int npts_local[3]
static void cab_to_grid(const bool orthorhombic, const int border_mask, const int la_max, const int la_min, const int lb_max, const int lb_min, const double zeta, const double zetb, const double rscale, const double dh[3][3], const double dh_inv[3][3], const double ra[3], const double rab[3], const int npts_global[3], const int npts_local[3], const int shift_local[3], const int border_width[3], const double radius, GRID_CONST_WHEN_COLLOCATE double *cab, GRID_CONST_WHEN_INTEGRATE double *grid)
Collocates coefficients C_ab onto the grid.
void grid_ref_collocate_pgf_product(const bool orthorhombic, const int border_mask, const enum grid_func func, const int la_max, const int la_min, const int lb_max, const int lb_min, const double zeta, const double zetb, const double rscale, const double dh[3][3], const double dh_inv[3][3], const double ra[3], const double rab[3], const int npts_global[3], const int npts_local[3], const int shift_local[3], const int border_width[3], const double radius, const int o1, const int o2, const int n1, const int n2, const double pab[n2][n1], double *grid)
Collocates a single product of primitiv Gaussians. See grid_ref_collocate.h for details.
void grid_ref_prepare_pab(const enum grid_func func, const int o1, const int o2, const int la_max, const int la_min, const int lb_max, const int lb_min, const double zeta, const double zetb, const int n1, const int n2, const double pab[n2][n1], const int n1_prep, const int n2_prep, double pab_prep[n2_prep][n1_prep])
Selects and transforms a sub-block of the given density matrix block. See grid_ref_prepare_pab....
void grid_ref_prepare_get_ldiffs(const enum grid_func func, int *la_min_diff, int *la_max_diff, int *lb_min_diff, int *lb_max_diff)
Returns block size changes due to transformation grid_prepare_pab.