Scine::Sparrow  5.1.0
Library for fast and agile quantum chemical calculations with semiempirical methods.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
TwoElectronIntegralIndexes.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_TWOELECTRONINTEGRALINDEXES_H
9 #define SPARROW_TWOELECTRONINTEGRALINDEXES_H
10 
11 #include <array>
12 
13 namespace Scine {
14 namespace Sparrow {
15 
16 namespace nddo {
17 
37  public:
38  using orb_index_t = int;
39  using orbPair_index_t = int;
41  using Array = std::array<std::array<orbPair_index_t, 9>, 9>;
42 
50  static orbPair_index_t getPairIndex(orb_index_t i1, orb_index_t i2) {
51  return getIndex(i1, i2);
52  }
53 
60  static bool pairIsInvalid(orb_index_t i1, orb_index_t i2) {
61  return (getIndex(i1, i2) == invalidPair);
62  }
63 
64  private:
65  // Creates the index array if it was not yet done and returns the index
66  static orbPair_index_t getIndex(orb_index_t i1, orb_index_t i2) {
67  static Array pairIndexes = createUniqueIndexes();
68  return pairIndexes[i1][i2];
69  }
70 
71  // Array is created as exclusively invalidPair code except the valid pairs
72  // where the casted orbital pair value is given
73  static Array createUniqueIndexes();
74 
75  // Code for the invalid pair
76  static constexpr orbPair_index_t invalidPair = 100;
77 };
78 
79 } // namespace nddo
80 
81 } // namespace Sparrow
82 } // namespace Scine
83 #endif // SPARROW_TWOELECTRONINTEGRALINDEXES_H
This class initializes and stores as a static array the indices of the charge distributions on one ce...
Definition: TwoElectronIntegralIndexes.h:36
static orbPair_index_t getPairIndex(orb_index_t i1, orb_index_t i2)
Convert two orbitals into an orbital pair.
Definition: TwoElectronIntegralIndexes.h:50
static bool pairIsInvalid(orb_index_t i1, orb_index_t i2)
Checks if two orbitals form a valid charge distribution.
Definition: TwoElectronIntegralIndexes.h:60
std::array< std::array< orbPair_index_t, 9 >, 9 > Array
9x9 matrix with all the possible orbital combinations
Definition: TwoElectronIntegralIndexes.h:41