1 //
2 // BAGEL - Brilliantly Advanced General Electronic Structure Library
3 // Filename: storagekramers.cc
4 // Copyright (C) 2015 Toru Shiozaki
5 //
6 // Author: Toru Shiozaki <shiozaki@northwestern.edu>
7 // Maintainer: Shiozaki group
8 //
9 // This file is part of the BAGEL package.
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 3 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
22 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 //
24 
25 #include <bagel_config.h>
26 #ifdef COMPILE_SMITH
27 
28 #include <src/smith/storagekramers.h>
29 
30 using namespace bagel::SMITH;
31 using namespace std;
32 
33 
34 template<typename DataType>
get_block() const35 unique_ptr<DataType[]> StorageKramers<DataType>::get_block() const {
36   return RMAWindow<DataType>::rma_get(generate_hash_key());
37 }
38 
39 template<typename DataType>
get_block(const Index & i0) const40 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0) const {
41   return get_block_(i0);
42 }
43 
44 template<typename DataType>
get_block(const Index & i0,const Index & i1) const45 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0, const Index& i1) const {
46   return get_block_(i0, i1);
47 }
48 
49 template<typename DataType>
get_block(const Index & i0,const Index & i1,const Index & i2) const50 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0, const Index& i1, const Index& i2) const {
51   return get_block_(i0, i1, i2);
52 }
53 
54 template<typename DataType>
get_block(const Index & i0,const Index & i1,const Index & i2,const Index & i3) const55 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0, const Index& i1, const Index& i2, const Index& i3) const {
56   return get_block_(i0, i1, i2, i3);
57 }
58 
59 template<typename DataType>
get_block(const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4) const60 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0, const Index& i1, const Index& i2, const Index& i3,
61                                                            const Index& i4) const {
62   return get_block_(i0, i1, i2, i3, i4);
63 }
64 
65 template<typename DataType>
get_block(const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5) const66 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0, const Index& i1, const Index& i2, const Index& i3,
67                                                            const Index& i4, const Index& i5) const {
68   return get_block_(i0, i1, i2, i3, i4, i5);
69 }
70 
71 template<typename DataType>
get_block(const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5,const Index & i6) const72 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0, const Index& i1, const Index& i2, const Index& i3,
73                                                            const Index& i4, const Index& i5, const Index& i6) const {
74   return get_block_(i0, i1, i2, i3, i4, i5, i6);
75 }
76 
77 template<typename DataType>
get_block(const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5,const Index & i6,const Index & i7) const78 unique_ptr<DataType[]> StorageKramers<DataType>::get_block(const Index& i0, const Index& i1, const Index& i2, const Index& i3,
79                                                            const Index& i4, const Index& i5, const Index& i6, const Index& i7) const {
80   return get_block_(i0, i1, i2, i3, i4, i5, i6, i7);
81 }
82 
83 
84 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat)85 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat) {
86   put_block_(dat);
87 }
88 
89 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0)90 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0) {
91   put_block_(dat, i0);
92 }
93 
94 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1)95 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1) {
96   put_block_(dat, i0, i1);
97 }
98 
99 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2)100 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2) {
101   put_block_(dat, i0, i1, i2);
102 }
103 
104 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3)105 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3) {
106   put_block_(dat, i0, i1, i2, i3);
107 }
108 
109 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4)110 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
111                                                                             const Index& i4) {
112   put_block_(dat, i0, i1, i2, i3, i4);
113 }
114 
115 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5)116 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
117                                                                             const Index& i4, const Index& i5) {
118   put_block_(dat, i0, i1, i2, i3, i4, i5);
119 }
120 
121 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5,const Index & i6)122 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
123                                                                             const Index& i4, const Index& i5, const Index& i6) {
124   put_block_(dat, i0, i1, i2, i3, i4, i5, i6);
125 }
126 
127 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5,const Index & i6,const Index & i7)128 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
129                                                                             const Index& i4, const Index& i5, const Index& i6, const Index& i7) {
130   put_block_(dat, i0, i1, i2, i3, i4, i5, i6, i7);
131 }
132 
133 template<typename DataType>
put_block(const unique_ptr<DataType[]> & dat,vector<Index> indices)134 void StorageKramers<DataType>::put_block(const unique_ptr<DataType[]>& dat, vector<Index> indices) {
135   put_block_(dat, indices);
136 }
137 
138 
139 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat)140 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat) {
141   add_block_(dat);
142 }
143 
144 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0)145 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0) {
146   add_block_(dat, i0);
147 }
148 
149 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1)150 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1) {
151   add_block_(dat, i0, i1);
152 }
153 
154 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2)155 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2) {
156   add_block_(dat, i0, i1, i2);
157 }
158 
159 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3)160 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3) {
161   add_block_(dat, i0, i1, i2, i3);
162 }
163 
164 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4)165 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
166                                                                             const Index& i4) {
167   add_block_(dat, i0, i1, i2, i3, i4);
168 }
169 
170 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5)171 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
172                                                                             const Index& i4, const Index& i5) {
173   add_block_(dat, i0, i1, i2, i3, i4, i5);
174 }
175 
176 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5,const Index & i6)177 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
178                                                                             const Index& i4, const Index& i5, const Index& i6) {
179   add_block_(dat, i0, i1, i2, i3, i4, i5, i6);
180 }
181 
182 template<typename DataType>
add_block(const unique_ptr<DataType[]> & dat,const Index & i0,const Index & i1,const Index & i2,const Index & i3,const Index & i4,const Index & i5,const Index & i6,const Index & i7)183 void StorageKramers<DataType>::add_block(const unique_ptr<DataType[]>& dat, const Index& i0, const Index& i1, const Index& i2, const Index& i3,
184                                                                             const Index& i4, const Index& i5, const Index& i6, const Index& i7) {
185   add_block_(dat, i0, i1, i2, i3, i4, i5, i6, i7);
186 }
187 
188 // explicit instantiation
189 template class bagel::SMITH::StorageKramers<double>;
190 template class bagel::SMITH::StorageKramers<complex<double>>;
191 
192 BOOST_CLASS_EXPORT_IMPLEMENT(StorageKramers<double>)
193 BOOST_CLASS_EXPORT_IMPLEMENT(StorageKramers<complex<double>>)
194 
195 #endif
196