| [0b990d] | 1 | //
 | 
|---|
 | 2 | // extent.h
 | 
|---|
 | 3 | //
 | 
|---|
 | 4 | 
 | 
|---|
 | 5 | #ifndef _chemistry_qc_basis_extent_h
 | 
|---|
 | 6 | #define _chemistry_qc_basis_extent_h
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #ifdef __GNUC__
 | 
|---|
 | 9 | #pragma interface
 | 
|---|
 | 10 | #endif
 | 
|---|
 | 11 | 
 | 
|---|
 | 12 | #include <vector>
 | 
|---|
 | 13 | 
 | 
|---|
 | 14 | #include <float.h>
 | 
|---|
 | 15 | #include <chemistry/qc/basis/basis.h>
 | 
|---|
 | 16 | 
 | 
|---|
 | 17 | namespace sc {
 | 
|---|
 | 18 | 
 | 
|---|
 | 19 | struct ExtentData {
 | 
|---|
 | 20 |     int shell;
 | 
|---|
 | 21 |     double bound;
 | 
|---|
 | 22 |     ExtentData() {}
 | 
|---|
 | 23 |     ExtentData(int s, double b): shell(s), bound(b) {}
 | 
|---|
 | 24 | };
 | 
|---|
 | 25 | 
 | 
|---|
 | 26 | class ShellExtent: public RefCount {
 | 
|---|
 | 27 |     double lower_[3];
 | 
|---|
 | 28 |     double resolution_;
 | 
|---|
 | 29 |     int n_[3];
 | 
|---|
 | 30 |     std::vector<ExtentData> *contributing_shells_;
 | 
|---|
 | 31 |     std::vector<ExtentData> null_;
 | 
|---|
 | 32 | 
 | 
|---|
 | 33 |     std::vector<ExtentData> &data(int *b);
 | 
|---|
 | 34 |     double distance(double loc, int axis, int origin, int point);
 | 
|---|
 | 35 |     std::vector<ExtentData> &data(int x, int y, int z);
 | 
|---|
 | 36 |   public:
 | 
|---|
 | 37 |     ShellExtent();
 | 
|---|
 | 38 |     ~ShellExtent();
 | 
|---|
 | 39 |     void init(const Ref<GaussianBasisSet>&,
 | 
|---|
 | 40 |               double resolution = 1.0, double tolerance = DBL_EPSILON);
 | 
|---|
 | 41 |     /** Returns the shells that are nonzero at coordinates x, y, z.
 | 
|---|
 | 42 |         The shells numbers are in ascending order. */
 | 
|---|
 | 43 |     const std::vector<ExtentData> &contributing_shells(int x, int y, int z)
 | 
|---|
 | 44 |         { return data(x,y,z); }
 | 
|---|
 | 45 |     const std::vector<ExtentData> &contributing_shells(double x, double y, double z);
 | 
|---|
 | 46 |     void print(std::ostream &o = ExEnv::out0());
 | 
|---|
 | 47 |     const int *n() const { return n_; }
 | 
|---|
 | 48 |     int n(int ixyz) const { return n_[ixyz]; }
 | 
|---|
 | 49 |     double lower(int ixyz) const { return lower_[ixyz]; }
 | 
|---|
 | 50 |     double upper(int ixyz) const { return resolution_*n_[ixyz] + lower_[ixyz]; }
 | 
|---|
 | 51 |     double resolution() const { return resolution_; }
 | 
|---|
 | 52 | };
 | 
|---|
 | 53 | 
 | 
|---|
 | 54 | }
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 | #endif
 | 
|---|
 | 57 | 
 | 
|---|
 | 58 | // Local Variables:
 | 
|---|
 | 59 | // mode: c++
 | 
|---|
 | 60 | // c-file-style: "CLJ"
 | 
|---|
 | 61 | // End:
 | 
|---|