LIBINT  2.6.0
dims.h
1 /*
2  * Copyright (C) 2004-2019 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 
27 using namespace std;
28 
29 namespace libint2 {
30 
31  using namespace EntityTypes;
32 
45  public:
47  ImplicitDimensions(const SafePtr<Entity>& high,
48  const SafePtr<Entity>& low,
49  const SafePtr<Entity>& vecdim);
53  ImplicitDimensions(int high, int low, int vec);
54  ~ImplicitDimensions() {}
55 
57  SafePtr<Entity> high() const { return high_; }
59  SafePtr<Entity> low() const { return low_; }
61  SafePtr<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(const SafePtr<CompilationParameters>& cparams);
78  static SafePtr<ImplicitDimensions> default_dims();
79 
80  private:
81  // Dimensions can be runtime or compile-time quantities
82  const SafePtr<Entity> high_;
83  const SafePtr<Entity> low_;
84  const SafePtr<Entity> vecdim_;
85 
86  // checks if the dimensions are CTImeEntities
87  void init_();
88  bool high_is_static_;
89  bool low_is_static_;
90  bool vecdim_is_static_;
91  // Cached labels for
92  std::string high_label_;
93  std::string low_label_;
94  std::string vecdim_label_;
95 
97  static SafePtr<ImplicitDimensions> default_dims_;
98 
99  };
100 
101 };
102 
103 #endif
104 
bool vecdim_is_static() const
Returns true if the rank of vector dimension is known.
Definition: dims.h:67
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
SafePtr< Entity > high() const
Returns the high dimension.
Definition: dims.h:57
bool high_is_static() const
Returns true if the rank of high dimension is known.
Definition: dims.h:63
ImplicitDimensions describes basis functions or other "degrees of freedom" not actively engaged in a ...
Definition: dims.h:44
bool low_is_static() const
Returns true if the rank of low dimension is known.
Definition: dims.h:65
const std::string & vecdim_label() const
Returns the label of the vector dimension.
Definition: dims.h:73
const std::string & high_label() const
Returns the label of the high dimension.
Definition: dims.h:69
SafePtr< Entity > vecdim() const
Returns the vector dimension.
Definition: dims.h:61
const std::string & low_label() const
Returns the label of the low dimension.
Definition: dims.h:71
SafePtr< Entity > low() const
Returns the low dimension.
Definition: dims.h:59