~ubuntu-branches/ubuntu/oneiric/mpqc/oneiric

« back to all changes in this revision

Viewing changes to src/lib/chemistry/qc/basis/gpetite.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2005-11-27 11:41:49 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127114149-zgz9r3gk50w8ww2q
Tags: 2.3.0-1
* New upstream release.
* debian/rules (SONAME): Activate awk snippet for automatic so-name
  detection again, resulting in a bump to `7' and making a `c2a' for
  the C++ allocator change unnecessary; closes: #339232.
* debian/patches/00list (08_gcc-4.0_fixes): Removed, no longer needed.
* debian/rules (test): Remove workarounds, do not abort build if tests
  fail.
* debian/ref: Removed.
* debian/control.in (libsc): Added Conflict against libsc6c2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
  nk_ = bk->nshell();
86
86
}
87
87
 
 
88
 
 
89
/////////////////////////////////////////////////////////////////////////////
 
90
 
 
91
GenPetite4::GenPetite4(const Ref<GaussianBasisSet> &b1,
 
92
                       const Ref<GaussianBasisSet> &b2,
 
93
                       const Ref<GaussianBasisSet> &b3,
 
94
                       const Ref<GaussianBasisSet> &b4)
 
95
{
 
96
  int **atom_map;
 
97
  b1_ = b1;
 
98
  b2_ = b2;
 
99
  b3_ = b3;
 
100
  b4_ = b4;
 
101
 
 
102
  ng_ = b1->molecule()->point_group()->char_table().order();
 
103
  if (b2->molecule()->point_group()->char_table().order() != ng_
 
104
      || b3->molecule()->point_group()->char_table().order() != ng_
 
105
      || b4->molecule()->point_group()->char_table().order() != ng_) {
 
106
    throw std::runtime_error("GPetite4: not all point groups are the same");
 
107
  }
 
108
  c1_ =  (ng_ == 1);
 
109
 
 
110
  atom_map = compute_atom_map(b1);
 
111
  shell_map_i_ = compute_shell_map(atom_map,b1);
 
112
  delete_atom_map(atom_map,b1);
 
113
 
 
114
  atom_map = compute_atom_map(b2);
 
115
  shell_map_j_ = compute_shell_map(atom_map,b2);
 
116
  delete_atom_map(atom_map,b2);
 
117
 
 
118
  atom_map = compute_atom_map(b3);
 
119
  shell_map_k_ = compute_shell_map(atom_map,b3);
 
120
  delete_atom_map(atom_map,b3);
 
121
 
 
122
  atom_map = compute_atom_map(b4);
 
123
  shell_map_l_ = compute_shell_map(atom_map,b4);
 
124
  delete_atom_map(atom_map,b4);
 
125
}
 
126
 
 
127
GenPetite4::~GenPetite4() {
 
128
  delete_shell_map(shell_map_i_,b1_);
 
129
  delete_shell_map(shell_map_j_,b2_);
 
130
  delete_shell_map(shell_map_k_,b3_);
 
131
  delete_shell_map(shell_map_l_,b4_);
 
132
}
 
133
 
 
134
/////////////////////////////////////////////////////////////////////////////
 
135
 
 
136
template <class C4> GPetite4<C4>::GPetite4(const Ref<GaussianBasisSet> &b1,
 
137
         const Ref<GaussianBasisSet> &b2,
 
138
         const Ref<GaussianBasisSet> &b3,
 
139
         const Ref<GaussianBasisSet> &b4,
 
140
         const C4& c): GenPetite4(b1,b2,b3,b4), c_(c)
 
141
{
 
142
}
 
143
 
 
144
template <class C4> GPetite4<C4>::~GPetite4()
 
145
{
 
146
}
 
147
 
 
148
/////////////////////////////////////////////////////////////////////////////
 
149
 
 
150
Ref<GenPetite4>
 
151
sc::construct_gpetite(const Ref<GaussianBasisSet> &b1,
 
152
                  const Ref<GaussianBasisSet> &b2,
 
153
                  const Ref<GaussianBasisSet> &b3,
 
154
                  const Ref<GaussianBasisSet> &b4)
 
155
{
 
156
  if (b1 == b2 && b1 == b3 && b1 == b4) {
 
157
    canonical_aaaa c4(b1,b2,b3,b4);
 
158
    return new GPetite4<canonical_aaaa>(b1,b2,b3,b4,c4);
 
159
  }
 
160
  else if (b1 == b2 && b3 != b4) {
 
161
    canonical_aabc c4(b1,b2,b3,b4);
 
162
    return new GPetite4<canonical_aabc>(b1,b2,b3,b4,c4);
 
163
  }
 
164
  else if (b1 == b2 && b3 == b4) {
 
165
    canonical_aabb c4(b1,b2,b3,b4);
 
166
    return new GPetite4<canonical_aabb>(b1,b2,b3,b4,c4);
 
167
  }
 
168
  else {
 
169
    canonical_abcd c4(b1,b2,b3,b4);
 
170
    return new GPetite4<canonical_abcd>(b1,b2,b3,b4,c4);
 
171
  }
 
172
}
 
173
 
88
174
/////////////////////////////////////////////////////////////////////////////
89
175
 
90
176
// Local Variables: