LIBINT  2.1.0-stable
dims.h
1 /*
2  * This file is a part of Libint.
3  * Copyright (C) 2004-2014 Edward F. Valeev
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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 General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see http://www.gnu.org/licenses/.
17  *
18  */
19 
20 #include <smart_ptr.h>
21 #include <entity.h>
22 
23 #ifndef _libint2_src_bin_libint_dims_h_
24 #define _libint2_src_bin_libint_dims_h_
25 
26 using namespace std;
27 
28 namespace libint2 {
29 
30  using namespace EntityTypes;
31 
44  public:
46  ImplicitDimensions(const SafePtr<Entity>& high,
47  const SafePtr<Entity>& low,
48  const SafePtr<Entity>& vecdim);
52  ImplicitDimensions(int high, int low, int vec);
53  ~ImplicitDimensions() {}
54 
56  SafePtr<Entity> high() const { return high_; }
58  SafePtr<Entity> low() const { return low_; }
60  SafePtr<Entity> vecdim() const { return vecdim_; }
62  bool high_is_static() const { return high_is_static_; }
64  bool low_is_static() const { return low_is_static_; }
66  bool vecdim_is_static() const { return vecdim_is_static_; }
68  const std::string& high_label() const { return high_label_; }
70  const std::string& low_label() const { return low_label_; }
72  const std::string& vecdim_label() const { return vecdim_label_; }
73 
75  static void set_default_dims(const SafePtr<CompilationParameters>& cparams);
77  static SafePtr<ImplicitDimensions> default_dims();
78 
79  private:
80  // Dimensions can be runtime or compile-time quantities
81  const SafePtr<Entity> high_;
82  const SafePtr<Entity> low_;
83  const SafePtr<Entity> vecdim_;
84 
85  // checks if the dimensions are CTImeEntities
86  void init_();
87  bool high_is_static_;
88  bool low_is_static_;
89  bool vecdim_is_static_;
90  // Cached labels for
91  std::string high_label_;
92  std::string low_label_;
93  std::string vecdim_label_;
94 
96  static SafePtr<ImplicitDimensions> default_dims_;
97 
98  };
99 
100 };
101 
102 #endif
103 
bool low_is_static() const
Returns true if the rank of low dimension is known.
Definition: dims.h:64
const std::string & low_label() const
Returns the label of the low dimension.
Definition: dims.h:70
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: stdarray.h:18
bool high_is_static() const
Returns true if the rank of high dimension is known.
Definition: dims.h:62
SafePtr< Entity > low() const
Returns the low dimension.
Definition: dims.h:58
SafePtr< Entity > vecdim() const
Returns the vector dimension.
Definition: dims.h:60
ImplicitDimensions describes basis functions or other "degrees of freedom" not actively engaged in a ...
Definition: dims.h:43
SafePtr< Entity > high() const
Returns the high dimension.
Definition: dims.h:56
const std::string & high_label() const
Returns the label of the high dimension.
Definition: dims.h:68
bool vecdim_is_static() const
Returns true if the rank of vector dimension is known.
Definition: dims.h:66
const std::string & vecdim_label() const
Returns the label of the vector dimension.
Definition: dims.h:72