31 #include <Eigen/Dense> 36 #include <type_traits> 71 static constexpr
bool value = std::is_base_of<SymbolicOperator, T>::value;
76 template<
class Var,
class Arg>
struct Relation {
77 Relation(
const Var var,
const Arg& val): _var(var), _val(val) {}
105 template<
typename Var1,
typename Var2>
107 static constexpr
const bool value = Var1::idx == Var2::idx;
110 template<
typename Var1,
typename Var2>
114 template<
typename Var1,
typename Var2>
118 template<
typename Var1,
typename Var2>
132 struct IsConstant : std::conditional<std::is_arithmetic<T>::value || is_C<T>::value || std::is_base_of<Eigen::EigenBase<T>, T>::value, std::true_type, std::false_type>::type {};
140 constexpr
typename std::enable_if<detail::IsConstant<T>::value,
bool>::type
is_constant(
const T&) {
return true;}
143 constexpr
typename std::enable_if<!detail::IsConstant<T>::value,
bool>::type
is_constant(
const T&) {
return false;}
152 template<class T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
155 template<
class T,
typename =
typename std::enable_if<std::is_base_of<Eigen::EigenBase<T>, T>::value>::type>
172 template<
class T,
class Var,
class Arg,
173 typename =
typename std::enable_if<detail::IsConstant<T>::value>::type >
181 template<
typename ...Args1,
typename ...Args2,
class Arg,
191 template<
class ...Args1,
class Arg,
class Var2,
202 template<
class T,
class ...Args,
203 typename =
typename std::enable_if<detail::IsConstant<T>::value>::type>
212 template<
class ...Args1,
class ...Args2,
213 typename =
typename std::enable_if<!std::is_base_of<
Dynamic, Var<Args1...> >::value && !std::is_base_of<Dynamic, Var<Args2...> >::value>::type>
227 template<
class ...Args1,
class ...Args2,
228 typename =
typename std::enable_if<!std::is_base_of<Dynamic, Var<Args1...> >::value && !std::is_base_of<Dynamic, Var<Args2...> >::value>::type>
237 template<
class F,
class Real,
238 typename =
typename std::enable_if<detail::IsConstant<F>::value>::type>
245 template<
class F,
class Real,
246 typename =
typename std::enable_if<detail::IsConstant<F>::value>::type>
251 template<
size_t Order,
class Real =
double,
class PolyVar = Var<>>
class Polynomial;
#define STATOR_AUTORETURN_BYVALUE(EXPR)
A convenience Macro for defining auto by-value return type functions.
Relation(const Var var, const Arg &val)
A class which recursively inherits from itself to allow ambiguous function definition ordering...
bool is_constant(const Expr &a)
Symbolic representation of a variable.
C< 0 > Null
A symbolic representation of zero.
Relation< Var< Args... >, Arg > operator=(const Arg &a) const
F shift_function(const F &f, const Real t)
Shift a function forward. It returns .
Fundamental typedef's and macros for stator.
Stack-allocated equivalent of std::vector.
A class representing a compile-time rational constant (i.e., std::ratio).
choice< LAST_OVERLOAD_LVL > last_choice
Template argument for dynamic types, as well as their base class.
StackVector< double, 0 > solve_real_roots(Null f)
C< 1 > Unity
A symbolic representation of one.
Symbolic representation of a variable substitution.
static constexpr const auto idx
The stator symbolic math library.
T empty_sum(const T &)
Returns the empty sum of a type.
auto sub(BinaryOp< LHS, Op, RHS > f, Relation< Var, Arg > x) -> STATOR_AUTORETURN_BYVALUE(Op::apply(sub(f._l, x), sub(f._r, x)))
Integration support for the stator::symbolic library.
auto derivative(const Expression &)
Performs a symbolic derivative on the expression.
A type trait to denote symbolic terms (i.e., one that is not yet immediately evaluable to a "normal" ...
Type trait to determine if a certain type is a constant.
double precision(const F &f, const Real)
Estimate the error in evaluating a function at a given time.
Var< vidx< Var1::idx > > type
A class used to start the ambiguous function definition ordering calculation.
auto store(const T &val) -> decltype(store_impl(val, select_overload
Array representation of Polynomial.