Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::expressive Namespace Reference

Mathematical expressions of spatio-temporal quantities. More...

Classes

struct  Callable_traits
 
struct  Callable_traits< compose_t< Outer, Inners... > >
 
struct  Callable_traits< make_expression_t< F > >
 
struct  Callable_traits< Ret(*)(Args...)>
 
struct  Callable_traits< Ret(Args...)>
 
struct  Callable_traits< Ret(Class::*)(Args...) const >
 
struct  Callable_traits< symetric_binop_t< FL, Operator, FR > >
 
struct  Callable_traits< unop_t< Operator, F > >
 
struct  compose_t
 
struct  compose_t< Outer >
 
struct  compose_t< Outer, Inner >
 
struct  composite_functor
 
struct  composite_functor< F >
 
struct  literal_factory
 Transforms literals into operator friendly classes. More...
 
struct  literal_t
 
struct  make_expression_t
 
struct  symetric_binop_t
 
struct  unop_t
 

Typedefs

template<typename Callable >
using return_type = typename Callable_traits< Callable >::return_type
 
template<typename Callable >
using arguments_type = typename Callable_traits< Callable >::arguments_type
 
template<typename Callable , std::size_t I>
using argument_type = typename std::tuple_element< I, typename Callable_traits< Callable >::arguments_type >::type
 
template<typename Functor , typename Interface >
using functor_has_interface = std::is_convertible< Interface, typename Callable_traits< Functor >::arguments_type >
 
template<typename Functor , typename... Args>
using callable_with = std::is_convertible< arguments_type< void(Args...)>, arguments_type< Functor > >
 
template<typename Operator , typename T >
using applied_unary_type = decltype(std::declval< Operator >()(std::declval< T >()))
 
template<typename A , typename Operator , typename B >
using applied_binary_type = decltype(std::declval< Operator >()(std::declval< A >(), std::declval< B >()))
 

Functions

template<typename Callable >
constexpr auto arguments_count ()
 
template<typename F >
constexpr auto expression (F f)
 
template<typename F >
constexpr auto use (F f)
 Transforms functions into operator friendly classes.
 
template<typename F >
constexpr auto function (F f)
 
template<typename... Args, typename T >
constexpr auto literal (T t)
 Transforms literals into operator friendly classes.
 
template<typename Op , typename T >
constexpr auto is_applicable_unary_impl (int) -> decltype(std::declval< applied_unary_type< Op, T > >(), bool())
 
template<typename Op , typename T >
constexpr bool is_applicable_unary_impl (...)
 
template<typename A , typename Op , typename B >
constexpr auto is_applicable_binary_impl (int) -> decltype(std::declval< applied_binary_type< A, Op, B > >(), bool())
 
template<typename A , typename Op , typename B >
constexpr bool is_applicable_binary_impl (...)
 
template<typename Operator , typename T >
constexpr bool is_applicable_unary ()
 
template<typename A , typename Operator , typename B >
constexpr bool is_applicable_binary ()
 
template<typename F >
constexpr auto operator- (F f)
 
template<typename F1 , typename F2 >
constexpr auto operator+ (F1 f1, F2 f2)
 
template<typename F1 , typename F2 >
constexpr auto operator- (F1 f1, F2 f2)
 
template<typename F1 , typename F2 >
constexpr auto operator* (F1 f1, F2 f2)
 
template<typename F1 , typename F2 >
constexpr auto operator/ (F1 f1, F2 f2)
 
template<typename F1 , typename F2 >
constexpr auto operator% (F1 f1, F2 f2)
 
template<typename F , typename... Fs>
constexpr auto compose (F f, Fs... fs)
 Mathematical function composition
 
template<typename F >
constexpr auto chain (F f)
 
template<typename Inner , typename Outer >
constexpr auto operator>> (Inner inner, Outer outer)
 Mathematical function composition
 
template<typename Inner , typename Outer >
constexpr auto operator<< (Outer outer, Inner inner)
 Mathematical function composition
 
template<typename F1 , typename F2 , typename... Fs>
constexpr auto chain (F1 f1, F2 f2, Fs... fs)
 Mathematical function composition
 
template<typename T >
std::ostream & operator<< (std::ostream &os, std::negate< T > const &)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, std::plus< T > const &)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, std::minus< T > const &)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, std::multiplies< T > const &)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, std::divides< T > const &)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, std::modulus< T > const &)
 
template<typename T , typename... Args>
std::ostream & operator<< (std::ostream &os, literal_t< T, Args... > const &l)
 
template<typename Operator , typename F >
std::ostream & operator<< (std::ostream &os, unop_t< Operator, F > const &f)
 
template<typename F1 , typename Operator , typename F2 >
std::ostream & operator<< (std::ostream &os, symetric_binop_t< F1, Operator, F2 > const &f)
 

Detailed Description

Mathematical expressions of spatio-temporal quantities.

Function Documentation

◆ chain()

template<typename F1 , typename F2 , typename... Fs>
constexpr auto quetzal::expressive::chain ( F1  f1,
F2  f2,
Fs...  fs 
)
constexpr

Mathematical function composition

Forms an expression in which the outputs of the inner functions become the input of the outer function.

Parameters
f1the outer function
f2the inner function: its output is the input of f1
fsthe inner functions: their output are the input of f2

◆ compose()

template<typename F , typename... Fs>
constexpr auto quetzal::expressive::compose ( f,
Fs...  fs 
)
constexpr

Mathematical function composition

Forms an expression in which the outputs of the inner functions become the input of the outer function.

Parameters
fthe outer function
fsthe inner functions

◆ literal()

template<typename... Args, typename T >
constexpr auto quetzal::expressive::literal ( t)
constexpr

Transforms literals into operator friendly classes.

Transforms a literal object into operator friendly class, allowing it to be composed into a more complex expression using mathematical operators with others expressive objects having compatible callable interface.

Template Parameters
Tthe literal type
Argsthe callable interface arguments to which the literal should be transformed

◆ operator<<()

template<typename Inner , typename Outer >
constexpr auto quetzal::expressive::operator<< ( Outer  outer,
Inner  inner 
)
constexpr

Mathematical function composition

Forms an expression in which the output of the inner function becomes the input of the outer function.

Parameters
outerthe outer function
innerthe inner function

◆ operator>>()

template<typename Inner , typename Outer >
constexpr auto quetzal::expressive::operator>> ( Inner  inner,
Outer  outer 
)
constexpr

Mathematical function composition

Forms an expression in which the output of the inner function becomes the input of the outer function.

Parameters
innerthe inner function
outerthe inner functions

◆ use()

template<typename F >
constexpr auto quetzal::expressive::use ( f)
constexpr

Transforms functions into operator friendly classes.

Transforms a function object into operator friendly class, allowing it to be composed into a more complex expression using mathematical operators with others expressive objects having compatible callable interface.

Parameters
fa function object