3
\brief Enter brief description of file here
7
#include <libiwl/iwl.h>
8
#include <libdpd/dpd.h>
13
void idx_error(const char *message, int p, int q, int r, int s, int pq, int rs,
14
int pq_sym, int rs_sym, FILE *outfile);
15
void idx_permute_presort(dpdfile4 *File, int this_bucket, int **bucket_map,
16
int **bucket_offset, int p, int q, int r, int s,
17
double value, FILE *outfile)
19
int p_sym, q_sym, r_sym, s_sym;
20
int pq_sym, rs_sym, rq_sym, ps_sym, qp_sym, sp_sym, sr_sym, qr_sym;
21
int pq, rs, rq, ps, qp, sr, qr, sp;
26
Params = File->params;
27
perm_pq = Params->perm_pq;
28
perm_rs = Params->perm_rs;
30
/* Get the orbital symmetries */
31
p_sym = Params->psym[p]; q_sym = Params->qsym[q];
32
r_sym = Params->rsym[r]; s_sym = Params->ssym[s];
36
/* The allowed (Mulliken) permutations are very simple in this case */
38
if(bucket_map[p][q] == this_bucket) {
40
/* Get the row and column indices and assign the value */
41
pq = Params->rowidx[p][q];
42
rs = Params->colidx[r][s];
43
if((pq >= Params->rowtot[pq_sym]) || (rs >= Params->coltot[rs_sym]))
44
idx_error("MP Params_make: pq, rs", p,q,r,s,pq,rs,pq_sym,rs_sym,outfile);
46
offset = bucket_offset[this_bucket][pq_sym];
47
File->matrix[pq_sym][pq-offset][rs] = value;
50
if(bucket_map[r][s] == this_bucket) {
52
rs = Params->rowidx[r][s];
53
pq = Params->colidx[p][q];
54
if((rs >= Params->rowtot[rs_sym])||(pq >= Params->coltot[pq_sym]))
55
idx_error("MP Params_make: rs, pq", p,q,r,s,rs,pq,rs_sym,pq_sym,
58
offset = bucket_offset[this_bucket][rs_sym];
59
File->matrix[rs_sym][rs-offset][pq] = value;
63
} // namespace transqt2