LIBINT 2.7.2
dims.h
1/*
2 * Copyright (C) 2004-2021 Edward F. Valeev
3 *
4 * This file is part of Libint.
5 *
6 * Libint 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 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. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#include <smart_ptr.h>
22#include <entity.h>
23
24#ifndef _libint2_src_bin_libint_dims_h_
25#define _libint2_src_bin_libint_dims_h_
26
27namespace libint2 {
28
29 using namespace EntityTypes;
30
43 public:
45 ImplicitDimensions(const SafePtr<Entity>& high,
46 const SafePtr<Entity>& low,
47 const SafePtr<Entity>& vecdim);
51 ImplicitDimensions(int high, int low, int vec);
53
55 SafePtr<Entity> high() const { return high_; }
57 SafePtr<Entity> low() const { return low_; }
59 SafePtr<Entity> vecdim() const { return vecdim_; }
61 bool high_is_static() const { return high_is_static_; }
63 bool low_is_static() const { return low_is_static_; }
65 bool vecdim_is_static() const { return vecdim_is_static_; }
67 const std::string& high_label() const { return high_label_; }
69 const std::string& low_label() const { return low_label_; }
71 const std::string& vecdim_label() const { return vecdim_label_; }
72
74 static void set_default_dims(const SafePtr<CompilationParameters>& cparams);
76 static SafePtr<ImplicitDimensions> default_dims();
77
78 private:
79 // Dimensions can be runtime or compile-time quantities
80 const SafePtr<Entity> high_;
81 const SafePtr<Entity> low_;
82 const SafePtr<Entity> vecdim_;
83
84 // checks if the dimensions are CTImeEntities
85 void init_();
86 bool high_is_static_;
87 bool low_is_static_;
88 bool vecdim_is_static_;
89 // Cached labels for
90 std::string high_label_;
91 std::string low_label_;
92 std::string vecdim_label_;
93
95 static SafePtr<ImplicitDimensions> default_dims_;
96
97 };
98
99};
100
101#endif
102
ImplicitDimensions describes basis functions or other "degrees of freedom" not actively engaged in a ...
Definition: dims.h:42
SafePtr< Entity > low() const
Returns the low dimension.
Definition: dims.h:57
bool low_is_static() const
Returns true if the rank of low dimension is known.
Definition: dims.h:63
SafePtr< Entity > high() const
Returns the high dimension.
Definition: dims.h:55
const std::string & vecdim_label() const
Returns the label of the vector dimension.
Definition: dims.h:71
const std::string & low_label() const
Returns the label of the low dimension.
Definition: dims.h:69
static SafePtr< ImplicitDimensions > default_dims()
Default ImplicitDimension object.
Definition: dims.cc:38
SafePtr< Entity > vecdim() const
Returns the vector dimension.
Definition: dims.h:59
bool vecdim_is_static() const
Returns true if the rank of vector dimension is known.
Definition: dims.h:65
static void set_default_dims(const SafePtr< CompilationParameters > &cparams)
Sets default ImplicitDimension object.
Definition: dims.cc:31
ImplicitDimensions()
Default assumes runtime (dynamical) quantities.
Definition: dims.cc:54
const std::string & high_label() const
Returns the label of the high dimension.
Definition: dims.h:67
bool high_is_static() const
Returns true if the rank of high dimension is known.
Definition: dims.h:61
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24