MPQC 2.3.1

- Main Page
- Related Pages
- Classes
- Files

- File List

chemistry/qc/basis/transform.h
1 //
2 // transform.h
3 //
4 // Copyright (C) 1996 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.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 #if defined(__GNUC__)
29 #pragma interface
30 #endif
31
32 #ifndef _chemistry_qc_basis_transform_h
33 #define _chemistry_qc_basis_transform_h
34
35 namespace sc {
36
37 // ///////////////////////////////////////////////////////////////////////////
38
41 class SphericalTransformComponent {
42 protected:
43 double coef_;
44 int a_, b_, c_, cartindex_, pureindex_;
45
46 public:
48 int a() const { return a_; }
50 int b() const { return b_; }
52 int c() const { return c_; }
54 int cartindex() const { return cartindex_; }
56 int pureindex() const { return pureindex_; }
58 double coef() const { return coef_; }
59
68 virtual void init(int a, int b, int c, double coef, int pureindex) =0;
69 };
70
71 // ///////////////////////////////////////////////////////////////////////////
72
75 class SphericalTransform {
76 protected:
77 int n_;
78 int l_;
79 int subl_;
80 SphericalTransformComponent *components_;
81
82 SphericalTransform();
83
91 SphericalTransform(int l, int subl = -1);
92
97 virtual void init();
98
99 public:
100 virtual ~SphericalTransform();
101
103 void add(int a, int b, int c, double coef, int pureindex);
104
106 int cartindex(int i) const { return components_[i].cartindex(); }
108 int pureindex(int i) const { return components_[i].pureindex(); }
110 double coef(int i) const { return components_[i].coef(); }
112 int a(int i) const { return components_[i].a(); }
114 int b(int i) const { return components_[i].b(); }
116 int c(int i) const { return components_[i].c(); }
118 int l() const { return l_; }
120 int n() const { return n_; }
121
124 virtual SphericalTransformComponent * new_components() = 0;
125 };
126
128 class ISphericalTransform: public SphericalTransform {
129 protected:
130 ISphericalTransform();
131 ISphericalTransform(int l,int subl=-1);
132 void init();
133 };
134
135 // ///////////////////////////////////////////////////////////////////////////
136
138 class SphericalTransformIter {
139 private:
140 int i_;
141
142 protected:
143 const SphericalTransform *transform_;
144
145 public:
146 SphericalTransformIter();
147 SphericalTransformIter(const SphericalTransform*);
148
149 void begin() { i_ = 0; }
150 void start() { begin(); }
151 void next() { i_++; }
152 int ready() { return i_ < transform_->n(); }
153 operator int() { return ready(); }
154 int l() { return transform_->l(); }
155 int cartindex() { return transform_->cartindex(i_); }
156 int pureindex() { return transform_->pureindex(i_); }
157 int bfn() { return pureindex(); }
158 double coef() { return transform_->coef(i_); }
159 int a() { return transform_->a(i_); }
160 int b() { return transform_->b(i_); }
161 int c() { return transform_->c(i_); }
162 int l(int i) { return i?(i==1?b():c()):a(); }
163 int n() { return 2*l() + 1; }
164 };
165
166 }
167
168 #endif
169
170 // Local Variables:
171 // mode: c++
172 // c-file-style: "ETS"
173 // End: