|
|
template<typename V , typename P , std::enable_if_t< values::value< V > and pattern_collection< P > and stdex::constructible_from< Value, V &&> and stdex::constructible_from< Pattern, P &&>, int > = 0> |
| constexpr | constant_adapter (V &&v, P &&p) |
| | Construct from value and a pattern_collection.
|
| |
|
template<typename V , typename S , std::enable_if_t< values::value< V > and stdex::constructible_from< Value, V &&> and stdex::constructible_from< Pattern, decltype(get_pattern_collection(std::declval< S &&>()))>, int > = 0> |
| constexpr | constant_adapter (V &&v, S &&s) |
| | Construct from value and a reference to an indexible object.
|
| |
| template<typename V , typename S , std::enable_if_t< values::value< V > and stdex::constructible_from< Value, V &&> and coordinates::fixed_pattern_collection< Pattern >, int > = 0> |
| constexpr | constant_adapter (V &&v) |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
|
| |
| template<bool Enable, std::enable_if_t< Enable and values::fixed< Value > and coordinates::fixed_pattern_collection< Pattern >, int > = 0> |
| constexpr | constant_adapter () |
| | This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
|
| |
|
template<typename Arg , std::enable_if_t< constant_object< Arg > and(not stdex::same_as< std::decay_t< Arg >, constant_adapter >) and stdex::constructible_from< Value, constant_value< Arg >> and stdex::constructible_from< Pattern, decltype(get_pattern_collection(std::declval< Arg &&>()))>, int > = 0> |
| constexpr | constant_adapter (Arg &&arg) |
| | Construct from another constant_object.
|
| |
|
template<typename Arg , std::enable_if_t< constant_object< Arg > and(not stdex::same_as< std::decay_t< Arg >, constant_adapter >) and stdex::assignable_from< Value &, constant_value< Arg >> and stdex::assignable_from< Pattern &, decltype(get_pattern_collection(std::declval< Arg &&>()))>, int > = 0> |
| constexpr auto & | operator= (const Arg &arg) |
| | Assign from a compatible constant_object.
|
| |
| template<typename Indices , std::enable_if_t< index_collection_for< Indices, Shape > and(not empty_object< PatternMatrix >), int > = 0> |
| constexpr auto | operator[] (const Indices &indices) const |
| | Access a component at a set of indices. More...
|
| |
|
constexpr auto | value () const |
| | Get the values::scalar associated with this object.
|
| |
template<typename Value, typename Shape>
struct OpenKalman::constant_adapter< Value, Shape >
A tensor or other matrix in which all elements are a constant value.
The constant value can be any values::value. Examples:
using T = Eigen::Matrix<double, 3, 2>;
constant_adapter<double, T> c1 {3.0};
constant_adapter<int, T> c2 {3};
constant_adapter<value::fixed_value<int, 1>, T> c3;
constant_adapter<value::fixed_value<double, 1, T> c4;
constant_adapter<std::integral_constant<int, 1>, T> c5;
constant_adapter<value::fixed_value<std::complex<double>, T> c6 {std::complex<double>{4, 5}};
constant_adapter<value::fixed_value<std::complex<double, 4, 5>, T> c7;
- Template Parameters
-
template<typename Value, typename Shape>
template<typename V , typename S , std::enable_if_t< values::value< V > and stdex::constructible_from< Value, V &&> and coordinates::fixed_pattern_collection< Pattern >, int > = 0>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Same as above, if the pattern_collection associated with Shape is known at compile time.
template<typename Value, typename Shape>
template<bool Enable, std::enable_if_t< Enable and values::fixed< Value > and coordinates::fixed_pattern_collection< Pattern >, int > = 0>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Default constructor, assuming the constant and the shape are known at compile time.
template<typename Value, typename Shape>
template<typename Indices , std::enable_if_t< index_collection_for< Indices, Shape > and(not empty_object< PatternMatrix >), int > = 0>
Access a component at a set of indices.
- Returns
- The element corresponding to the indices (always the constant).