Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Continuous_Rule< F, Kernel > Class Template Reference

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 &current, 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_
 

Detailed Description

template<typename F, typename Kernel>
class Aleph::CA::Continuous_Rule< F, Kernel >

Scalar continuous rule driven by a real convolution kernel.

The wrapped functor may expose either:

  • F(State current, State convolution, Real dt) -> State
  • F(State current, State convolution) -> State

where 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].

Template Parameters
Fcallable rule body.
Kernelkernel type, normally Kernel2D<Real, 3, 3> or Kernel2D<Real, 5, 5>.

Definition at line 139 of file tpl_ca_continuous_rules.H.

Member Typedef Documentation

◆ kernel_type

Kernel type.

Definition at line 145 of file tpl_ca_continuous_rules.H.

◆ value_type

template<typename F , typename Kernel >
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.

Constructor & Destructor Documentation

◆ Continuous_Rule()

template<typename F , typename Kernel >
Aleph::CA::Continuous_Rule< F, Kernel >::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() 
)
inline

Build a scalar continuous rule.

Parameters
[in]functransition functor.
[in]kernelconvolution kernel.
[in]dtexplicit Euler time step; must be finite and positive.
[in]min_valueminimum accepted next state.
[in]max_valuemaximum accepted next state.
Exceptions
std::domain_errorif dt or the output interval is invalid.

Definition at line 164 of file tpl_ca_continuous_rules.H.

Member Function Documentation

◆ dt()

template<typename F , typename Kernel >
value_type Aleph::CA::Continuous_Rule< F, Kernel >::dt ( ) const
inlinenoexcept
Returns
the explicit Euler time step.

Definition at line 184 of file tpl_ca_continuous_rules.H.

References Aleph::CA::Continuous_Rule< F, Kernel >::dt_.

◆ kernel()

template<typename F , typename Kernel >
const Kernel & Aleph::CA::Continuous_Rule< F, Kernel >::kernel ( ) const
inlinenoexcept
Returns
the stored convolution kernel.

Definition at line 178 of file tpl_ca_continuous_rules.H.

References Aleph::CA::Continuous_Rule< F, Kernel >::kernel_.

◆ max_value()

template<typename F , typename Kernel >
value_type Aleph::CA::Continuous_Rule< F, Kernel >::max_value ( ) const
inlinenoexcept
Returns
the maximum accepted output value.

Definition at line 196 of file tpl_ca_continuous_rules.H.

References Aleph::CA::Continuous_Rule< F, Kernel >::max_value_.

◆ min_value()

template<typename F , typename Kernel >
value_type Aleph::CA::Continuous_Rule< F, Kernel >::min_value ( ) const
inlinenoexcept
Returns
the minimum accepted output value.

Definition at line 190 of file tpl_ca_continuous_rules.H.

References Aleph::CA::Continuous_Rule< F, Kernel >::min_value_.

◆ operator()()

template<typename F , typename Kernel >
template<typename State >
State Aleph::CA::Continuous_Rule< F, Kernel >::operator() ( const State &  current,
Neighbor_View< State >  neighbours 
) const
inline

Compute the next scalar state.

Template Parameters
Statefloat or double.
Parameters
[in]currentcurrent centre-cell value.
[in]neighboursvalues in Moore<2, Kernel::radius_v> order.
Returns
next scalar state.
Exceptions
std::length_errorif neighbour count does not match the kernel.
std::runtime_errorif 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().

Member Data Documentation

◆ dt_

◆ f_

◆ kernel_

◆ max_value_

◆ min_value_


The documentation for this class was generated from the following file: