Program Listing for File iter_gb.h

Return to documentation for file (gbasis/iter_gb.h)

// HORTON: Helpful Open-source Research TOol for N-fermion systems.
// Copyright (C) 2011-2017 The HORTON Development Team
//
// This file is part of HORTON.
//
// HORTON is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// HORTON is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>
//
//--

#ifndef GBASIS_ITER_GB_H_
#define GBASIS_ITER_GB_H_

#include "gbasis.h"
class IterGB1 {
 private:
  // input fields
  const GBasis *gbasis;
  const long *basis_offsets;

 public:
  explicit IterGB1(GBasis *gbasis);
  IterGB1(const IterGB1 &other) = delete;

  int inc_shell();

  void update_shell();

  int inc_prim();

  void update_prim();

  void store(const double *work, double *output, long dim);

  // 'public' iterator fields
  long shell_type0;
  double con_coeff, alpha0;
  const double *r0;
  const double *scales0;
  long ibasis0;

  // 'private' iterator fields
  long ishell0;
  long nprim0, iprim0, oprim0;
};

class IterGB2 {
 private:
  // input fields
  const GBasis *gbasis;
  const long *basis_offsets;

 public:
  explicit IterGB2(GBasis *gbasis);
  IterGB2(const IterGB2 &other) = delete;

  int inc_shell();

  void update_shell();

  int inc_prim();

  void update_prim();

  void store(const double *work, double *output);

  double dot(const double *work, const double *dm);

  // 'public' iterator fields

  long shell_type0, shell_type1;
  double con_coeff;
  double alpha0, alpha1;
  const double *r0;
  const double *r1;
  const double *scales0;
  const double *scales1;
  long ibasis0, ibasis1;

  // 'private' iterator fields

  long ishell0, ishell1;
  long nprim0, nprim1, iprim0, iprim1, oprim0, oprim1;
};

class IterGB4 {
 private:
  // input fields
  const GBasis *gbasis;
  const long *basis_offsets;

 public:
  explicit IterGB4(GBasis *gbasis);
  IterGB4(const IterGB4 &other) = delete;

  int inc_shell();

  void update_shell();

  int inc_prim();

  void update_prim();
  void store(const double *work, double *output);

  // 'public' iterator fields

  long shell_type0, shell_type1, shell_type2, shell_type3;
  double con_coeff;
  double alpha0, alpha1, alpha2, alpha3;
  const double *r0;
  const double *r1;
  const double *r2;
  const double *r3;
  const double *scales0;
  const double *scales1;
  const double *scales2;
  const double *scales3;
  long ibasis0, ibasis1, ibasis2, ibasis3;

  // 'private' iterator fields

  long ishell0, ishell1, ishell2, ishell3;
  long ishell3_max;
  long nprim0, nprim1, nprim2, nprim3;
  long iprim0, iprim1, iprim2, iprim3;
  long oprim0, oprim1, oprim2, oprim3;
};

#endif  // GBASIS_ITER_GB_H_