LIBINT 2.9.0
dims.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#include <default_params.h>
22#include <entity.h>
23#include <smart_ptr.h>
24
25#ifndef _libint2_src_bin_libint_dims_h_
26#define _libint2_src_bin_libint_dims_h_
27
28namespace libint2 {
29
30using namespace EntityTypes;
31
44 public:
46 ImplicitDimensions(const std::shared_ptr<Entity>& high,
47 const std::shared_ptr<Entity>& low,
48 const std::shared_ptr<Entity>& vecdim);
53 ImplicitDimensions(int high, int low, int vec);
55
57 std::shared_ptr<Entity> high() const { return high_; }
59 std::shared_ptr<Entity> low() const { return low_; }
61 std::shared_ptr<Entity> vecdim() const { return vecdim_; }
63 bool high_is_static() const { return high_is_static_; }
65 bool low_is_static() const { return low_is_static_; }
67 bool vecdim_is_static() const { return vecdim_is_static_; }
69 const std::string& high_label() const { return high_label_; }
71 const std::string& low_label() const { return low_label_; }
73 const std::string& vecdim_label() const { return vecdim_label_; }
74
76 static void set_default_dims(
77 const std::shared_ptr<CompilationParameters>& cparams);
79 static std::shared_ptr<ImplicitDimensions> default_dims();
80
81 private:
82 // Dimensions can be runtime or compile-time quantities
83 const std::shared_ptr<Entity> high_;
84 const std::shared_ptr<Entity> low_;
85 const std::shared_ptr<Entity> vecdim_;
86
87 // checks if the dimensions are CTImeEntities
88 void init_();
89 bool high_is_static_;
90 bool low_is_static_;
91 bool vecdim_is_static_;
92 // Cached labels for
93 std::string high_label_;
94 std::string low_label_;
95 std::string vecdim_label_;
96
98 static std::shared_ptr<ImplicitDimensions> default_dims_;
99};
100
101}; // namespace libint2
102
103#endif
ImplicitDimensions describes basis functions or other "degrees of freedom" not actively engaged in a ...
Definition dims.h:43
std::shared_ptr< Entity > vecdim() const
Returns the vector dimension.
Definition dims.h:61
bool low_is_static() const
Returns true if the rank of low dimension is known.
Definition dims.h:65
static void set_default_dims(const std::shared_ptr< CompilationParameters > &cparams)
Sets default ImplicitDimension object.
Definition dims.cc:30
std::shared_ptr< Entity > high() const
Returns the high dimension.
Definition dims.h:57
std::shared_ptr< Entity > low() const
Returns the low dimension.
Definition dims.h:59
static std::shared_ptr< ImplicitDimensions > default_dims()
Default ImplicitDimension object.
Definition dims.cc:37
const std::string & vecdim_label() const
Returns the label of the vector dimension.
Definition dims.h:73
const std::string & low_label() const
Returns the label of the low dimension.
Definition dims.h:71
bool vecdim_is_static() const
Returns true if the rank of vector dimension is known.
Definition dims.h:67
ImplicitDimensions()
Default assumes runtime (dynamical) quantities.
Definition dims.cc:52
const std::string & high_label() const
Returns the label of the high dimension.
Definition dims.h:69
bool high_is_static() const
Returns true if the rank of high dimension is known.
Definition dims.h:63
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24