MPQC 2.3.1

- Main Page
- Related Pages
- Classes
- Files

- File List

tbint.h
1 //
2 // tbint.h
3 //
4 // Copyright (C) 1996 Limit Point Systems, Inc.
5 //
6 // Author: Edward Seidl <seidl@janed.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit 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 Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27
28 #ifndef _chemistry_qc_basis_tbint_h
29 #define _chemistry_qc_basis_tbint_h
30
31 #ifdef __GNUC__
32 #pragma interface
33 #endif
34
35 #include <util/ref/ref.h>
36 #include <util/group/message.h>
37 #include <chemistry/qc/basis/gaussbas.h>
38 #include <chemistry/qc/basis/dercent.h>
39
40 namespace sc {
41
42 // //////////////////////////////////////////////////////////////////////////
43
44 class Integral;
45
49 class TwoBodyInt : public RefCount {
50 protected:
51 // this is who created me
52 Integral *integral_;
53
54 Ref<GaussianBasisSet> bs1_;
55 Ref<GaussianBasisSet> bs2_;
56 Ref<GaussianBasisSet> bs3_;
57 Ref<GaussianBasisSet> bs4_;
58
59 double *buffer_;
60
61 int redundant_;
62
63 TwoBodyInt(Integral *integral,
64 const Ref<GaussianBasisSet>&bs1,
65 const Ref<GaussianBasisSet>&bs2,
66 const Ref<GaussianBasisSet>&bs3,
67 const Ref<GaussianBasisSet>&bs4);
68 public:
69 virtual ~TwoBodyInt();
70
72 int nbasis() const;
73
75 int nbasis1() const;
77 int nbasis2() const;
79 int nbasis3() const;
81 int nbasis4() const;
82
84 int nshell() const;
85
87 int nshell1() const;
89 int nshell2() const;
91 int nshell3() const;
93 int nshell4() const;
94
96 Ref<GaussianBasisSet> basis();
97
99 Ref<GaussianBasisSet> basis1();
101 Ref<GaussianBasisSet> basis2();
103 Ref<GaussianBasisSet> basis3();
105 Ref<GaussianBasisSet> basis4();
106
111 enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
113 static const int num_tbint_types = 4;
114
119 virtual const double * buffer(tbint_type type = eri) const;
120
124 virtual void compute_shell(int,int,int,int) = 0;
125
129 virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
130
133 virtual int redundant() const { return redundant_; }
135 virtual void set_redundant(int i) { redundant_ = i; }
136
138 virtual void set_integral_storage(size_t storage);
139
141 Integral *integral() const { return integral_; }
142
143 };
144
145 // //////////////////////////////////////////////////////////////////////////
146
150 class TwoBodyThreeCenterInt : public RefCount {
151 protected:
152 // this is who created me
153 Integral *integral_;
154
155 Ref<GaussianBasisSet> bs1_;
156 Ref<GaussianBasisSet> bs2_;
157 Ref<GaussianBasisSet> bs3_;
158
159 double *buffer_;
160
161 int redundant_;
162
163 TwoBodyThreeCenterInt(Integral *integral,
164 const Ref<GaussianBasisSet>&bs1,
165 const Ref<GaussianBasisSet>&bs2,
166 const Ref<GaussianBasisSet>&bs3);
167 public:
168 virtual ~TwoBodyThreeCenterInt();
169
171 int nbasis() const;
172
174 int nbasis1() const;
176 int nbasis2() const;
178 int nbasis3() const;
179
181 int nshell() const;
182
184 int nshell1() const;
186 int nshell2() const;
188 int nshell3() const;
189
191 Ref<GaussianBasisSet> basis();
192
194 Ref<GaussianBasisSet> basis1();
196 Ref<GaussianBasisSet> basis2();
198 Ref<GaussianBasisSet> basis3();
199
204 enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
206 static const int num_tbint_types = 4;
207
212 virtual const double * buffer(tbint_type type = eri) const;
213
217 virtual void compute_shell(int,int,int) = 0;
218
222 virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
223
226 int redundant() const { return redundant_; }
228 void set_redundant(int i) { redundant_ = i; }
229
231 virtual void set_integral_storage(size_t storage);
232
234 Integral *integral() const { return integral_; }
235
236 };
237
238 // //////////////////////////////////////////////////////////////////////////
239
244 class TwoBodyTwoCenterInt : public RefCount {
245 protected:
246 // this is who created me
247 Integral *integral_;
248
249 Ref<GaussianBasisSet> bs1_;
250 Ref<GaussianBasisSet> bs2_;
251
252 double *buffer_;
253
254 int redundant_;
255
256 TwoBodyTwoCenterInt(Integral *integral,
257 const Ref<GaussianBasisSet>&bs1,
258 const Ref<GaussianBasisSet>&bs2);
259 public:
260 virtual ~TwoBodyTwoCenterInt();
261
263 int nbasis() const;
264
266 int nbasis1() const;
268 int nbasis2() const;
269
271 int nshell() const;
272
274 int nshell1() const;
276 int nshell2() const;
277
279 Ref<GaussianBasisSet> basis();
280
282 Ref<GaussianBasisSet> basis1();
284 Ref<GaussianBasisSet> basis2();
285
290 enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
292 static const int num_tbint_types = 4;
293
298 virtual const double * buffer(tbint_type type = eri) const;
299
303 virtual void compute_shell(int,int) = 0;
304
308 virtual int log2_shell_bound(int= -1,int= -1) = 0;
309
312 int redundant() const { return redundant_; }
314 void set_redundant(int i) { redundant_ = i; }
315
317 virtual void set_integral_storage(size_t storage);
318
320 Integral *integral() const { return integral_; }
321
322 };
323
324 // //////////////////////////////////////////////////////////////////////////
325
326 class ShellQuartetIter {
327 protected:
328 const double * buf;
329 double scale_;
330
331 int redund_;
332
333 int e12;
334 int e34;
335 int e13e24;
336
337 int index;
338
339 int istart;
340 int jstart;
341 int kstart;
342 int lstart;
343
344 int iend;
345 int jend;
346 int kend;
347 int lend;
348
349 int icur;
350 int jcur;
351 int kcur;
352 int lcur;
353
354 int i_;
355 int j_;
356 int k_;
357 int l_;
358
359 public:
360 ShellQuartetIter();
361 virtual ~ShellQuartetIter();
362
363 virtual void init(const double *,
364 int, int, int, int,
365 int, int, int, int,
366 int, int, int, int,
367 double, int);
368
369 virtual void start();
370 virtual void next();
371
372 int ready() const { return icur < iend; }
373
374 int i() const { return i_; }
375 int j() const { return j_; }
376 int k() const { return k_; }
377 int l() const { return l_; }
378
379 int nint() const { return iend*jend*kend*lend; }
380
381 double val() const { return buf[index]*scale_; }
382 };
383
384 class TwoBodyIntIter {
385 protected:
386 Ref<TwoBodyInt> tbi;
387 ShellQuartetIter sqi;
388
389 int iend;
390
391 int icur;
392 int jcur;
393 int kcur;
394 int lcur;
395
396 public:
397 TwoBodyIntIter();
398 TwoBodyIntIter(const Ref<TwoBodyInt>&);
399
400 virtual ~TwoBodyIntIter();
401
402 virtual void start();
403 virtual void next();
404
405 int ready() const { return (icur < iend); }
406
407 int ishell() const { return icur; }
408 int jshell() const { return jcur; }
409 int kshell() const { return kcur; }
410 int lshell() const { return lcur; }
411
412 virtual double scale() const;
413
414 ShellQuartetIter& current_quartet();
415 };
416
417 // //////////////////////////////////////////////////////////////////////////
418
422 class TwoBodyDerivInt : public RefCount {
423 protected:
424 // this is who created me
425 Integral *integral_;
426
427 Ref<GaussianBasisSet> bs1_;
428 Ref<GaussianBasisSet> bs2_;
429 Ref<GaussianBasisSet> bs3_;
430 Ref<GaussianBasisSet> bs4_;
431
432 double *buffer_;
433
434 TwoBodyDerivInt(Integral* integral,
435 const Ref<GaussianBasisSet>&b1,
436 const Ref<GaussianBasisSet>&b2,
437 const Ref<GaussianBasisSet>&b3,
438 const Ref<GaussianBasisSet>&b4);
439 public:
440 virtual ~TwoBodyDerivInt();
441
443 int nbasis() const;
444
446 int nbasis1() const;
448 int nbasis2() const;
450 int nbasis3() const;
452 int nbasis4() const;
453
455 int nshell() const;
456
458 int nshell1() const;
460 int nshell2() const;
462 int nshell3() const;
464 int nshell4() const;
465
467 Ref<GaussianBasisSet> basis();
468
470 Ref<GaussianBasisSet> basis1();
472 Ref<GaussianBasisSet> basis2();
474 Ref<GaussianBasisSet> basis3();
476 Ref<GaussianBasisSet> basis4();
477
481 const double * buffer() const;
482
485 virtual void compute_shell(int,int,int,int,DerivCenters&) = 0;
486
489 virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
490 };
491
492 // //////////////////////////////////////////////////////////////////////////
493
497 class TwoBodyThreeCenterDerivInt : public RefCount {
498 protected:
499 // this is who created me
500 Integral *integral_;
501
502 Ref<GaussianBasisSet> bs1_;
503 Ref<GaussianBasisSet> bs2_;
504 Ref<GaussianBasisSet> bs3_;
505
506 double *buffer_;
507
508 TwoBodyThreeCenterDerivInt(Integral* integral,
509 const Ref<GaussianBasisSet>&b1,
510 const Ref<GaussianBasisSet>&b2,
511 const Ref<GaussianBasisSet>&b3);
512 public:
513 virtual ~TwoBodyThreeCenterDerivInt();
514
516 int nbasis() const;
517
519 int nbasis1() const;
521 int nbasis2() const;
523 int nbasis3() const;
524
526 int nshell() const;
527
529 int nshell1() const;
531 int nshell2() const;
533 int nshell3() const;
534
536 Ref<GaussianBasisSet> basis();
537
539 Ref<GaussianBasisSet> basis1();
541 Ref<GaussianBasisSet> basis2();
543 Ref<GaussianBasisSet> basis3();
544
548 const double * buffer() const;
549
552 virtual void compute_shell(int,int,int,DerivCenters&) = 0;
553
556 virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
557 };
558
559 // //////////////////////////////////////////////////////////////////////////
560
564 class TwoBodyTwoCenterDerivInt : public RefCount {
565 protected:
566 // this is who created me
567 Integral *integral_;
568
569 Ref<GaussianBasisSet> bs1_;
570 Ref<GaussianBasisSet> bs2_;
571
572 double *buffer_;
573
574 TwoBodyTwoCenterDerivInt(Integral* integral,
575 const Ref<GaussianBasisSet>&b1,
576 const Ref<GaussianBasisSet>&b2);
577 public:
578 virtual ~TwoBodyTwoCenterDerivInt();
579
581 int nbasis() const;
582
584 int nbasis1() const;
586 int nbasis2() const;
587
589 int nshell() const;
590
592 int nshell1() const;
594 int nshell2() const;
595
597 Ref<GaussianBasisSet> basis();
598
600 Ref<GaussianBasisSet> basis1();
602 Ref<GaussianBasisSet> basis2();
603
607 const double * buffer() const;
608
611 virtual void compute_shell(int,int,DerivCenters&) = 0;
612
615 virtual int log2_shell_bound(int= -1,int= -1) = 0;
616 };
617
618 }
619
620 #endif
621
622 // Local Variables:
623 // mode: c++
624 // c-file-style: "ETS"
625 // End: