7 #include "../../types.hpp" 13 namespace wavepackets {
50 virtual int limit(
int const* base_node,
dim_t axis)
const override 54 for (
dim_t i = 0; i < D; i++) {
56 s /= 1 + base_node[i];
63 virtual void print(std::ostream & out)
const override 65 out <<
"HyperbolicCutShape{sparsity: " << S_ <<
"}";
115 for (std::size_t d = 0; d < D; d++)
131 limits_[i++] = deflt = e;
135 limits_[i++] = deflt;
141 return std::min( limits_[axis]-1, S_ - 1);
144 virtual int limit(
int const* base_node,
dim_t axis)
const override 148 for (
dim_t i = 0; i < D; i++) {
150 if (base_node[i] >= limits_[i])
153 s /= 1 + base_node[i];
157 return std::min((
int)limits_[axis]-1, (
int)s - 1);
160 virtual void print(std::ostream & out)
const override 162 out <<
"LimitedHyperbolicCutShape{ sparsity: " << S_ <<
", limits (exclusive): [";
163 for (
dim_t i = 0; i < D-1; i++) {
164 out << limits_[i] <<
",";
166 out << limits_[D-1] <<
"]";
This class implements the hyperbolic cut shape.
Definition: shape_hyperbolic.hpp:31
Definition: coefficients_file_parser.cpp:10
int S_
Definition: shape_hyperbolic.hpp:91
HyperbolicCutShape(int S)
General constructor to set the sparsity parameter .
Definition: shape_hyperbolic.hpp:42
virtual int bbox(dim_t axis) const override
Retrieves the length of the minimum bounding box in one direction.
Definition: shape_hyperbolic.hpp:139
virtual void print(std::ostream &out) const override
Prints a pretty description of the shape.
Definition: shape_hyperbolic.hpp:160
LimitedHyperbolicCutShape(int S, const std::array< int, D > &limits)
General constructor to define sparsity parameter and limits.
Definition: shape_hyperbolic.hpp:101
virtual void print(std::ostream &out) const override
Prints a pretty description of the shape.
Definition: shape_hyperbolic.hpp:63
LimitedHyperbolicCutShape(int S, int size)
Specialized constructor to set all limits to the same value .
Definition: shape_hyperbolic.hpp:112
virtual int limit(int const *base_node, dim_t axis) const override
Evaluates one surface function on a base node.
Definition: shape_hyperbolic.hpp:50
virtual int bbox(dim_t axis) const override
Retrieves the length of the minimum bounding box in one direction.
Definition: shape_hyperbolic.hpp:44
virtual int limit(int const *base_node, dim_t axis) const override
Evaluates one surface function on a base node.
Definition: shape_hyperbolic.hpp:144
LimitedHyperbolicCutShape(int S, std::initializer_list< int > list)
General constructor to define sparsity parameter and limits.
Definition: shape_hyperbolic.hpp:125
int S_
Definition: shape_hyperbolic.hpp:34
std::array< int, D > limits_
Definition: shape_hyperbolic.hpp:92
This class implements the limited hyperbolic cut shape.
Definition: shape_hyperbolic.hpp:88
Subclasses provide a description of a basis shape.
Definition: shape_base.hpp:34
int dim_t
Definition: types.hpp:16