GQCP
Loading...
Searching...
No Matches
OneElectronIntegralBuffer.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
22
23#include <array>
24
25
26namespace GQCP {
27
28
37template <typename _IntegralScalar, size_t _N>
39 public BaseOneElectronIntegralBuffer<_IntegralScalar, _N> {
40public:
41 using IntegralScalar = _IntegralScalar; // the scalar representation of an integral
42 static constexpr auto N = _N; // the number of components the operator has
43
44
45protected:
46 std::array<std::vector<IntegralScalar>, N> buffer; // the calculated integrals
47
48public:
49 /*
50 * CONSTRUCTORS
51 */
52
58 OneElectronIntegralBuffer(const size_t nbf1, const size_t nbf2, const std::array<std::vector<IntegralScalar>, N>& buffer) :
59 buffer {buffer},
61
62
63 /*
64 * PUBLIC OVERRIDDEN METHODS
65 */
66
70 bool areIntegralsAllZero() const { return false; }
71
79 virtual IntegralScalar value(const size_t i, const size_t f1, const size_t f2) const {
80 return this->buffer[i][f2 + f1 * this->nbf2]; // accessing the component first, then row-major ordering of the calculated integrals
81 }
82};
83
84
85} // namespace GQCP
Definition: BaseOneElectronIntegralBuffer.hpp:37
size_t nbf2
Definition: BaseOneElectronIntegralBuffer.hpp:45
size_t nbf1
Definition: BaseOneElectronIntegralBuffer.hpp:44
Definition: OneElectronIntegralBuffer.hpp:39
std::array< std::vector< IntegralScalar >, N > buffer
Definition: OneElectronIntegralBuffer.hpp:46
virtual IntegralScalar value(const size_t i, const size_t f1, const size_t f2) const
Definition: OneElectronIntegralBuffer.hpp:79
bool areIntegralsAllZero() const
Definition: OneElectronIntegralBuffer.hpp:70
OneElectronIntegralBuffer(const size_t nbf1, const size_t nbf2, const std::array< std::vector< IntegralScalar >, N > &buffer)
Definition: OneElectronIntegralBuffer.hpp:58
static constexpr auto N
Definition: OneElectronIntegralBuffer.hpp:42
_IntegralScalar IntegralScalar
Definition: OneElectronIntegralBuffer.hpp:41
Definition: BaseOneElectronIntegralBuffer.hpp:25