Psi4
iwl.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 /*
29 ** IWL.H
30 ** Header file for Integrals With Labels Library
31 **
32 ** David Sherrill
33 ** Center for Computational Quantum Chemistry, UGA
34 **
35 */
36 
37 #ifndef _psi_src_lib_libiwl_iwl_h_
38 #define _psi_src_lib_libiwl_iwl_h_
39 
40 #include <cstdio>
41 #include "psi4/libpsio/psio.h"
42 #include "config.h"
43 #include "psi4/psi4-dec.h"
44 namespace psi {
45 
46 struct iwlbuf {
47  int itap; /* tape number for input file */
48  psio_address bufpos; /* current page/offset */
49  int ints_per_buf; /* integrals per buffer */
50  int bufszc; /* buffer size in characters (bytes) */
51  double cutoff; /* cutoff value for writing */
52  int lastbuf; /* is this the last IWL buffer? 1=yes,0=no */
53  int inbuf; /* how many ints in current buffer? */
54  int idx; /* index of integral in current buffer */
55  Label *labels; /* pointer to where integral values begin */
56  Value *values; /* integral values */
57 };
58 
59 
60 void iwl_buf_fetch(struct iwlbuf *Buf);
61 void iwl_buf_put(struct iwlbuf *Buf);
62 
63 int iwl_rdone(int itap, const char *label, double *ints, int ntri, int erase,
64  int printflg, std::string out);
65 
66 void iwl_wrtone(int itap, const char *label, int ntri, double *onel_ints);
67 
68 void iwl_rdtwo(int itap, double *ints, int *ioff, int norbs,
69  int nfzc, int nfzv, int printflg, std::string out);
70 void iwl_wrttwo(int itap, int nbfso, double *ints, int *ioff,
71  double toler, int printflg, std::string out);
72 void sortbuf(struct iwlbuf *inbuf, struct iwlbuf *outbuf,
73  double *ints, int fpq, int lpq, int *ioff, int *ioff2,
74  int nbfso, int elbert, int intermediate, int no_pq_perm,
75  int qdim, int add, int printflg, std::string out);
76 void sortbuf_pk(struct iwlbuf *Inbuf, int out_tape, int is_exch,
77  double *ints, unsigned int fpq, unsigned int lpq, int *so2ind, int *so2sym, int *pksymoff,
78  int printflg, std::string out);
79 void iwl_buf_init(struct iwlbuf *Buf, int intape, double cutoff,
80  int oldfile, int readflag);
81 int iwl_buf_rd(struct iwlbuf *Buf, int target_pq, double *ints,
82  int *ioff_lt, int *ioff_rt, int mp2, int printflg, std::string out);
83 int iwl_buf_rd_all(struct iwlbuf *Buf, double *ints,
84  int *ioff_lt, int *ioff_rt, int mp2, int *ioff,
85  int printflg, std::string out);
86 int iwl_buf_rd_all2(struct iwlbuf *Buf, double **ints,
87  int *ioff_lt, int *ioff_rt, int no_pq_perm, int *ioff,
88  int printflg, std::string out);
89 int iwl_buf_rd_all_act(struct iwlbuf *Buf, double *ints,
90  int *ioff_lt, int *ioff_rt, int mp2, int *ioff,
91  int fstact, int lstact, int printflg, std::string out);
92 int iwl_buf_rd_all_mp2r12a(struct iwlbuf *Buf, double *ints,
93  int *ioff_lt, int *ioff_rt, int bra_ket_symm, int *ioff,
94  int printflg, std::string out);
95 void iwl_buf_wrt_all(struct iwlbuf *Buf, int nbfso, double *ints,
96  int *ioff, int printflg, std::string out);
97 void iwl_buf_wrt(struct iwlbuf *Buf, int p, int q, int pq, int pqsym,
98  double *arr, int rmax, int *ioff, int *orbsym, int *firsti,
99  int *lasti, int printflag, std::string out);
100 void iwl_buf_wrt_mp2(struct iwlbuf *Buf, int p, int q, int pq,
101  int pqsym, double **arr, int rsym, int *firstr, int *lastr,
102  int *firsts, int *lasts, int *occ, int *vir, int *ioff,
103  int printflag, std::string out);
104 void iwl_buf_wrt_mp2r12a(struct iwlbuf *Buf, int p, int q, int pq,
105  int pqsym, double **arr, int rsym, int *firstr, int *lastr,
106  int *firsts, int *lasts, int *occ, int bra_ket_symm, int *ioff,
107  int printflag, std::string out);
108 void iwl_buf_flush(struct iwlbuf *Buf, int lastbuf);
109 void iwl_buf_close(struct iwlbuf *Buf, int keep);
110 //void iwl_buf_toend(struct iwlbuf *Buf);
111 void iwl_buf_wrt_arr(struct iwlbuf *Buf, double *arr, int *p, int *q,
112  int *r, int *s, long int size);
113 void iwl_buf_wrt_arr_SI(struct iwlbuf *Buf, double *arr,
114  short int *p, short int *q, short int *r, short int *s, int size);
115 void iwl_buf_wrt_arr_SI_nocut(struct iwlbuf *Buf, double *arr,
116  short int *p, short int *q, short int *r, short int *s, int size);
117 int iwl_buf_rd_arr(struct iwlbuf *Buf, int target_pq, double *ints,
118  int *rlist, int *slist, int *size, int *ioff,
119  int printflg, std::string out);
120 int iwl_buf_rd_arr2(struct iwlbuf *Buf, double *ints, int *plist,
121  int *qlist, int *rlist, int *slist, int *size, int *ioff,
122  int printflg, std::string out);
123 void iwl_buf_wrt_arr2(struct iwlbuf *Buf, double *arr, int p, int q,
124  int *rlist, int *slist, int size, int printflag, std::string out);
125 void iwl_buf_wrt_mat(struct iwlbuf *Buf, int ptr, int qtr,
126  double **mat, int rfirst, int rlast, int sfirst, int slast,
127  int *reorder, int reorder_offset, int printflag, int *ioff,
128  std::string out);
129 void iwl_buf_wrt_mat2(struct iwlbuf *Buf, int ptr, int qtr,
130  double **mat, int rfirst, int rlast, int sfirst, int slast,
131  int *reorder, int reorder_offset, int printflag, int *ioff,
132  std::string out);
133 void iwl_buf_wrt_val(struct iwlbuf *Buf, int p, int q, int r, int s,
134  double value, int printflag, std::string out, int dirac);
135 void iwl_buf_wrt_val_SI(struct iwlbuf *Buf, short int p, short int q,
136  short int r, short int s, double value, int printflag,
137  std::string out, int dirac);
138 
139 }
140 
141 #endif /* end _psi_src_lib_libiwl_iwl_h */
void iwl_buf_put(struct iwlbuf *Buf)
Definition: buf_put.cc:58
void iwl_buf_wrt(struct iwlbuf *Buf, int p, int q, int pq, int pqsym, double *arr, int rmax, int *ioff, int *orbsym, int *firsti, int *lasti, int printflag, std::string out)
Definition: buf_wrt.cc:101
void iwl_rdtwo(int itap, double *ints, int *ioff, int norbs, int nfzc, int nfzv, int printflg, std::string out)
Definition: rdtwo.cc:71
Label * labels
Definition: iwl.h:55
int iwl_buf_rd_all_mp2r12a(struct iwlbuf *Buf, double *ints, int *ioff_lt, int *ioff_rt, int bra_ket_symm, int *, int printflg, std::string out)
Definition: buf_rd_all_mp2r12a.cc:143
void iwl_buf_wrt_mp2(struct iwlbuf *Buf, int p, int q, int pq, int pqsym, double **arr, int rsym, int *firstr, int *lastr, int *firsts, int *lasts, int *occ, int *vir, int *ioff, int printflag, std::string out)
Definition: buf_wrt_mp2.cc:111
void iwl_buf_flush(struct iwlbuf *Buf, int lastbuf)
Definition: buf_flush.cc:78
double dirac(double x,...)
dirac(...) = 0.0 for all x
Definition: utility.h:41
Definition: iwl.h:46
short int Label
Definition: libiwl/config.h:33
double cutoff
Definition: iwl.h:51
void iwl_wrtone(int itap, const char *label, int ntri, double *onel_ints)
Definition: wrtone.cc:60
void iwl_buf_wrt_val(struct iwlbuf *Buf, int p, int q, int r, int s, double value, int printflag, std::string out, int dirac)
Definition: buf_wrt_val.cc:107
int iwl_buf_rd_all(struct iwlbuf *Buf, double *ints, int *ioff_lt, int *ioff_rt, int no_pq_perm, int *ioff, int printflg, std::string out)
Definition: buf_rd_all.cc:210
int ints_per_buf
Definition: iwl.h:49
void iwl_buf_close(struct iwlbuf *Buf, int keep)
Definition: buf_close.cc:68
void iwl_buf_wrt_arr(struct iwlbuf *Buf, double *arr, int *p, int *q, int *r, int *s, long int size)
Definition: buf_wrt_arr.cc:95
void sortbuf_pk(struct iwlbuf *Inbuf, int out_tape, int is_exch, double *ints, unsigned int fpq, unsigned int lpq, int *so2ind, int *so2sym, int *pksymoff, int printflg, std::string out)
Definition: sortbuf.cc:709
Definition: libpsio/config.h:64
void iwl_buf_wrt_mat(struct iwlbuf *Buf, int ptr, int qtr, double **mat, int rfirst, int rlast, int sfirst, int slast, int *reorder, int reorder_offset, int printflag, int *ioff, std::string out)
Definition: buf_wrt_mat.cc:177
void iwl_buf_init(struct iwlbuf *Buf, int itape, double cutoff, int oldfile, int readflag)
Definition: buf_init.cc:113
int iwl_buf_rd_all2(struct iwlbuf *Buf, double **ints, int *ioff_lt, int *ioff_rt, int no_pq_perm, int *, int printflg, std::string out)
Definition: buf_rd_all.cc:300
int iwl_rdone(int itap, const char *label, double *ints, int ntri, int erase, int printflg, std::string out)
Definition: rdone.cc:81
int bufszc
Definition: iwl.h:50
psio_address bufpos
Definition: iwl.h:48
void iwl_buf_wrt_val_SI(struct iwlbuf *Buf, short int p, short int q, short int r, short int s, double value, int printflag, std::string out, int dirac)
Definition: buf_wrt_val_SI.cc:110
void iwl_buf_wrt_mat2(struct iwlbuf *Buf, int ptr, int qtr, double **mat, int rfirst, int rlast, int sfirst, int slast, int *reorder, int reorder_offset, int printflag, int *ioff, std::string out)
Definition: buf_wrt_mat.cc:240
int idx
Definition: iwl.h:54
int iwl_buf_rd_arr2(struct iwlbuf *Buf, double *ints, int *plist, int *qlist, int *rlist, int *slist, int *size, int *ioff, int printflg, std::string out)
Definition: buf_rd_arr2.cc:126
int iwl_buf_rd(struct iwlbuf *Buf, int target_pq, double *ints, int *ioff_lt, int *ioff_rt, int mp2, int printflg, std::string out)
Definition: buf_rd.cc:140
int iwl_buf_rd_all_act(struct iwlbuf *Buf, double *ints, int *ioff_lt, int *ioff_rt, int no_pq_perm, int *ioff, int fstact, int lstact, int printflg, std::string out)
Definition: buf_rd_all_act.cc:157
Value * values
Definition: iwl.h:56
void iwl_buf_wrt_arr_SI(struct iwlbuf *Buf, double *arr, short int *p, short int *q, short int *r, short int *s, int size)
Definition: buf_wrt_arr_SI.cc:94
void iwl_wrttwo(int itap, int nbfso, double *ints, int *ioff, double toler, int printflg, std::string out)
Definition: wrttwo.cc:66
int iwl_buf_rd_arr(struct iwlbuf *Buf, int target_pq, double *ints, int *rlist, int *slist, int *size, int *ioff, int printflg, std::string out)
Definition: buf_rd_arr.cc:130
int itap
Definition: iwl.h:47
void iwl_buf_wrt_arr_SI_nocut(struct iwlbuf *Buf, double *arr, short int *p, short int *q, short int *r, short int *s, int size)
Definition: buf_wrt_arr_SI_nocut.cc:93
void iwl_buf_wrt_arr2(struct iwlbuf *Buf, double *arr, int p, int q, int *rlist, int *slist, int size, int printflag, std::string out)
Definition: buf_wrt_arr2.cc:102
int inbuf
Definition: iwl.h:53
void iwl_buf_fetch(struct iwlbuf *Buf)
Definition: buf_fetch.cc:59
double Value
Definition: libiwl/config.h:34
EXTERN int * ioff
Definition: ccresponse/globals.h:46
int lastbuf
Definition: iwl.h:52
void sortbuf(struct iwlbuf *inbuf, struct iwlbuf *outbuf, double *ints, int fpq, int lpq, int *ioff, int *ioff2, int nbfso, int elbert, int intermediate, int no_pq_perm, int qdim, int add, int printflg, std::string out)
Definition: sortbuf.cc:474
void iwl_buf_wrt_all(struct iwlbuf *Buf, int nbfso, double *ints, int *ioff, int printflg, std::string out)
Definition: buf_wrt_all.cc:110
void iwl_buf_wrt_mp2r12a(struct iwlbuf *Buf, int p, int q, int pq, int pqsym, double **arr, int rsym, int *firstr, int *lastr, int *firsts, int *lasts, int *occ, int bra_ket_symm, int *ioff, int printflag, std::string out)
Definition: buf_wrt_mp2r12a.cc:114