LIBINT
2.9.0
src
bin
libint
contractable.h
1
/*
2
* Copyright (C) 2004-2024 Edward F. Valeev
3
*
4
* This file is part of Libint compiler.
5
*
6
* Libint compiler is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* Libint compiler is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with Libint compiler. If not, see <http://www.gnu.org/licenses/>.
18
*
19
*/
20
21
#ifndef _libint2_src_bin_libint_contract_h_
22
#define _libint2_src_bin_libint_contract_h_
23
24
namespace
libint2
{
25
27
template
<
typename
Derived>
28
class
Contractable
{
29
public
:
30
Contractable
() : value_(default_value_) {}
31
Contractable
(
const
Contractable
& source) : value_(source.value_) {}
32
Contractable
& operator=(
const
Contractable
& source) {
33
value_ = source.value_;
34
return
*
this
;
35
}
36
bool
contracted()
const
{
return
value_; }
37
void
uncontract() { value_ =
false
; }
38
void
contract() { value_ =
true
; }
39
static
void
set_contracted_default_value(
bool
dv) { default_value_ = dv; }
40
41
private
:
42
bool
value_;
43
static
bool
default_value_;
44
};
45
template
<
typename
Derived>
46
bool
Contractable<Derived>::default_value_
=
false
;
47
48
};
// namespace libint2
49
50
#endif
libint2::Contractable
use this as a base to add to Derived a "contracted()" attribute
Definition
contractable.h:28
libint2
Defaults definitions for various parameters assumed by Libint.
Definition
algebra.cc:24
Generated by
1.10.0