SpECTRE
v2025.03.17
|
Defines an expression representing a number. More...
#include <NumberAsExpression.hpp>
Public Types | |
using | type = DataType |
The type of the data being stored in the result of the expression. | |
using | symmetry = implementation defined |
The list of TensorIndexTypes of the result of the expression. | |
using | index_list = implementation defined |
The list of TensorIndexTypes of the result of the expression. | |
using | args_list = implementation defined |
The list of generic TensorIndex s of the result of the expression. | |
Public Member Functions | |
NumberAsExpression (const type &number) | |
template<typename LhsTensor > | |
void | assert_lhs_tensor_not_in_rhs_expression (const gsl::not_null< LhsTensor * >) const =delete |
template<typename LhsTensorIndices , typename LhsTensor > | |
void | assert_lhs_tensorindices_same_in_rhs (const gsl::not_null< LhsTensor * > lhs_tensor) const =delete |
size_t | get_rhs_tensor_component_size () const =delete |
type | get (const std::array< size_t, num_tensor_indices > &) const |
Returns the number represented by the expression. More... | |
template<typename ResultType > | |
type | get_primary (const ResultType &, const std::array< size_t, num_tensor_indices > &) const |
Returns the number represented by the expression. More... | |
template<typename ResultType > | |
void | evaluate_primary_subtree (ResultType &, const std::array< size_t, num_tensor_indices > &) const =delete |
Static Public Attributes | |
static constexpr auto | num_tensor_indices = 0 |
The number of tensor indices in the result of the expression. | |
static constexpr size_t | num_ops_left_child = 0 |
The number of arithmetic tensor operations done in the subtree for the left operand, which is 0 because this is a leaf expression. | |
static constexpr size_t | num_ops_right_child = 0 |
The number of arithmetic tensor operations done in the subtree for the right operand, which is 0 because this is a leaf expression. | |
static constexpr size_t | num_ops_subtree = 0 |
The total number of arithmetic tensor operations done in this expression's whole subtree, which is 0 because this is a leaf expression. | |
static constexpr size_t | height_relative_to_closest_tensor_leaf_in_subtree |
The height of this expression's node in the expression tree relative to the closest TensorAsExpression leaf in its subtree. Because this expression type is leaf, the height for this type is set to the maximum size_t value to encode a sense of maximal height. More... | |
static constexpr bool | is_primary_end = true |
If on the primary path, whether or not the expression is an ending point of a leg. | |
static constexpr size_t | num_ops_to_evaluate_primary_left_child = 0 |
If on the primary path, this is the remaining number of arithmetic tensor operations that need to be done in the subtree of the child along the primary path, given that we will have already computed the whole subtree at the next lowest leg's starting point. This is just 0 because this expression is a leaf. | |
static constexpr size_t | num_ops_to_evaluate_primary_right_child = 0 |
If on the primary path, this is the remaining number of arithmetic tensor operations that need to be done in the right operand's subtree. This is just 0 because this expression is a leaf. | |
static constexpr size_t | num_ops_to_evaluate_primary_subtree = 0 |
If on the primary path, this is the remaining number of arithmetic tensor operations that need to be done for this expression's subtree, given that we will have already computed the subtree at the next lowest leg's starting point. This is just 0 because this expression is a leaf. | |
static constexpr bool | is_primary_start = false |
If on the primary path, whether or not the expression is a starting point of a leg. | |
static constexpr bool | primary_child_subtree_contains_primary_start = false |
If on the primary path, whether or not the expression's child along the primary path is a subtree that contains a starting point of a leg along the primary path. This is always falls because this expression is a leaf. | |
static constexpr bool | primary_subtree_contains_primary_start |
If on the primary path, whether or not this subtree contains a starting point of a leg along the primary path. More... | |
Defines an expression representing a number.
For details on aliases and members defined in this class, as well as general TensorExpression
terminology used in its members' documentation, see documentation for TensorExpression
.
|
inline |
Returns the number represented by the expression.
Returns: the number represented by this expression
|
inline |
Returns the number represented by the expression.
Returns: the number represented by this expression
|
staticconstexpr |
The height of this expression's node in the expression tree relative to the closest TensorAsExpression
leaf in its subtree. Because this expression type is leaf, the height for this type is set to the maximum size_t
value to encode a sense of maximal height.
|
staticconstexpr |
If on the primary path, whether or not this subtree contains a starting point of a leg along the primary path.