stator
A math, geometry, and utility library
Classes | Typedefs | Functions
stator::detail Namespace Reference

Namespace containing the details of the implmentation for general stator components.

Classes

struct  BPVisitor
 Binding power visitor for sym::detail::BP(const Expr&). More...
 
class  choice
 A class which recursively inherits from itself to allow ambiguous function definition ordering. More...
 
struct  choice< LAST_OVERLOAD_LVL >
 The lowest-priority overload level (closing the recursion) More...
 
struct  dependent_false
 
struct  dependent_true
 
struct  ReprVisitor
 
struct  Rounding_digits_ID
 
struct  select_overload
 A class used to start the ambiguous function definition ordering calculation. More...
 

Typedefs

typedef choice< LAST_OVERLOAD_LVL > last_choice
 

Functions

template<class T >
std::pair< int, int > BP (const T &v)
 Returns the binding powers (precedence) of binary operators. More...
 
template<class LHS , class Op , class RHS >
std::pair< int, int > BP (const sym::BinaryOp< LHS, Op, RHS > &v)
 Returns the binding powers (precedence) of binary operators (specialisation for binary ops). More...
 
std::pair< int, int > BP (const sym::Expr &v)
 Returns the binding powers (precedence) of binary operators (specialisation for Expr). More...
 
template<class Config >
std::string paren_wrap (std::string arg)
 
template<class T >
auto store (const T &val) -> decltype(store_impl(val, select_overload
 
template<class T >
auto store_impl (T val, choice< 0 >) -> decltype(typename std::decay< decltype(std::declval< T >().eval())>::type(val))
 
template<class T >
auto store_impl (T val, choice< 1 >) -> decltype(typename std::decay< T >::type(val))
 

Typedef Documentation

◆ last_choice

typedef choice<LAST_OVERLOAD_LVL> stator::detail::last_choice

Definition at line 73 of file config.hpp.

Function Documentation

◆ BP() [1/3]

template<class T >
std::pair<int, int> stator::detail::BP ( const T &  v)

As unary operators/tokens have no arguments which can be bound by other operators, we return a large binding power (which should exclude them from any binding power calculations).

Definition at line 163 of file print.hpp.

◆ BP() [2/3]

template<class LHS , class Op , class RHS >
std::pair<int, int> stator::detail::BP ( const sym::BinaryOp< LHS, Op, RHS > &  v)

Definition at line 170 of file print.hpp.

◆ BP() [3/3]

std::pair<int, int> stator::detail::BP ( const sym::Expr v)

Definition at line 194 of file print.hpp.

◆ paren_wrap()

template<class Config >
std::string stator::detail::paren_wrap ( std::string  arg)

Definition at line 201 of file print.hpp.

◆ store()

template<class T >
auto stator::detail::store ( const T &  val) -> decltype( store_impl(val, select_overload

Determine the type which can permanently store the passed Type (an extension of std::decay).

This should determine the underlying type which is capable of storing a given type. Generally, this is just std::decay; however, libraries (such as Eigen) uses delayed evaluation thus we need to determine the resulting type to avoid aliasing issues.

StoreType<decltype(A + B)>::type val = A + B;

Definition at line 94 of file config.hpp.

◆ store_impl() [1/2]

template<class T >
auto stator::detail::store_impl ( val,
choice< 0 >   
) -> decltype( typename std::decay<decltype(std::declval<T>().eval())>::type(val) )

Definition at line 78 of file config.hpp.

◆ store_impl() [2/2]

template<class T >
auto stator::detail::store_impl ( val,
choice< 1 >   
) -> decltype( typename std::decay<T>::type(val) )

Definition at line 79 of file config.hpp.