|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Scalar continuous rule driven by a real convolution kernel. More...
#include <tpl_ca_continuous_rules.H>
Public Types | |
| using | value_type = typename Kernel::value_type |
| Numeric type used by the kernel. | |
| using | kernel_type = Kernel |
| Kernel type. | |
Public Member Functions | |
| Continuous_Rule (F func, Kernel kernel, value_type dt=value_type{1}, value_type min_value=-std::numeric_limits< value_type >::infinity(), value_type max_value=std::numeric_limits< value_type >::infinity()) | |
| Build a scalar continuous rule. | |
| const Kernel & | kernel () const noexcept |
| value_type | dt () const noexcept |
| value_type | min_value () const noexcept |
| value_type | max_value () const noexcept |
| template<typename State > | |
| State | operator() (const State ¤t, Neighbor_View< State > neighbours) const |
| Compute the next scalar state. | |
Private Attributes | |
| F | f_ |
| Kernel | kernel_ |
| value_type | dt_ |
| value_type | min_value_ |
| value_type | max_value_ |
Scalar continuous rule driven by a real convolution kernel.
The wrapped functor may expose either:
F(State current, State convolution, Real dt) -> StateF(State current, State convolution) -> Statewhere convolution is kernel.apply(current, neighbours) and neighbours must be gathered with Moore<2, Kernel::radius_v>. Results are checked for finiteness and against the optional output range [min_value, max_value].
| F | callable rule body. |
| Kernel | kernel type, normally Kernel2D<Real, 3, 3> or Kernel2D<Real, 5, 5>. |
Definition at line 139 of file tpl_ca_continuous_rules.H.
| using Aleph::CA::Continuous_Rule< F, Kernel >::kernel_type = Kernel |
Kernel type.
Definition at line 145 of file tpl_ca_continuous_rules.H.
| using Aleph::CA::Continuous_Rule< F, Kernel >::value_type = typename Kernel::value_type |
Numeric type used by the kernel.
Definition at line 143 of file tpl_ca_continuous_rules.H.
|
inline |
Build a scalar continuous rule.
| [in] | func | transition functor. |
| [in] | kernel | convolution kernel. |
| [in] | dt | explicit Euler time step; must be finite and positive. |
| [in] | min_value | minimum accepted next state. |
| [in] | max_value | maximum accepted next state. |
| std::domain_error | if dt or the output interval is invalid. |
Definition at line 164 of file tpl_ca_continuous_rules.H.
|
inlinenoexcept |
Definition at line 184 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Continuous_Rule< F, Kernel >::dt_.
|
inlinenoexcept |
Definition at line 178 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Continuous_Rule< F, Kernel >::kernel_.
|
inlinenoexcept |
Definition at line 196 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Continuous_Rule< F, Kernel >::max_value_.
|
inlinenoexcept |
Definition at line 190 of file tpl_ca_continuous_rules.H.
References Aleph::CA::Continuous_Rule< F, Kernel >::min_value_.
|
inline |
Compute the next scalar state.
| State | float or double. |
| [in] | current | current centre-cell value. |
| [in] | neighbours | values in Moore<2, Kernel::radius_v> order. |
| std::length_error | if neighbour count does not match the kernel. |
| std::runtime_error | if the functor returns a non-finite or out-of-range value. |
Definition at line 212 of file tpl_ca_continuous_rules.H.
References ah_runtime_error_if, Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::Continuous_Rule< F, Kernel >::dt_, Aleph::CA::Continuous_Rule< F, Kernel >::f_, Aleph::CA::Continuous_Rule< F, Kernel >::kernel_, Aleph::CA::Continuous_Rule< F, Kernel >::max_value_, Aleph::CA::Continuous_Rule< F, Kernel >::min_value_, Aleph::next(), and Aleph::CA::ca_continuous_detail::require_finite().
|
private |
Definition at line 150 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Continuous_Rule< F, Kernel >::dt(), and Aleph::CA::Continuous_Rule< F, Kernel >::operator()().
Definition at line 148 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Continuous_Rule< F, Kernel >::operator()().
|
private |
Definition at line 149 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Continuous_Rule< F, Kernel >::kernel(), and Aleph::CA::Continuous_Rule< F, Kernel >::operator()().
|
private |
Definition at line 152 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Continuous_Rule< F, Kernel >::max_value(), and Aleph::CA::Continuous_Rule< F, Kernel >::operator()().
|
private |
Definition at line 151 of file tpl_ca_continuous_rules.H.
Referenced by Aleph::CA::Continuous_Rule< F, Kernel >::min_value(), and Aleph::CA::Continuous_Rule< F, Kernel >::operator()().