Psi4
schwarz.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 #ifndef three_index_schwarz_H
29 #define three_index_schwarz_H
30 
31 #include "psi4/psi4-dec.h"
32 
33 
34 namespace psi {
35 
36 class BasisSet;
37 
38 class SchwarzSieve {
39 
40 protected:
41 
42  // The schwarz cutoff
43  double schwarz_;
44 
45  // Basis set for this schwarz
46  std::shared_ptr<BasisSet> basis_;
47 
48  // Is the sieve initialized
50 
51  // number of significant shell pairs
52  unsigned long int nshell_pairs_;
53  // number of significant function pairs
54  unsigned long int nfun_pairs_;
55 
59 
62 
65 
66  void form_schwarz_ints();
67 
68 public:
69  SchwarzSieve(std::shared_ptr<BasisSet>, double cutoff);
70  virtual ~SchwarzSieve();
71 
72  void form_schwarz_sieve(double cutoff);
73  // Sizes of the significant bra/ket pairs
74  unsigned long int get_nshell_pairs() const { return nshell_pairs_; }
75  unsigned long int get_nfun_pairs() const { return nfun_pairs_; }
76  // I_global = arr[2*I_local], J_global = arr[2*I_local + 1]
77  // These are only defined up to nshell_pairs_ and nfun_pairs_, respectively
78  int* get_schwarz_shells() const { return schwarz_shells_; }
79  int* get_schwarz_funs() const { return schwarz_funs_; }
80  // Canonical compound indexing, -1 if not present
82  long int* get_schwarz_funs_reverse() const { return schwarz_funs_reverse_; }
83 
84 };
85 
86 
87 }
88 #endif
SchwarzSieve(std::shared_ptr< BasisSet >, double cutoff)
Definition: schwarz.cc:62
unsigned long int nfun_pairs_
Definition: schwarz.h:54
int * schwarz_funs_
Definition: schwarz.h:58
unsigned long int get_nfun_pairs() const
Definition: schwarz.h:75
long int * get_schwarz_shells_reverse() const
Definition: schwarz.h:81
long int * schwarz_shells_reverse_
Definition: schwarz.h:60
void form_schwarz_ints()
Definition: schwarz.cc:78
Definition: schwarz.h:38
long int * get_schwarz_funs_reverse() const
Definition: schwarz.h:82
void form_schwarz_sieve(double cutoff)
Definition: schwarz.cc:123
double schwarz_
Definition: schwarz.h:43
bool initialized_
Definition: schwarz.h:49
int * get_schwarz_shells() const
Definition: schwarz.h:78
double * schwarz_fun_vals_
Definition: schwarz.h:64
double * schwarz_shell_vals_
Definition: schwarz.h:63
unsigned long int nshell_pairs_
Definition: schwarz.h:52
int * schwarz_shells_
Definition: schwarz.h:57
int * get_schwarz_funs() const
Definition: schwarz.h:79
std::shared_ptr< BasisSet > basis_
Definition: schwarz.h:46
virtual ~SchwarzSieve()
Definition: schwarz.cc:67
long int * schwarz_funs_reverse_
Definition: schwarz.h:61
unsigned long int get_nshell_pairs() const
Definition: schwarz.h:74
double max_global_val_
Definition: schwarz.h:56