WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
slp::detail Namespace Reference

Classes

class  GradientExpressionGraph
 This class is an adapter type that performs value updates of an expression graph, generates a gradient tree, or appends gradient triplets for creating a sparse matrix of gradients. More...
struct  Expression
 An autodiff expression node. More...
struct  BinaryMinusExpression
 Derived expression type for binary minus operator. More...
struct  BinaryPlusExpression
 Derived expression type for binary plus operator. More...
struct  ConstantExpression
 Derived expression type for constant. More...
struct  DivExpression
 Derived expression type for binary division operator. More...
struct  MultExpression
 Derived expression type for binary multiplication operator. More...
struct  UnaryMinusExpression
 Derived expression type for unary minus operator. More...
struct  CbrtExpression
 Derived expression type for cbrt(). More...
struct  DecisionVariableExpression
 Derived expression type for decision variable. More...
struct  AbsExpression
 Derived expression type for abs(). More...
struct  AcosExpression
 Derived expression type for acos(). More...
struct  AsinExpression
 Derived expression type for asin(). More...
struct  AtanExpression
 Derived expression type for atan(). More...
struct  Atan2Expression
 Derived expression type for atan2(). More...
struct  CosExpression
 Derived expression type for cos(). More...
struct  CoshExpression
 Derived expression type for cosh(). More...
struct  ErfExpression
 Derived expression type for erf(). More...
struct  ExpExpression
 Derived expression type for exp(). More...
struct  HypotExpression
 Derived expression type for hypot(). More...
struct  LogExpression
 Derived expression type for log(). More...
struct  Log10Expression
 Derived expression type for log10(). More...
struct  PowExpression
 Derived expression type for pow(). More...
struct  SignExpression
 Derived expression type for sign(). More...
struct  SinExpression
 Derived expression type for sin(). More...
struct  SinhExpression
 Derived expression type for sinh(). More...
struct  SqrtExpression
 Derived expression type for sqrt(). More...
struct  TanExpression
 Derived expression type for tan(). More...
struct  TanhExpression
 Derived expression type for tanh(). More...
struct  empty_t
 Type tag used to designate an uninitialized VariableMatrix. More...

Typedefs

template<typename Scalar>
using ExpressionPtr = IntrusiveSharedPtr<Expression<Scalar>>
 Typedef for intrusive shared pointer to Expression.

Functions

template<typename Scalar>
gch::small_vector< Expression< Scalar > * > topological_sort (const ExpressionPtr< Scalar > &root)
 Generate a topological sort of an expression graph from parent to child.
template<typename Scalar>
void update_values (const gch::small_vector< Expression< Scalar > * > &list)
 Update the values of all nodes in this graph based on the values of their dependent nodes.
template<typename Scalar>
constexpr void inc_ref_count (Expression< Scalar > *expr)
 Refcount increment for intrusive shared pointer.
template<typename Scalar>
void dec_ref_count (Expression< Scalar > *expr)
 Refcount decrement for intrusive shared pointer.
template<typename T, typename... Args>
static ExpressionPtr< typename T::Scalar > make_expression_ptr (Args &&... args)
 Creates an intrusive shared pointer to an expression from the global pool allocator.
template<typename Scalar>
ExpressionPtr< Scalar > constant_ptr (Scalar value)
 Creates an intrusive shared pointer to a constant expression.
template<typename Scalar>
ExpressionPtr< Scalar > cbrt (const ExpressionPtr< Scalar > &x)
 cbrt() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > exp (const ExpressionPtr< Scalar > &x)
 exp() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > sin (const ExpressionPtr< Scalar > &x)
 sin() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > sinh (const ExpressionPtr< Scalar > &x)
 sinh() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > sqrt (const ExpressionPtr< Scalar > &x)
 sqrt() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > abs (const ExpressionPtr< Scalar > &x)
 abs() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > acos (const ExpressionPtr< Scalar > &x)
 acos() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > asin (const ExpressionPtr< Scalar > &x)
 asin() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > atan (const ExpressionPtr< Scalar > &x)
 atan() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > atan2 (const ExpressionPtr< Scalar > &y, const ExpressionPtr< Scalar > &x)
 atan2() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > cos (const ExpressionPtr< Scalar > &x)
 cos() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > cosh (const ExpressionPtr< Scalar > &x)
 cosh() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > erf (const ExpressionPtr< Scalar > &x)
 erf() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > hypot (const ExpressionPtr< Scalar > &x, const ExpressionPtr< Scalar > &y)
 hypot() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > log (const ExpressionPtr< Scalar > &x)
 log() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > log10 (const ExpressionPtr< Scalar > &x)
 log10() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > pow (const ExpressionPtr< Scalar > &base, const ExpressionPtr< Scalar > &power)
 pow() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > sign (const ExpressionPtr< Scalar > &x)
 sign() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > tan (const ExpressionPtr< Scalar > &x)
 tan() for Expressions.
template<typename Scalar>
ExpressionPtr< Scalar > tanh (const ExpressionPtr< Scalar > &x)
 tanh() for Expressions.

Variables

constexpr bool USE_POOL_ALLOCATOR = true
static constexpr empty_t empty {}
 Designates an uninitialized VariableMatrix.

Typedef Documentation

◆ ExpressionPtr

template<typename Scalar>
using slp::detail::ExpressionPtr = IntrusiveSharedPtr<Expression<Scalar>>

Typedef for intrusive shared pointer to Expression.

Template Parameters
ScalarScalar type.

Function Documentation

◆ abs()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::abs ( const ExpressionPtr< Scalar > & x)

abs() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ acos()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::acos ( const ExpressionPtr< Scalar > & x)

acos() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ asin()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::asin ( const ExpressionPtr< Scalar > & x)

asin() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ atan()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::atan ( const ExpressionPtr< Scalar > & x)

atan() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ atan2()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::atan2 ( const ExpressionPtr< Scalar > & y,
const ExpressionPtr< Scalar > & x )

atan2() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
yThe y argument.
xThe x argument.

◆ cbrt()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::cbrt ( const ExpressionPtr< Scalar > & x)

cbrt() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ constant_ptr()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::constant_ptr ( Scalar value)

Creates an intrusive shared pointer to a constant expression.

Template Parameters
ScalarScalar type.
Parameters
valueThe expression value.

◆ cos()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::cos ( const ExpressionPtr< Scalar > & x)

cos() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ cosh()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::cosh ( const ExpressionPtr< Scalar > & x)

cosh() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ dec_ref_count()

template<typename Scalar>
void slp::detail::dec_ref_count ( Expression< Scalar > * expr)

Refcount decrement for intrusive shared pointer.

Template Parameters
ScalarScalar type.
Parameters
exprThe shared pointer's managed object.

◆ erf()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::erf ( const ExpressionPtr< Scalar > & x)

erf() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ exp()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::exp ( const ExpressionPtr< Scalar > & x)

exp() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ hypot()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::hypot ( const ExpressionPtr< Scalar > & x,
const ExpressionPtr< Scalar > & y )

hypot() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe x argument.
yThe y argument.

◆ inc_ref_count()

template<typename Scalar>
void slp::detail::inc_ref_count ( Expression< Scalar > * expr)
constexpr

Refcount increment for intrusive shared pointer.

Template Parameters
ScalarScalar type.
Parameters
exprThe shared pointer's managed object.

◆ log()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::log ( const ExpressionPtr< Scalar > & x)

log() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ log10()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::log10 ( const ExpressionPtr< Scalar > & x)

log10() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ make_expression_ptr()

template<typename T, typename... Args>
ExpressionPtr< typename T::Scalar > slp::detail::make_expression_ptr ( Args &&... args)
static

Creates an intrusive shared pointer to an expression from the global pool allocator.

Template Parameters
TThe derived expression type.
Parameters
argsConstructor arguments for Expression.

◆ pow()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::pow ( const ExpressionPtr< Scalar > & base,
const ExpressionPtr< Scalar > & power )

pow() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
baseThe base.
powerThe power.

◆ sign()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::sign ( const ExpressionPtr< Scalar > & x)

sign() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ sin()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::sin ( const ExpressionPtr< Scalar > & x)

sin() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ sinh()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::sinh ( const ExpressionPtr< Scalar > & x)

sinh() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ sqrt()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::sqrt ( const ExpressionPtr< Scalar > & x)

sqrt() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ tan()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::tan ( const ExpressionPtr< Scalar > & x)

tan() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ tanh()

template<typename Scalar>
ExpressionPtr< Scalar > slp::detail::tanh ( const ExpressionPtr< Scalar > & x)

tanh() for Expressions.

Template Parameters
ScalarScalar type.
Parameters
xThe argument.

◆ topological_sort()

template<typename Scalar>
gch::small_vector< Expression< Scalar > * > slp::detail::topological_sort ( const ExpressionPtr< Scalar > & root)

Generate a topological sort of an expression graph from parent to child.

https://en.wikipedia.org/wiki/Topological_sorting

Template Parameters
ScalarScalar type.
Parameters
rootThe root node of the expression.

◆ update_values()

template<typename Scalar>
void slp::detail::update_values ( const gch::small_vector< Expression< Scalar > * > & list)

Update the values of all nodes in this graph based on the values of their dependent nodes.

Template Parameters
ScalarScalar type.
Parameters
listTopological sort of graph from parent to child.

Variable Documentation

◆ empty

empty_t slp::detail::empty {}
staticconstexpr

Designates an uninitialized VariableMatrix.

◆ USE_POOL_ALLOCATOR

bool slp::detail::USE_POOL_ALLOCATOR = true
inlineconstexpr