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