MPQC  3.0.0-alpha
cartit_cca.h
1 //
2 // cartit.h
3 //
4 // Copyright (C) 2001 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
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 #ifndef _chemistry_qc_basis_cartit_h
29 #define _chemistry_qc_basis_cartit_h
30 
31 #include <chemistry/qc/basis/cartiter.h>
32 
33 namespace sc {
34 
36 
37  public:
39 
40  void start() {
41  bfn_=b_=c_=0;
42  a_=l_;
43  }
44 
45  void next() {
46  if (c_ < l_ - a_) {
47  b_--;
48  c_++;
49  }
50  else {
51  a_--;
52  c_ = 0;
53  b_ = l_ - a_;
54  }
55  bfn_++;
56  }
57 
58  operator int() {
59  return (a_ >= 0);
60  }
61 };
62 
64  public:
66 
67  int bfn() {
68  int i = a();
69  int am = l();
70  if (am == i)
71  return 0;
72  else {
73  int j = b();
74  int c = am - i;
75  return ((((c+1)*c)>>1)+c-j);
76  }
77  }
78 };
79 
81 
82  int bfn_;
83 
84  public:
86 
87  void start(int aa, int bb, int cc) {
89  int i = a();
90  int am = l();
91  if (am == i)
92  bfn_ = 0;
93  else {
94  int j = b();
95  int c = am - i;
96  bfn_ = ((((c + 1) * c) >> 1) + c - j);
97  }
98  }
99 
100  int bfn() const { return bfn_; }
101 };
102 
103 }
104 
105 #endif
106 
107 // Local Variables:
108 // mode: c++
109 // c-file-style: "CLJ"
110 // End:
sc::RedundantCartesianIter::RedundantCartesianIter
RedundantCartesianIter(int l)
Create a object for the given angular momentum.
sc::RedundantCartesianIter
RedundantCartesianIter objects loop through all possible combinations of a given number of axes.
Definition: cartiter.h:82
sc::RedundantCartesianSubIter::start
virtual void start(int a, int b, int c)
Initialize the iterator.
sc::RedundantCartesianSubIter::RedundantCartesianSubIter
RedundantCartesianSubIter(int l)
Create a object for the given angular momentum.
sc::CartesianIter::CartesianIter
CartesianIter(int l)
Initialize an iterator for the given angular momentum.
sc::RedundantCartesianIter::a
int a()
The current exponent of x.
Definition: cartiter.h:153
sc::CartesianIter
CartesianIter gives the ordering of the Cartesian functions within a shell for the particular integra...
Definition: cartiter.h:35
sc::CartesianIter::l
int l()
Returns the angular momentum.
Definition: cartiter.h:64
sc::CartesianIterCCA::next
void next()
Move to the next Cartesian function.
Definition: cartit_cca.h:45
sc::RedundantCartesianSubIterCCA
Definition: cartit_cca.h:80
sc::RedundantCartesianSubIter
Like RedundantCartesianIter, except a, b, and c are fixed to a given value.
Definition: cartiter.h:172
sc::RedundantCartesianSubIter::l
int l() const
The angular momentum.
Definition: cartiter.h:210
sc::RedundantCartesianIter::b
int b()
The current exponent of y.
Definition: cartiter.h:159
sc::RedundantCartesianSubIterCCA::start
void start(int aa, int bb, int cc)
Initialize the iterator.
Definition: cartit_cca.h:87
sc::RedundantCartesianIterCCA
Definition: cartit_cca.h:63
sc::CartesianIterCCA
Definition: cartit_cca.h:35
sc::RedundantCartesianIterCCA::bfn
int bfn()
Return the current Cartesian basis function number.
Definition: cartit_cca.h:67
sc::RedundantCartesianSubIterCCA::bfn
int bfn() const
Return the current Cartesian basis function number.
Definition: cartit_cca.h:100
sc::RedundantCartesianSubIter::a
int a() const
The current exponent of x.
Definition: cartiter.h:204
sc::CartesianIterCCA::start
void start()
Start the iteration.
Definition: cartit_cca.h:40
sc::RedundantCartesianIter::c
int c()
The current exponent of z.
Definition: cartiter.h:165
sc::RedundantCartesianSubIter::c
int c() const
The current exponent of z.
Definition: cartiter.h:208
sc::RedundantCartesianIter::l
int l()
The angular momentum.
Definition: cartiter.h:110
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::RedundantCartesianSubIter::b
int b() const
The current exponent of y.
Definition: cartiter.h:206

Generated at Sun Jan 26 2020 23:23:57 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.