00001
00002
00003
00004
00005 #ifndef _chemistry_qc_basis_extent_h
00006 #define _chemistry_qc_basis_extent_h
00007
00008 #ifdef __GNUC__
00009 #pragma interface
00010 #endif
00011
00012 #include <vector>
00013
00014 #include <float.h>
00015 #include <chemistry/qc/basis/basis.h>
00016
00017 namespace sc {
00018
00019 struct ExtentData {
00020 int shell;
00021 double bound;
00022 ExtentData() {}
00023 ExtentData(int s, double b): shell(s), bound(b) {}
00024 };
00025
00026 class ShellExtent: public RefCount {
00027 double lower_[3];
00028 double resolution_;
00029 int n_[3];
00030 std::vector<ExtentData> *contributing_shells_;
00031 std::vector<ExtentData> null_;
00032
00033 std::vector<ExtentData> &data(int *b);
00034 double distance(double loc, int axis, int origin, int point);
00035 std::vector<ExtentData> &data(int x, int y, int z);
00036 public:
00037 ShellExtent();
00038 ~ShellExtent();
00039 void init(const Ref<GaussianBasisSet>&,
00040 double resolution = 1.0, double tolerance = DBL_EPSILON);
00043 const std::vector<ExtentData> &contributing_shells(int x, int y, int z)
00044 { return data(x,y,z); }
00045 const std::vector<ExtentData> &contributing_shells(double x, double y, double z);
00046 void print(std::ostream &o = ExEnv::out0());
00047 const int *n() const { return n_; }
00048 int n(int ixyz) const { return n_[ixyz]; }
00049 double lower(int ixyz) const { return lower_[ixyz]; }
00050 double upper(int ixyz) const { return resolution_*n_[ixyz] + lower_[ixyz]; }
00051 double resolution() const { return resolution_; }
00052 };
00053
00054 }
00055
00056 #endif
00057
00058
00059
00060
00061