Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages  

cartitv3.h

00001 //
00002 // cartitv3.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB.  If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027 
00028 #ifndef _chemistry_qc_intv3_cartitv3_h
00029 #define _chemistry_qc_intv3_cartitv3_h
00030 
00031 #include <chemistry/qc/basis/cartiter.h>
00032 
00033 class CartesianIterV3 : public CartesianIter {
00034   public:
00035     CartesianIterV3(int l) : CartesianIter(l) {}
00036 
00037     void start() {
00038       bfn_=a_=c_=0;
00039       b_=l_;
00040     }
00041 
00042     void next() {
00043       if (c_<l_-a_)
00044         c_++;
00045       else {
00046         c_=0;
00047         a_++;
00048       }
00049       bfn_++;
00050       b_ = l_-a_-c_;
00051     }
00052     
00053     operator int() {
00054       return (a_ <= l_);
00055     }
00056 };
00057 
00058 class RedundantCartesianIterV3 : public RedundantCartesianIter {
00059   public:
00060     RedundantCartesianIterV3(int l) : RedundantCartesianIter(l) {}
00061 
00062     int bfn() {
00063       int i = a();
00064       int j = b();
00065       int am = l();
00066       return (((((((am)+1)<<1)-(i))*((i)+1))>>1)-(j)-1);
00067     }
00068 };
00069 
00070 class RedundantCartesianSubIterV3 : public RedundantCartesianSubIter {
00071   public:
00072     RedundantCartesianSubIterV3(int l) : RedundantCartesianSubIter(l) {}
00073 
00074     int bfn() {
00075       int i = a();
00076       int j = b();
00077       int am = l();
00078       return (((((((am)+1)<<1)-(i))*((i)+1))>>1)-(j)-1);
00079     }
00080 };
00081 
00082 #endif
00083 
00084 // Local Variables:
00085 // mode: c++
00086 // c-file-style: "CLJ"
00087 // End:

Generated at Thu Oct 4 18:08:42 2001 for MPQC 2.0.0 using the documentation package Doxygen 1.2.5.