Namespaces | |
test | |
Classes | |
struct | BasisElementGradedReverseLexOrder |
Implements Graded reverse lexicographic order. More... | |
class | BinaryExpressionCell |
Represents the base class for binary expressions. More... | |
class | ChebyshevBasisElement |
ChebyshevBasisElement represents an element of Chebyshev polynomial basis, written as the product of Chebyshev polynomials, in the form Tₚ₀(x₀)Tₚ₁(x₁)...Tₚₙ(xₙ), where each Tₚᵢ(xᵢ) is a (univariate) Chebyshev polynomial of degree pᵢ. More... | |
class | ChebyshevPolynomial |
Represents the Chebyshev polynomial of the first kind Tₙ(x). More... | |
class | CodeGenVisitor |
Visitor class for code generation. More... | |
class | Environment |
Represents a symbolic environment (mapping from a variable to a value). More... | |
class | Expression |
Represents a symbolic form of an expression. More... | |
class | ExpressionAbs |
Symbolic expression representing absolute value function. More... | |
class | ExpressionAcos |
Symbolic expression representing arccosine function. More... | |
class | ExpressionAdd |
Symbolic expression representing an addition which is a sum of products. More... | |
class | ExpressionAddFactory |
Factory class to help build ExpressionAdd expressions. More... | |
class | ExpressionAsin |
Symbolic expression representing arcsine function. More... | |
class | ExpressionAtan |
Symbolic expression representing arctangent function. More... | |
class | ExpressionAtan2 |
Symbolic expression representing atan2 function (arctangent function with two arguments). More... | |
class | ExpressionCeiling |
Symbolic expression representing ceil function. More... | |
class | ExpressionCell |
Represents an abstract class which is the base of concrete symbolic-expression classes. More... | |
class | ExpressionCos |
Symbolic expression representing cosine function. More... | |
class | ExpressionCosh |
Symbolic expression representing hyperbolic cosine function. More... | |
class | ExpressionDiv |
Symbolic expression representing division. More... | |
class | ExpressionExp |
Symbolic expression representing exponentiation using the base of natural logarithms. More... | |
class | ExpressionFloor |
Symbolic expression representing floor function. More... | |
class | ExpressionIfThenElse |
Symbolic expression representing if-then-else expression. More... | |
class | ExpressionLog |
Symbolic expression representing logarithms. More... | |
class | ExpressionMax |
Symbolic expression representing max function. More... | |
class | ExpressionMin |
Symbolic expression representing min function. More... | |
class | ExpressionMul |
Symbolic expression representing a multiplication of powers. More... | |
class | ExpressionMulFactory |
Factory class to help build ExpressionMul expressions. More... | |
class | ExpressionNaN |
Symbolic expression representing NaN (not-a-number). More... | |
class | ExpressionPow |
Symbolic expression representing power function. More... | |
class | ExpressionSin |
Symbolic expression representing sine function. More... | |
class | ExpressionSinh |
Symbolic expression representing hyperbolic sine function. More... | |
class | ExpressionSqrt |
Symbolic expression representing square-root. More... | |
class | ExpressionTan |
Symbolic expression representing tangent function. More... | |
class | ExpressionTanh |
Symbolic expression representing hyperbolic tangent function. More... | |
class | ExpressionUninterpretedFunction |
Symbolic expression representing an uninterpreted function. More... | |
class | ExpressionVar |
Symbolic expression representing a variable. More... | |
class | Formula |
Represents a symbolic form of a first-order logic formula. More... | |
class | FormulaAnd |
Symbolic formula representing conjunctions (f1 ∧ ... More... | |
class | FormulaCell |
Represents an abstract class which is the base of concrete symbolic-formula classes (i.e. More... | |
class | FormulaEq |
Symbolic formula representing equality (e1 = e2). More... | |
class | FormulaFalse |
Symbolic formula representing false. More... | |
class | FormulaForall |
Symbolic formula representing universal quantifications (∀ x₁, ..., * xn. More... | |
class | FormulaGeq |
Symbolic formula representing 'greater-than-or-equal-to' (e1 ≥ e2). More... | |
class | FormulaGt |
Symbolic formula representing 'greater-than' (e1 > e2). More... | |
class | FormulaIsnan |
Symbolic formula representing isnan predicate. More... | |
class | FormulaLeq |
Symbolic formula representing 'less-than-or-equal-to' (e1 ≤ e2). More... | |
class | FormulaLt |
Symbolic formula representing 'less-than' (e1 < e2). More... | |
class | FormulaNeq |
Symbolic formula representing disequality (e1 ≠ e2). More... | |
class | FormulaNot |
Symbolic formula representing negations (¬f). More... | |
class | FormulaOr |
Symbolic formula representing disjunctions (f1 ∨ ... More... | |
class | FormulaPositiveSemidefinite |
Symbolic formula representing positive-semidefinite (PSD) constraint. More... | |
class | FormulaTrue |
Symbolic formula representing true. More... | |
class | FormulaVar |
Symbolic formula representing a Boolean variable. More... | |
class | GenericPolynomial |
Represents symbolic generic polynomials using a given basis (for example, monomial basis, Chebyshev basis, etc). More... | |
struct | GradedReverseLexOrder |
Implements Graded reverse lexicographic order. More... | |
class | Monomial |
Represents a monomial, a product of powers of variables with non-negative integer exponents. More... | |
class | MonomialBasisElement |
MonomialBasisElement represents a monomial, a product of powers of variables with non-negative integer exponents. More... | |
class | NaryFormulaCell |
Represents the base class for N-ary logic operators (∧ and ∨). More... | |
class | Polynomial |
Represents symbolic polynomials. More... | |
class | PolynomialBasisElement |
Each polynomial p(x) can be written as a linear combination of its basis elements p(x) = ∑ᵢ cᵢ * ϕᵢ(x), where ϕᵢ(x) is the i'th element in the basis, cᵢ is the coefficient of that element. More... | |
class | RationalFunction |
Represents symbolic rational function. More... | |
class | RelationalFormulaCell |
Represents the base class for relational operators (==, !=, <, <=, >, >=). More... | |
class | RewritingRule |
A RewritingRule , lhs => rhs , consists of two Patterns lhs and rhs . More... | |
struct | SinCos |
Represents a pair of Variables corresponding to sin(q) and cos(q). More... | |
class | UnaryExpressionCell |
Represents the base class for unary expressions. More... | |
class | Variable |
Represents a symbolic variable. More... | |
class | Variables |
Represents a set of variables. More... | |
Typedefs | |
using | Substitution = std::unordered_map< Variable, Expression > |
template<typename BasisElement > | |
using | GenericPolynomialEnable = std::enable_if_t< std::is_base_of_v< PolynomialBasisElement, BasisElement >, GenericPolynomial< BasisElement > > |
Defines an explicit SFINAE alias for use with return types to dissuade CTAD from trying to instantiate an invalid GenericElement<> for operator overloads, (if that's actually the case). More... | |
using | Pattern = Expression |
A pattern is an expression which possibly includes variables which represent placeholders. More... | |
using | Rewriter = std::function< Expression(const Expression &)> |
A Rewriter is a function from an Expression to an Expression. More... | |
using | SinCosSubstitution = std::unordered_map< Variable, SinCos > |
Enumerations | |
enum | ExpressionKind : std::uint16_t { Constant = 0, Var = 0x7FF1u, Add, Mul, Div, Log, Abs, Exp, Sqrt, Pow, Sin, Cos, Tan, Asin, Acos, Atan, Atan2 = 0xFFF1u, Sinh, Cosh, Tanh, Min, Max, Ceil, Floor, IfThenElse, NaN, UninterpretedFunction } |
Kinds of symbolic expressions. More... | |
enum | FormulaKind { False, True, Var, Eq, Neq, Gt, Geq, Lt, Leq, And, Or, Not, Forall, Isnan, PositiveSemidefinite } |
Kinds of symbolic formulas. More... | |
enum | SinCosSubstitutionType { kAngle, kHalfAnglePreferSin, kHalfAnglePreferCos } |
Functions | |
std::map< ChebyshevBasisElement, double > | operator * (const ChebyshevBasisElement &a, const ChebyshevBasisElement &b) |
Returns the product of two Chebyshev basis elements. More... | |
std::ostream & | operator<< (std::ostream &out, const ChebyshevBasisElement &m) |
std::ostream & | operator<< (std::ostream &out, const ChebyshevPolynomial &p) |
double | EvaluateChebyshevPolynomial (double var_val, int degree) |
Evaluates a Chebyshev polynomial at a given value. More... | |
std::string | CodeGen (const std::string &function_name, const std::vector< Variable > ¶meters, const Expression &e) |
For a given symbolic expression e , generates two C functions, <function_name> and <function_name>_meta . More... | |
template<typename Derived > | |
std::string | CodeGen (const std::string &function_name, const std::vector< Variable > ¶meters, const Eigen::PlainObjectBase< Derived > &M) |
For a given symbolic dense matrix M , generates two C functions, <function_name> and <function_name>_meta . More... | |
std::string | CodeGen (const std::string &function_name, const std::vector< Variable > ¶meters, const Eigen::Ref< const Eigen::SparseMatrix< Expression, Eigen::ColMajor >> &M) |
For a given symbolic column-major sparse matrix M , generates two C functions, <function_name> and <function_name>_meta . More... | |
bool | IsAffine (const Eigen::Ref< const MatrixX< Expression >> &m, const Variables &vars) |
Checks if every element in m is affine in vars . More... | |
bool | IsAffine (const Eigen::Ref< const MatrixX< Expression >> &m) |
Checks if every element in m is affine. More... | |
void | DecomposeLinearExpressions (const Eigen::Ref< const VectorX< Expression >> &expressions, const Eigen::Ref< const VectorX< Variable >> &vars, EigenPtr< Eigen::MatrixXd > M) |
Decomposes expressions into M * vars . More... | |
void | DecomposeAffineExpressions (const Eigen::Ref< const VectorX< Expression >> &expressions, const Eigen::Ref< const VectorX< Variable >> &vars, EigenPtr< Eigen::MatrixXd > M, EigenPtr< Eigen::VectorXd > v) |
Decomposes expressions into M * vars + v . More... | |
void | ExtractAndAppendVariablesFromExpression (const symbolic::Expression &e, VectorX< Variable > *vars, std::unordered_map< symbolic::Variable::Id, int > *map_var_to_index) |
Given an expression e , extract all variables inside e , append these variables to vars if they are not included in vars yet. More... | |
std::pair< VectorX< Variable >, std::unordered_map< symbolic::Variable::Id, int > > | ExtractVariablesFromExpression (const symbolic::Expression &e) |
Given an expression e , extracts all variables inside e . More... | |
std::pair< VectorX< Variable >, std::unordered_map< Variable::Id, int > > | ExtractVariablesFromExpression (const Eigen::Ref< const VectorX< Expression >> &expressions) |
Overloads ExtractVariablesFromExpression but with a vector of expressions. More... | |
void | DecomposeQuadraticPolynomial (const symbolic::Polynomial &poly, const std::unordered_map< symbolic::Variable::Id, int > &map_var_to_index, Eigen::MatrixXd *Q, Eigen::VectorXd *b, double *c) |
Given a quadratic polynomial poly , decomposes it into the form 0.5 * x' Q * x + b' * x + c. More... | |
void | DecomposeAffineExpressions (const Eigen::Ref< const VectorX< symbolic::Expression >> &v, Eigen::MatrixXd *A, Eigen::VectorXd *b, VectorX< Variable > *vars) |
Given a vector of affine expressions v, decompose it to \( v = A vars + b \). More... | |
int | DecomposeAffineExpression (const symbolic::Expression &e, const std::unordered_map< symbolic::Variable::Id, int > &map_var_to_index, EigenPtr< Eigen::RowVectorXd > coeffs, double *constant_term) |
Decomposes an affine combination e = c0 + c1 * v1 + ... More... | |
std::tuple< MatrixX< Expression >, VectorX< Expression >, VectorX< Expression > > | DecomposeLumpedParameters (const Eigen::Ref< const VectorX< Expression >> &f, const Eigen::Ref< const VectorX< Variable >> ¶meters) |
Given a vector of Expressions f and a list of parameters we define all additional variables in f to be a vector of "non-parameter variables", n. More... | |
std::tuple< bool, Eigen::MatrixXd, Eigen::VectorXd, VectorX< Variable > > | DecomposeL2NormExpression (const symbolic::Expression &e, double psd_tol=1e-8, double coefficient_tol=1e-8) |
Decomposes an L2 norm e = |Ax+b|₂ into A, b, and the variable vector x (or returns false if the decomposition is not possible). More... | |
Environment | PopulateRandomVariables (Environment env, const Variables &variables, RandomGenerator *random_generator) |
Populates the environment env by sampling values for the unassigned random variables in variables using random_generator . More... | |
Expression | operator+ (Expression lhs, const Expression &rhs) |
Expression & | operator+= (Expression &lhs, const Expression &rhs) |
Expression | operator+ (const Expression &e) |
Expression | operator- (Expression lhs, const Expression &rhs) |
Expression & | operator-= (Expression &lhs, const Expression &rhs) |
Expression | operator- (const Expression &e) |
Expression | operator * (Expression lhs, const Expression &rhs) |
Expression & | operator *= (Expression &lhs, const Expression &rhs) |
Expression | operator/ (Expression lhs, const Expression &rhs) |
Expression & | operator/= (Expression &lhs, const Expression &rhs) |
Expression | log (const Expression &e) |
Expression | abs (const Expression &e) |
Expression | exp (const Expression &e) |
Expression | sqrt (const Expression &e) |
Expression | pow (const Expression &e1, const Expression &e2) |
Expression | sin (const Expression &e) |
Expression | cos (const Expression &e) |
Expression | tan (const Expression &e) |
Expression | asin (const Expression &e) |
Expression | acos (const Expression &e) |
Expression | atan (const Expression &e) |
Expression | atan2 (const Expression &e1, const Expression &e2) |
Expression | sinh (const Expression &e) |
Expression | cosh (const Expression &e) |
Expression | tanh (const Expression &e) |
Expression | min (const Expression &e1, const Expression &e2) |
Expression | max (const Expression &e1, const Expression &e2) |
Expression | clamp (const Expression &v, const Expression &lo, const Expression &hi) |
Expression | ceil (const Expression &e) |
Expression | floor (const Expression &e) |
Expression | if_then_else (const Formula &f_cond, const Expression &e_then, const Expression &e_else) |
Expression | uninterpreted_function (std::string name, std::vector< Expression > arguments) |
Constructs an uninterpreted-function expression with name and arguments . More... | |
void | swap (Expression &a, Expression &b) |
std::ostream & | operator<< (std::ostream &os, const Expression &e) |
bool | is_constant (const Expression &e) |
Checks if e is a constant expression. More... | |
bool | is_constant (const Expression &e, double v) |
Checks if e is a constant expression representing v . More... | |
bool | is_zero (const Expression &e) |
Checks if e is 0.0. More... | |
bool | is_one (const Expression &e) |
Checks if e is 1.0. More... | |
bool | is_neg_one (const Expression &e) |
Checks if e is -1.0. More... | |
bool | is_two (const Expression &e) |
Checks if e is 2.0. More... | |
bool | is_nan (const Expression &e) |
Checks if e is NaN. More... | |
bool | is_variable (const Expression &e) |
Checks if e is a variable expression. More... | |
bool | is_addition (const Expression &e) |
Checks if e is an addition expression. More... | |
bool | is_multiplication (const Expression &e) |
Checks if e is a multiplication expression. More... | |
bool | is_division (const Expression &e) |
Checks if e is a division expression. More... | |
bool | is_log (const Expression &e) |
Checks if e is a log expression. More... | |
bool | is_abs (const Expression &e) |
Checks if e is an abs expression. More... | |
bool | is_exp (const Expression &e) |
Checks if e is an exp expression. More... | |
bool | is_sqrt (const Expression &e) |
Checks if e is a square-root expression. More... | |
bool | is_pow (const Expression &e) |
Checks if e is a power-function expression. More... | |
bool | is_sin (const Expression &e) |
Checks if e is a sine expression. More... | |
bool | is_cos (const Expression &e) |
Checks if e is a cosine expression. More... | |
bool | is_tan (const Expression &e) |
Checks if e is a tangent expression. More... | |
bool | is_asin (const Expression &e) |
Checks if e is an arcsine expression. More... | |
bool | is_acos (const Expression &e) |
Checks if e is an arccosine expression. More... | |
bool | is_atan (const Expression &e) |
Checks if e is an arctangent expression. More... | |
bool | is_atan2 (const Expression &e) |
Checks if e is an arctangent2 expression. More... | |
bool | is_sinh (const Expression &e) |
Checks if e is a hyperbolic-sine expression. More... | |
bool | is_cosh (const Expression &e) |
Checks if e is a hyperbolic-cosine expression. More... | |
bool | is_tanh (const Expression &e) |
Checks if e is a hyperbolic-tangent expression. More... | |
bool | is_min (const Expression &e) |
Checks if e is a min expression. More... | |
bool | is_max (const Expression &e) |
Checks if e is a max expression. More... | |
bool | is_ceil (const Expression &e) |
Checks if e is a ceil expression. More... | |
bool | is_floor (const Expression &e) |
Checks if e is a floor expression. More... | |
bool | is_if_then_else (const Expression &e) |
Checks if e is an if-then-else expression. More... | |
bool | is_uninterpreted_function (const Expression &e) |
Checks if e is an uninterpreted-function expression. More... | |
double | get_constant_value (const Expression &e) |
Returns the constant value of the constant expression e . More... | |
const Variable & | get_variable (const Expression &e) |
Returns the embedded variable in the variable expression e . More... | |
const Expression & | get_argument (const Expression &e) |
Returns the argument in the unary expression e . More... | |
const Expression & | get_first_argument (const Expression &e) |
Returns the first argument of the binary expression e . More... | |
const Expression & | get_second_argument (const Expression &e) |
Returns the second argument of the binary expression e . More... | |
double | get_constant_in_addition (const Expression &e) |
Returns the constant part of the addition expression e . More... | |
const std::map< Expression, double > & | get_expr_to_coeff_map_in_addition (const Expression &e) |
Returns the map from an expression to its coefficient in the addition expression e . More... | |
double | get_constant_in_multiplication (const Expression &e) |
Returns the constant part of the multiplication expression e . More... | |
const std::map< Expression, Expression > & | get_base_to_exponent_map_in_multiplication (const Expression &e) |
Returns the map from a base expression to its exponent expression in the multiplication expression e . More... | |
const std::string & | get_uninterpreted_function_name (const Expression &e) |
Returns the name of an uninterpreted-function expression e . More... | |
const std::vector< Expression > & | get_uninterpreted_function_arguments (const Expression &e) |
Returns the arguments of an uninterpreted-function expression e . More... | |
const Formula & | get_conditional_formula (const Expression &e) |
Returns the conditional formula in the if-then-else expression e . More... | |
const Expression & | get_then_expression (const Expression &e) |
Returns the 'then' expression in the if-then-else expression e . More... | |
const Expression & | get_else_expression (const Expression &e) |
Returns the 'else' expression in the if-then-else expression e . More... | |
Expression | operator+ (const Variable &var) |
Expression | operator- (const Variable &var) |
Expression | TaylorExpand (const Expression &f, const Environment &a, int order) |
Returns the Taylor series expansion of f around a of order order . More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, Expression > &&std::is_same_v< typename MatrixR::Scalar, double >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, double > &&std::is_same_v< typename MatrixR::Scalar, Expression >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, Expression > &&std::is_same_v< typename MatrixR::Scalar, Variable >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, Variable > &&std::is_same_v< typename MatrixR::Scalar, Expression >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, Variable > &&std::is_same_v< typename MatrixR::Scalar, double >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, double > &&std::is_same_v< typename MatrixR::Scalar, Variable >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, Variable > &&std::is_same_v< typename MatrixR::Scalar, Variable >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename MatrixL , typename MatrixR > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< MatrixL >, MatrixL > &&std::is_base_of_v< Eigen::MatrixBase< MatrixR >, MatrixR > &&std::is_same_v< typename MatrixL::Scalar, Expression > &&std::is_same_v< typename MatrixR::Scalar, Expression >, internal::ExpressionMatMulResult< MatrixL, MatrixR > > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<int Dim, int LhsMode, int RhsMode, int LhsOptions, int RhsOptions> | |
auto | operator * (const Eigen::Transform< Expression, Dim, LhsMode, LhsOptions > &t1, const Eigen::Transform< double, Dim, RhsMode, RhsOptions > &t2) |
Transform<double> * Transform<Expression> => Transform<Expression> More... | |
template<int Dim, int LhsMode, int RhsMode, int LhsOptions, int RhsOptions> | |
auto | operator * (const Eigen::Transform< double, Dim, LhsMode, LhsOptions > &t1, const Eigen::Transform< Expression, Dim, RhsMode, RhsOptions > &t2) |
Transform<Expression> * Transform<double> => Transform<Expression> More... | |
template<typename Derived > | |
std::enable_if_t< std::is_same_v< typename Derived::Scalar, Expression >, MatrixLikewise< double, Derived > > | Evaluate (const Eigen::MatrixBase< Derived > &m, const Environment &env=Environment{}, RandomGenerator *random_generator=nullptr) |
Evaluates a symbolic matrix m using env and random_generator . More... | |
Eigen::SparseMatrix< double > | Evaluate (const Eigen::Ref< const Eigen::SparseMatrix< Expression >> &m, const Environment &env=Environment{}) |
Evaluates m using a given environment (by default, an empty environment). More... | |
template<typename Derived > | |
MatrixLikewise< Expression, Derived > | Substitute (const Eigen::MatrixBase< Derived > &m, const Substitution &subst) |
Substitutes a symbolic matrix m using a given substitution subst . More... | |
template<typename Derived > | |
MatrixLikewise< Expression, Derived > | Substitute (const Eigen::MatrixBase< Derived > &m, const Variable &var, const Expression &e) |
Substitutes var with e in a symbolic matrix m . More... | |
VectorX< Variable > | GetVariableVector (const Eigen::Ref< const VectorX< Expression >> &expressions) |
Constructs a vector of variables from the vector of variable expressions. More... | |
MatrixX< Expression > | Jacobian (const Eigen::Ref< const VectorX< Expression >> &f, const std::vector< Variable > &vars) |
Computes the Jacobian matrix J of the vector function f with respect to vars . More... | |
MatrixX< Expression > | Jacobian (const Eigen::Ref< const VectorX< Expression >> &f, const Eigen::Ref< const VectorX< Variable >> &vars) |
Computes the Jacobian matrix J of the vector function f with respect to vars . More... | |
Variables | GetDistinctVariables (const Eigen::Ref< const MatrixX< Expression >> &v) |
Returns the distinct variables in the matrix of expressions. More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_base_of_v< Eigen::MatrixBase< DerivedA >, DerivedA > &&std::is_base_of_v< Eigen::MatrixBase< DerivedB >, DerivedB > &&std::is_same_v< typename DerivedA::Scalar, Expression > &&std::is_same_v< typename DerivedB::Scalar, Expression >, bool > | CheckStructuralEquality (const DerivedA &m1, const DerivedB &m2) |
Checks if two Eigen::Matrix<Expression> m1 and m2 are structurally equal. More... | |
bool | is_integer (double v) |
bool | is_positive_integer (double v) |
bool | is_non_negative_integer (double v) |
bool | is_variable (const ExpressionCell &c) |
Checks if c is a variable expression. More... | |
bool | is_unary (const ExpressionCell &c) |
Checks if c is a unary expression. More... | |
bool | is_binary (const ExpressionCell &c) |
Checks if c is a binary expression. More... | |
bool | is_addition (const ExpressionCell &c) |
Checks if c is an addition expression. More... | |
bool | is_multiplication (const ExpressionCell &c) |
Checks if c is an multiplication expression. More... | |
bool | is_division (const ExpressionCell &c) |
Checks if c is a division expression. More... | |
bool | is_log (const ExpressionCell &c) |
Checks if c is a log expression. More... | |
bool | is_abs (const ExpressionCell &c) |
Checks if c is an absolute-value-function expression. More... | |
bool | is_exp (const ExpressionCell &c) |
Checks if c is an exp expression. More... | |
bool | is_sqrt (const ExpressionCell &c) |
Checks if c is a square-root expression. More... | |
bool | is_pow (const ExpressionCell &c) |
Checks if c is a power-function expression. More... | |
bool | is_sin (const ExpressionCell &c) |
Checks if c is a sine expression. More... | |
bool | is_cos (const ExpressionCell &c) |
Checks if c is a cosine expression. More... | |
bool | is_tan (const ExpressionCell &c) |
Checks if c is a tangent expression. More... | |
bool | is_asin (const ExpressionCell &c) |
Checks if c is an arcsine expression. More... | |
bool | is_acos (const ExpressionCell &c) |
Checks if c is an arccosine expression. More... | |
bool | is_atan (const ExpressionCell &c) |
Checks if c is an arctangent expression. More... | |
bool | is_atan2 (const ExpressionCell &c) |
Checks if c is a arctangent2 expression. More... | |
bool | is_sinh (const ExpressionCell &c) |
Checks if c is a hyperbolic-sine expression. More... | |
bool | is_cosh (const ExpressionCell &c) |
Checks if c is a hyperbolic-cosine expression. More... | |
bool | is_tanh (const ExpressionCell &c) |
Checks if c is a hyperbolic-tangent expression. More... | |
bool | is_min (const ExpressionCell &c) |
Checks if c is a min expression. More... | |
bool | is_max (const ExpressionCell &c) |
Checks if c is a max expression. More... | |
bool | is_ceil (const ExpressionCell &c) |
Checks if c is a ceil expression. More... | |
bool | is_floor (const ExpressionCell &c) |
Checks if c is a floor expression. More... | |
bool | is_if_then_else (const ExpressionCell &c) |
Checks if c is an if-then-else expression. More... | |
bool | is_uninterpreted_function (const ExpressionCell &c) |
Checks if c is an uninterpreted-function expression. More... | |
bool | operator< (ExpressionKind k1, ExpressionKind k2) |
Total ordering between ExpressionKinds. More... | |
template<typename Result , typename Visitor , typename... Args> | |
Result | VisitPolynomial (Visitor *v, const Expression &e, Args &&... args) |
Calls visitor object v with a polynomial symbolic-expression e , and arguments args . More... | |
template<typename Result , typename Visitor , typename... Args> | |
Result | VisitExpression (Visitor *v, const Expression &e, Args &&... args) |
Calls visitor object v with a symbolic-expression e , and arguments args . More... | |
bool | operator< (FormulaKind k1, FormulaKind k2) |
Formula | forall (const Variables &vars, const Formula &f) |
Returns a formula f , universally quantified by variables vars . More... | |
Formula | make_conjunction (const std::set< Formula > &formulas) |
Returns a conjunction of formulas . More... | |
Formula | operator && (const Formula &f1, const Formula &f2) |
Formula | operator && (const Variable &v, const Formula &f) |
Formula | operator && (const Formula &f, const Variable &v) |
Formula | operator && (const Variable &v1, const Variable &v2) |
Formula | make_disjunction (const std::set< Formula > &formulas) |
Returns a disjunction of formulas . More... | |
Formula | operator|| (const Formula &f1, const Formula &f2) |
Formula | operator|| (const Variable &v, const Formula &f) |
Formula | operator|| (const Formula &f, const Variable &v) |
Formula | operator|| (const Variable &v1, const Variable &v2) |
Formula | operator! (const Formula &f) |
Formula | operator! (const Variable &v) |
Formula | operator== (const Expression &e1, const Expression &e2) |
Formula | operator!= (const Expression &e1, const Expression &e2) |
Formula | operator< (const Expression &e1, const Expression &e2) |
Formula | operator<= (const Expression &e1, const Expression &e2) |
Formula | operator> (const Expression &e1, const Expression &e2) |
Formula | operator>= (const Expression &e1, const Expression &e2) |
Formula | isnan (const Expression &e) |
Returns a Formula for the predicate isnan(e) to the given expression. More... | |
Formula | isinf (const Expression &e) |
Returns a Formula determining if the given expression e is a positive or negative infinity. More... | |
Formula | isfinite (const Expression &e) |
Returns a Formula determining if the given expression e has a finite value. More... | |
Formula | positive_semidefinite (const Eigen::Ref< const MatrixX< Expression >> &m) |
Returns a symbolic formula constraining m to be a positive-semidefinite matrix. More... | |
Formula | positive_semidefinite (const MatrixX< Expression > &m, Eigen::UpLoType mode) |
Constructs and returns a symbolic positive-semidefinite formula from m . More... | |
template<typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Derived::Scalar, Expression >, Formula > | positive_semidefinite (const Eigen::TriangularView< Derived, Eigen::Lower > &l) |
Constructs and returns a symbolic positive-semidefinite formula from a lower triangular-view l . More... | |
template<typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Derived::Scalar, Expression >, Formula > | positive_semidefinite (const Eigen::TriangularView< Derived, Eigen::Upper > &u) |
Constructs and returns a symbolic positive-semidefinite formula from an upper triangular-view u . More... | |
std::ostream & | operator<< (std::ostream &os, const Formula &f) |
bool | is_false (const Formula &f) |
Checks if f is structurally equal to False formula. More... | |
bool | is_true (const Formula &f) |
Checks if f is structurally equal to True formula. More... | |
bool | is_variable (const Formula &f) |
Checks if f is a variable formula. More... | |
bool | is_equal_to (const Formula &f) |
Checks if f is a formula representing equality (==). More... | |
bool | is_not_equal_to (const Formula &f) |
Checks if f is a formula representing disequality (!=). More... | |
bool | is_greater_than (const Formula &f) |
Checks if f is a formula representing greater-than (>). More... | |
bool | is_greater_than_or_equal_to (const Formula &f) |
Checks if f is a formula representing greater-than-or-equal-to (>=). More... | |
bool | is_less_than (const Formula &f) |
Checks if f is a formula representing less-than (<). More... | |
bool | is_less_than_or_equal_to (const Formula &f) |
Checks if f is a formula representing less-than-or-equal-to (<=). More... | |
bool | is_relational (const Formula &f) |
Checks if f is a relational formula ({==, !=, >, >=, <, <=}). More... | |
bool | is_conjunction (const Formula &f) |
Checks if f is a conjunction (∧). More... | |
bool | is_disjunction (const Formula &f) |
Checks if f is a disjunction (∨). More... | |
bool | is_nary (const Formula &f) |
Checks if f is a n-ary formula ({∧, ∨}). More... | |
bool | is_negation (const Formula &f) |
Checks if f is a negation (¬). More... | |
bool | is_forall (const Formula &f) |
Checks if f is a Forall formula (∀). More... | |
bool | is_isnan (const Formula &f) |
Checks if f is an isnan formula. More... | |
bool | is_positive_semidefinite (const Formula &f) |
Checks if f is a positive-semidefinite formula. More... | |
const Variable & | get_variable (const Formula &f) |
Returns the embedded variable in the variable formula f . More... | |
const Expression & | get_lhs_expression (const Formula &f) |
Returns the lhs-argument of a relational formula f . More... | |
const Expression & | get_rhs_expression (const Formula &f) |
Returns the rhs-argument of a relational formula f . More... | |
const Expression & | get_unary_expression (const Formula &f) |
Returns the expression in a unary expression formula f . More... | |
const std::set< Formula > & | get_operands (const Formula &f) |
Returns the set of formulas in a n-ary formula f . More... | |
const Formula & | get_operand (const Formula &f) |
Returns the formula in a negation formula f . More... | |
const Variables & | get_quantified_variables (const Formula &f) |
Returns the quantified variables in a forall formula f . More... | |
const Formula & | get_quantified_formula (const Formula &f) |
Returns the quantified formula in a forall formula f . More... | |
const MatrixX< Expression > & | get_matrix_in_positive_semidefinite (const Formula &f) |
Returns the matrix in a positive-semidefinite formula f . More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar()==typename DerivedB::Scalar()), Formula >, typename internal::RelationalOpTraits< DerivedA, DerivedB >::ReturnType > | operator== (const DerivedA &a1, const DerivedB &a2) |
Returns an Eigen array of symbolic formulas where each element includes element-wise symbolic-equality of two arrays m1 and m2 . More... | |
template<typename Derived , typename ScalarType > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename Derived::Scalar()==ScalarType()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator== (const Derived &a, const ScalarType &v) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a and a scalar v using equal-to operator (==). More... | |
template<typename ScalarType , typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(ScalarType()==typename Derived::Scalar()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator== (const ScalarType &v, const Derived &a) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v and an array using equal-to operator (==). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar()<=typename DerivedB::Scalar()), Formula >, typename internal::RelationalOpTraits< DerivedA, DerivedB >::ReturnType > | operator<= (const DerivedA &a1, const DerivedB &a2) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1 and a2 using less-than-or-equal operator (<=). More... | |
template<typename Derived , typename ScalarType > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename Derived::Scalar()<=ScalarType()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator<= (const Derived &a, const ScalarType &v) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a and a scalar v using less-than-or-equal operator (<=). More... | |
template<typename ScalarType , typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(ScalarType()<=typename Derived::Scalar()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator<= (const ScalarType &v, const Derived &a) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v and an array using less-than-or-equal operator (<=). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar()< typename DerivedB::Scalar()), Formula >, typename internal::RelationalOpTraits< DerivedA, DerivedB >::ReturnType > | operator< (const DerivedA &a1, const DerivedB &a2) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1 and a2 using less-than operator (<). More... | |
template<typename Derived , typename ScalarType > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename Derived::Scalar()< ScalarType()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator< (const Derived &a, const ScalarType &v) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a and a scalar v using less-than operator (<). More... | |
template<typename ScalarType , typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(ScalarType()< typename Derived::Scalar()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator< (const ScalarType &v, const Derived &a) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v and an array using less-than operator (<). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar() >=typename DerivedB::Scalar()), Formula >, typename internal::RelationalOpTraits< DerivedA, DerivedB >::ReturnType > | operator>= (const DerivedA &a1, const DerivedB &a2) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1 and a2 using greater-than-or-equal operator (>=). More... | |
template<typename Derived , typename ScalarType > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename Derived::Scalar() >=ScalarType()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator>= (const Derived &a, const ScalarType &v) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a and a scalar v using greater-than-or-equal operator (>=). More... | |
template<typename ScalarType , typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(ScalarType() >=typename Derived::Scalar()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator>= (const ScalarType &v, const Derived &a) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v and an array using less-than-or-equal operator (<=) instead of greater-than-or-equal operator (>=). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar() > typename DerivedB::Scalar()), Formula >, typename internal::RelationalOpTraits< DerivedA, DerivedB >::ReturnType > | operator> (const DerivedA &a1, const DerivedB &a2) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1 and a2 using greater-than operator (>). More... | |
template<typename Derived , typename ScalarType > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename Derived::Scalar() > ScalarType()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator> (const Derived &a, const ScalarType &v) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a and a scalar v using greater-than operator (>). More... | |
template<typename ScalarType , typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(ScalarType() > typename Derived::Scalar()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator> (const ScalarType &v, const Derived &a) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v and an array using less-than operator (<) instead of greater-than operator (>). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar() !=typename DerivedB::Scalar()), Formula >, typename internal::RelationalOpTraits< DerivedA, DerivedB >::ReturnType > | operator!= (const DerivedA &a1, const DerivedB &a2) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1 and a2 using not-equal operator (!=). More... | |
template<typename Derived , typename ScalarType > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(typename Derived::Scalar() !=ScalarType()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator!= (const Derived &a, const ScalarType &v) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a and a scalar v using not-equal operator (!=). More... | |
template<typename ScalarType , typename Derived > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< Derived >::XprKind, Eigen::ArrayXpr > &&std::is_same_v< decltype(ScalarType() !=typename Derived::Scalar()), Formula >, Eigen::Array< Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime > > | operator!= (const ScalarType &v, const Derived &a) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v and an array using not-equal operator (!=). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar()==typename DerivedB::Scalar()), Formula >, Formula > | operator== (const DerivedA &m1, const DerivedB &m2) |
Returns a symbolic formula checking if two matrices m1 and m2 are equal. More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar() !=typename DerivedB::Scalar()), Formula >, Formula > | operator!= (const DerivedA &m1, const DerivedB &m2) |
Returns a symbolic formula representing the condition whether m1 and m2 are not the same. More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar()< typename DerivedB::Scalar()), Formula >, Formula > | operator< (const DerivedA &m1, const DerivedB &m2) |
Returns a symbolic formula representing element-wise comparison between two matrices m1 and m2 using less-than (<) operator. More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar()<=typename DerivedB::Scalar()), Formula >, Formula > | operator<= (const DerivedA &m1, const DerivedB &m2) |
Returns a symbolic formula representing element-wise comparison between two matrices m1 and m2 using less-than-or-equal operator (<=). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar() > typename DerivedB::Scalar()), Formula >, Formula > | operator> (const DerivedA &m1, const DerivedB &m2) |
Returns a symbolic formula representing element-wise comparison between two matrices m1 and m2 using greater-than operator (>). More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< std::is_same_v< typename Eigen::internal::traits< DerivedA >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< typename Eigen::internal::traits< DerivedB >::XprKind, Eigen::MatrixXpr > &&std::is_same_v< decltype(typename DerivedA::Scalar() >=typename DerivedB::Scalar()), Formula >, Formula > | operator>= (const DerivedA &m1, const DerivedB &m2) |
Returns a symbolic formula representing element-wise comparison between two matrices m1 and m2 using greater-than-or-equal operator (>=). More... | |
bool | is_false (const FormulaCell &f) |
Checks if f is structurally equal to False formula. More... | |
bool | is_true (const FormulaCell &f) |
Checks if f is structurally equal to True formula. More... | |
bool | is_variable (const FormulaCell &f) |
Checks if f is a variable formula. More... | |
bool | is_equal_to (const FormulaCell &f) |
Checks if f is a formula representing equality (==). More... | |
bool | is_not_equal_to (const FormulaCell &f) |
Checks if f is a formula representing disequality (!=). More... | |
bool | is_greater_than (const FormulaCell &f) |
Checks if f is a formula representing greater-than (>). More... | |
bool | is_greater_than_or_equal_to (const FormulaCell &f) |
Checks if f is a formula representing greater-than-or-equal-to (>=). More... | |
bool | is_less_than (const FormulaCell &f) |
Checks if f is a formula representing less-than (<). More... | |
bool | is_less_than_or_equal_to (const FormulaCell &f) |
Checks if f is a formula representing less-than-or-equal-to (<=). More... | |
bool | is_relational (const FormulaCell &f) |
Checks if f is a relational formula ({==, !=, >, >=, <, <=}). More... | |
bool | is_conjunction (const FormulaCell &f) |
Checks if f is a conjunction (∧). More... | |
bool | is_disjunction (const FormulaCell &f) |
Checks if f is a disjunction (∨). More... | |
bool | is_nary (const FormulaCell &f) |
Checks if f is N-ary. More... | |
bool | is_negation (const FormulaCell &f) |
Checks if f is a negation (¬). More... | |
bool | is_forall (const FormulaCell &f) |
Checks if f is a Forall formula (∀). More... | |
bool | is_isnan (const FormulaCell &f) |
Checks if f is an isnan formula. More... | |
bool | is_positive_semidefinite (const FormulaCell &f) |
Checks if f is a positive semidefinite formula. More... | |
std::shared_ptr< const FormulaFalse > | to_false (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaFalse> . More... | |
std::shared_ptr< const FormulaTrue > | to_true (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaTrue> . More... | |
std::shared_ptr< const FormulaVar > | to_variable (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaVar> . More... | |
std::shared_ptr< const RelationalFormulaCell > | to_relational (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const RelationalFormulaCell> . More... | |
std::shared_ptr< const FormulaEq > | to_equal_to (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaEq> . More... | |
std::shared_ptr< const FormulaNeq > | to_not_equal_to (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaNeq> . More... | |
std::shared_ptr< const FormulaGt > | to_greater_than (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaGt> . More... | |
std::shared_ptr< const FormulaGeq > | to_greater_than_or_equal_to (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaGeq> . More... | |
std::shared_ptr< const FormulaLt > | to_less_than (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaLt> . More... | |
std::shared_ptr< const FormulaLeq > | to_less_than_or_equal_to (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaLeq> . More... | |
std::shared_ptr< const FormulaAnd > | to_conjunction (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaAnd> . More... | |
std::shared_ptr< const FormulaOr > | to_disjunction (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaOr> . More... | |
std::shared_ptr< const NaryFormulaCell > | to_nary (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const NaryFormulaCell> . More... | |
std::shared_ptr< const FormulaNot > | to_negation (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaNot> . More... | |
std::shared_ptr< const FormulaForall > | to_forall (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaForall> . More... | |
std::shared_ptr< const FormulaIsnan > | to_isnan (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaIsnan> . More... | |
std::shared_ptr< const FormulaPositiveSemidefinite > | to_positive_semidefinite (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaPositiveSemidefinite> . More... | |
template<typename Result , typename Visitor , typename... Args> | |
Result | VisitFormula (Visitor *v, const Formula &f, Args &&... args) |
Calls visitor object v with a symbolic formula f , and arguments args . More... | |
std::ostream & | operator<< (std::ostream &os, Variable::Type type) |
MatrixX< Variable > | MakeMatrixVariable (int rows, int cols, const std::string &name, Variable::Type type=Variable::Type::CONTINUOUS) |
Creates a dynamically-sized Eigen matrix of symbolic variables. More... | |
MatrixX< Variable > | MakeMatrixBooleanVariable (int rows, int cols, const std::string &name) |
Creates a dynamically-sized Eigen matrix of symbolic Boolean variables. More... | |
MatrixX< Variable > | MakeMatrixBinaryVariable (int rows, int cols, const std::string &name) |
Creates a dynamically-sized Eigen matrix of symbolic binary variables. More... | |
MatrixX< Variable > | MakeMatrixContinuousVariable (int rows, int cols, const std::string &name) |
Creates a dynamically-sized Eigen matrix of symbolic continuous variables. More... | |
MatrixX< Variable > | MakeMatrixIntegerVariable (int rows, int cols, const std::string &name) |
Creates a dynamically-sized Eigen matrix of symbolic integer variables. More... | |
template<int rows, int cols> | |
Eigen::Matrix< Variable, rows, cols > | MakeMatrixVariable (const std::string &name, Variable::Type type=Variable::Type::CONTINUOUS) |
Creates a static-sized Eigen matrix of symbolic variables. More... | |
template<int rows, int cols> | |
Eigen::Matrix< Variable, rows, cols > | MakeMatrixBooleanVariable (const std::string &name) |
Creates a static-sized Eigen matrix of symbolic Boolean variables. More... | |
template<int rows, int cols> | |
Eigen::Matrix< Variable, rows, cols > | MakeMatrixBinaryVariable (const std::string &name) |
Creates a static-sized Eigen matrix of symbolic binary variables. More... | |
template<int rows, int cols> | |
Eigen::Matrix< Variable, rows, cols > | MakeMatrixContinuousVariable (const std::string &name) |
Creates a static-sized Eigen matrix of symbolic continuous variables. More... | |
template<int rows, int cols> | |
Eigen::Matrix< Variable, rows, cols > | MakeMatrixIntegerVariable (const std::string &name) |
Creates a static-sized Eigen matrix of symbolic integer variables. More... | |
VectorX< Variable > | MakeVectorVariable (int rows, const std::string &name, Variable::Type type=Variable::Type::CONTINUOUS) |
Creates a dynamically-sized Eigen vector of symbolic variables. More... | |
VectorX< Variable > | MakeVectorBooleanVariable (int rows, const std::string &name) |
Creates a dynamically-sized Eigen vector of symbolic Boolean variables. More... | |
VectorX< Variable > | MakeVectorBinaryVariable (int rows, const std::string &name) |
Creates a dynamically-sized Eigen vector of symbolic binary variables. More... | |
VectorX< Variable > | MakeVectorContinuousVariable (int rows, const std::string &name) |
Creates a dynamically-sized Eigen vector of symbolic continuous variables. More... | |
VectorX< Variable > | MakeVectorIntegerVariable (int rows, const std::string &name) |
Creates a dynamically-sized Eigen vector of symbolic integer variables. More... | |
template<int rows> | |
Eigen::Matrix< Variable, rows, 1 > | MakeVectorVariable (const std::string &name, Variable::Type type=Variable::Type::CONTINUOUS) |
Creates a static-sized Eigen vector of symbolic variables. More... | |
template<int rows> | |
Eigen::Matrix< Variable, rows, 1 > | MakeVectorBooleanVariable (const std::string &name) |
Creates a static-sized Eigen vector of symbolic Boolean variables. More... | |
template<int rows> | |
Eigen::Matrix< Variable, rows, 1 > | MakeVectorBinaryVariable (const std::string &name) |
Creates a static-sized Eigen vector of symbolic binary variables. More... | |
template<int rows> | |
Eigen::Matrix< Variable, rows, 1 > | MakeVectorContinuousVariable (const std::string &name) |
Creates a static-sized Eigen vector of symbolic continuous variables. More... | |
template<int rows> | |
Eigen::Matrix< Variable, rows, 1 > | MakeVectorIntegerVariable (const std::string &name) |
Creates a static-sized Eigen vector of symbolic integer variables. More... | |
template<typename DerivedA , typename DerivedB > | |
std::enable_if_t< is_eigen_scalar_same< DerivedA, Variable >::value &&is_eigen_scalar_same< DerivedB, Variable >::value, bool > | CheckStructuralEquality (const DerivedA &m1, const DerivedB &m2) |
Checks if two Eigen::Matrix<Variable> m1 and m2 are structurally equal. More... | |
Variables & | operator+= (Variables &vars1, const Variables &vars2) |
Updates var1 with the result of set-union(var1 , var2 ). More... | |
Variables & | operator+= (Variables &vars, const Variable &var) |
Updates vars with the result of set-union(vars , { var }). More... | |
Variables | operator+ (Variables vars1, const Variables &vars2) |
Returns set-union of var1 and var2 . More... | |
Variables | operator+ (Variables vars, const Variable &var) |
Returns set-union of vars and {var} . More... | |
Variables | operator+ (const Variable &var, Variables vars) |
Returns set-union of {var} and vars . More... | |
Variables & | operator-= (Variables &vars1, const Variables &vars2) |
Updates var1 with the result of set-minus(var1 , var2 ). More... | |
Variables & | operator-= (Variables &vars, const Variable &var) |
Updates vars with the result of set-minus(vars , {var} ). More... | |
Variables | operator- (Variables vars1, const Variables &vars2) |
Returns set-minus(var1 , vars2 ). More... | |
Variables | operator- (Variables vars, const Variable &var) |
Returns set-minus(vars , { var }). More... | |
Variables | intersect (const Variables &vars1, const Variables &vars2) |
Returns the intersection of vars1 and vars2 . More... | |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (const GenericPolynomial< BasisElement > &p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (GenericPolynomial< BasisElement > p1, const GenericPolynomial< BasisElement > &p2) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (GenericPolynomial< BasisElement > p, const BasisElement &m) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (GenericPolynomial< BasisElement > p, double c) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (const BasisElement &m, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (const BasisElement &m1, const BasisElement &m2) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (const BasisElement &m, double c) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (double c, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (double c, const BasisElement &m) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (GenericPolynomial< BasisElement > p, const Variable &v) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator+ (const Variable &v, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (GenericPolynomial< BasisElement > p1, const GenericPolynomial< BasisElement > &p2) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (GenericPolynomial< BasisElement > p, const BasisElement &m) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (GenericPolynomial< BasisElement > p, double c) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (const BasisElement &m, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (const BasisElement &m1, const BasisElement &m2) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (const BasisElement &m, double c) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (double c, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (double c, const BasisElement &m) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (GenericPolynomial< BasisElement > p, const Variable &v) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator- (const Variable &v, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (GenericPolynomial< BasisElement > p1, const GenericPolynomial< BasisElement > &p2) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (GenericPolynomial< BasisElement > p, const BasisElement &m) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (GenericPolynomial< BasisElement > p, double c) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (const BasisElement &m, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (const BasisElement &m, double c) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (double c, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (double c, const BasisElement &m) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (GenericPolynomial< BasisElement > p, const Variable &v) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator * (const Variable &v, GenericPolynomial< BasisElement > p) |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | operator/ (GenericPolynomial< BasisElement > p, double v) |
Returns p / v . More... | |
template<typename BasisElement > | |
GenericPolynomialEnable< BasisElement > | pow (const GenericPolynomial< BasisElement > &p, int n) |
Returns polynomial raised to n . More... | |
template<typename BasisElement > | |
std::ostream & | operator<< (std::ostream &os, const GenericPolynomial< BasisElement > &p) |
std::string | ToLatex (const Expression &e, int precision=3) |
Generates a LaTeX string representation of e with floating point coefficients displayed using precision . More... | |
std::string | ToLatex (const Formula &f, int precision=3) |
Generates a LaTeX string representation of f with floating point coefficients displayed using precision . More... | |
std::string | ToLatex (double val, int precision=3) |
Generates a Latex string representation of val displayed with precision , with one exception. More... | |
template<typename Derived > | |
std::string | ToLatex (const Eigen::PlainObjectBase< Derived > &M, int precision=3) |
Generates a LaTeX string representation of M with floating point coefficients displayed using precision . More... | |
std::ostream & | operator<< (std::ostream &out, const Monomial &m) |
Monomial | operator * (Monomial m1, const Monomial &m2) |
Returns a multiplication of two monomials, m1 and m2 . More... | |
Monomial | pow (Monomial m, int p) |
Returns m raised to p . More... | |
std::ostream & | operator<< (std::ostream &out, const MonomialBasisElement &m) |
std::map< MonomialBasisElement, double > | operator * (const MonomialBasisElement &m1, const MonomialBasisElement &m2) |
Returns a multiplication of two monomials, m1 and m2 . More... | |
std::map< MonomialBasisElement, double > | pow (MonomialBasisElement m, int p) |
Returns m raised to p . More... | |
Eigen::Matrix< Monomial, Eigen::Dynamic, 1 > | MonomialBasis (const Variables &vars, int degree) |
Returns all monomials up to a given degree under the graded reverse lexicographic order. More... | |
constexpr int | NChooseK (int n, int k) |
template<int n, int degree> | |
Eigen::Matrix< Monomial, NChooseK(n+degree, degree), 1 > | MonomialBasis (const Variables &vars) |
Returns all monomials up to a given degree under the graded reverse lexicographic order. More... | |
VectorX< Monomial > | MonomialBasis (const std::unordered_map< Variables, int > &variables_degree) |
Returns all the monomials (in graded reverse lexicographic order) such that the total degree for each set of variables is no larger than a specific degree. More... | |
Eigen::Matrix< Monomial, Eigen::Dynamic, 1 > | EvenDegreeMonomialBasis (const Variables &vars, int degree) |
Returns all even degree monomials up to a given degree under the graded reverse lexicographic order. More... | |
Eigen::Matrix< Monomial, Eigen::Dynamic, 1 > | OddDegreeMonomialBasis (const Variables &vars, int degree) |
Returns all odd degree monomials up to a given degree under the graded reverse lexicographic order. More... | |
VectorX< Monomial > | CalcMonomialBasisOrderUpToOne (const Variables &x, bool sort_monomial=false) |
Generates all the monomials of x , such that the degree for x(i) is no larger than 1 for every x(i) in x . More... | |
Polynomial | operator- (const Polynomial &p) |
Unary minus operation for polynomial. More... | |
Polynomial | operator+ (Polynomial p1, const Polynomial &p2) |
Polynomial | operator+ (Polynomial p, const Monomial &m) |
Polynomial | operator+ (Polynomial p, double c) |
Polynomial | operator+ (const Monomial &m, Polynomial p) |
Polynomial | operator+ (const Monomial &m1, const Monomial &m2) |
Polynomial | operator+ (const Monomial &m, double c) |
Polynomial | operator+ (double c, Polynomial p) |
Polynomial | operator+ (double c, const Monomial &m) |
Polynomial | operator+ (Polynomial p, const Variable &v) |
Polynomial | operator+ (const Variable &v, Polynomial p) |
Expression | operator+ (const Expression &e, const Polynomial &p) |
Expression | operator+ (const Polynomial &p, const Expression &e) |
Polynomial | operator- (Polynomial p1, const Polynomial &p2) |
Polynomial | operator- (Polynomial p, const Monomial &m) |
Polynomial | operator- (Polynomial p, double c) |
Polynomial | operator- (const Monomial &m, Polynomial p) |
Polynomial | operator- (const Monomial &m1, const Monomial &m2) |
Polynomial | operator- (const Monomial &m, double c) |
Polynomial | operator- (double c, Polynomial p) |
Polynomial | operator- (double c, const Monomial &m) |
Polynomial | operator- (Polynomial p, const Variable &v) |
Polynomial | operator- (const Variable &v, const Polynomial &p) |
Expression | operator- (const Expression &e, const Polynomial &p) |
Expression | operator- (const Polynomial &p, const Expression &e) |
Polynomial | operator * (Polynomial p1, const Polynomial &p2) |
Polynomial | operator * (Polynomial p, const Monomial &m) |
Polynomial | operator * (Polynomial p, double c) |
Polynomial | operator * (const Monomial &m, Polynomial p) |
Polynomial | operator * (const Monomial &m, double c) |
Polynomial | operator * (double c, Polynomial p) |
Polynomial | operator * (double c, const Monomial &m) |
Polynomial | operator * (Polynomial p, const Variable &v) |
Polynomial | operator * (const Variable &v, Polynomial p) |
Expression | operator * (const Expression &e, const Polynomial &p) |
Expression | operator * (const Polynomial &p, const Expression &e) |
Polynomial | operator/ (Polynomial p, double v) |
Returns p / v . More... | |
Expression | operator/ (double v, const Polynomial &p) |
Expression | operator/ (const Expression &e, const Polynomial &p) |
Expression | operator/ (const Polynomial &p, const Expression &e) |
Polynomial | pow (const Polynomial &p, int n) |
Returns polynomial p raised to n . More... | |
std::ostream & | operator<< (std::ostream &os, const Polynomial &p) |
template<typename MatrixL , typename MatrixR > | |
Eigen::Matrix< Polynomial, MatrixL::RowsAtCompileTime, MatrixR::ColsAtCompileTime > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following matrix operations: More... | |
template<typename Derived > | |
std::enable_if_t< std::is_same_v< typename Derived::Scalar, Polynomial >, MatrixLikewise< double, Derived > > | Evaluate (const Eigen::MatrixBase< Derived > &m, const Environment &env) |
Evaluates a matrix m of symbolic polynomials using env . More... | |
MatrixX< Polynomial > | Jacobian (const Eigen::Ref< const VectorX< Polynomial >> &f, const Eigen::Ref< const VectorX< Variable >> &vars) |
Computes the Jacobian matrix J of the vector function f with respect to vars . More... | |
template<typename Derived1 , typename Derived2 > | |
std::enable_if< is_eigen_vector_of< Derived1, symbolic::Monomial >::value &&(is_eigen_vector_of< Derived2, double >::value||is_eigen_vector_of< Derived2, symbolic::Variable >::value||is_eigen_vector_of< Derived2, symbolic::Expression >::value), symbolic::Polynomial >::type | CalcPolynomialWLowerTriangularPart (const Eigen::MatrixBase< Derived1 > &monomial_basis, const Eigen::MatrixBase< Derived2 > &gram_lower) |
Returns the polynomial m(x)ᵀ * Q * m(x), where m(x) is the monomial basis, and Q is the Gram matrix. More... | |
template<int rows, typename BasisElement > | |
Eigen::Matrix< BasisElement, rows, 1 > | ComputePolynomialBasisUpToDegree (const Variables &vars, int degree, internal::DegreeType degree_type) |
Returns all polynomial basis elements up to a given degree under the graded reverse lexicographic order. More... | |
RationalFunction | operator+ (RationalFunction f1, const RationalFunction &f2) |
RationalFunction | operator+ (RationalFunction f, const Polynomial &p) |
RationalFunction | operator+ (const Polynomial &p, RationalFunction f) |
RationalFunction | operator+ (const Monomial &m, RationalFunction f) |
RationalFunction | operator+ (RationalFunction f, const Monomial &m) |
RationalFunction | operator+ (RationalFunction f, double c) |
RationalFunction | operator+ (double c, RationalFunction f) |
RationalFunction | operator- (RationalFunction f1, const RationalFunction &f2) |
RationalFunction | operator- (RationalFunction f, const Polynomial &p) |
RationalFunction | operator- (const Polynomial &p, const RationalFunction &f) |
RationalFunction | operator- (RationalFunction f, double c) |
RationalFunction | operator- (double c, RationalFunction f) |
RationalFunction | operator- (const Monomial &m, RationalFunction f) |
RationalFunction | operator- (RationalFunction f, const Monomial &m) |
RationalFunction | operator * (RationalFunction f1, const RationalFunction &f2) |
RationalFunction | operator * (RationalFunction f, const Polynomial &p) |
RationalFunction | operator * (const Polynomial &p, RationalFunction f) |
RationalFunction | operator * (RationalFunction f, double c) |
RationalFunction | operator * (double c, RationalFunction f) |
RationalFunction | operator * (const Monomial &m, RationalFunction f) |
RationalFunction | operator * (RationalFunction f, const Monomial &m) |
RationalFunction | operator/ (RationalFunction f1, const RationalFunction &f2) |
RationalFunction | operator/ (RationalFunction f, const Polynomial &p) |
RationalFunction | operator/ (const Polynomial &p, const RationalFunction &f) |
RationalFunction | operator/ (RationalFunction f, double c) |
RationalFunction | operator/ (double c, const RationalFunction &f) |
RationalFunction | operator/ (const Monomial &m, RationalFunction f) |
RationalFunction | operator/ (RationalFunction f, const Monomial &m) |
RationalFunction | pow (const RationalFunction &f, int n) |
Returns the rational function f raised to n . More... | |
template<typename MatrixL , typename MatrixR > | |
Eigen::Matrix< RationalFunction, MatrixL::RowsAtCompileTime, MatrixR::ColsAtCompileTime > | operator * (const MatrixL &lhs, const MatrixR &rhs) |
Provides the following operations: More... | |
symbolic::Expression | ReplaceBilinearTerms (const symbolic::Expression &e, const Eigen::Ref< const VectorX< symbolic::Variable >> &x, const Eigen::Ref< const VectorX< symbolic::Variable >> &y, const Eigen::Ref< const MatrixX< symbolic::Expression >> &W) |
Replaces all the bilinear product terms in the expression e , with the corresponding terms in W , where W represents the matrix x * yᵀ, such that after replacement, e does not have bilinear terms involving x and y . More... | |
Rewriter | MakeRuleRewriter (const RewritingRule &r) |
Constructs a rewriter based on a rewriting rule r . More... | |
Expression | Substitute (const Expression &e, const SinCosSubstitution &subs) |
Given a substitution map q => {s, c}, substitutes instances of sin(q) and cos(q) in e with s and c , with partial support for trigonometric expansions. More... | |
template<typename Derived > | |
MatrixLikewise< Expression, Derived > | Substitute (const Eigen::MatrixBase< Derived > &m, const SinCosSubstitution &subs) |
Matrix version of sin/cos substitution. More... | |
symbolic::RationalFunction | SubstituteStereographicProjection (const symbolic::Polynomial &e, const std::vector< SinCos > &sin_cos, const VectorX< symbolic::Variable > &t) |
Substitutes the variables representing sine and cosine functions with their stereographic projection. More... | |
using GenericPolynomialEnable = std::enable_if_t<std::is_base_of_v<PolynomialBasisElement, BasisElement>, GenericPolynomial<BasisElement> > |
Defines an explicit SFINAE alias for use with return types to dissuade CTAD from trying to instantiate an invalid GenericElement<> for operator overloads, (if that's actually the case).
See discussion for more info: https://github.com/robotlocomotion/drake/pull/14053#pullrequestreview-488744679
using Pattern = Expression |
A pattern is an expression which possibly includes variables which represent placeholders.
It is used to construct a RewritingRule
.
using Rewriter = std::function<Expression(const Expression&)> |
A Rewriter
is a function from an Expression to an Expression.
using SinCosSubstitution = std::unordered_map<Variable, SinCos> |
using Substitution = std::unordered_map<Variable, Expression> |
|
strong |
Kinds of symbolic expressions.
|
strong |
Kinds of symbolic formulas.
Enumerator | |
---|---|
False | ⊥ |
True | ⊤ |
Var | Boolean Variable. |
Eq | = |
Neq | != |
Gt | > |
Geq | >= |
Lt | < |
Leq | <= |
And | Conjunction (∧) |
Or | Disjunction (∨) |
Not | Negation (¬) |
Forall | Universal quantification (∀) |
Isnan | NaN check predicate. |
PositiveSemidefinite | Positive semidefinite matrix. |
|
strong |
Expression drake::symbolic::abs | ( | const Expression & | e | ) |
Expression drake::symbolic::acos | ( | const Expression & | e | ) |
Expression drake::symbolic::asin | ( | const Expression & | e | ) |
Expression drake::symbolic::atan | ( | const Expression & | e | ) |
Expression drake::symbolic::atan2 | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
VectorX<Monomial> drake::symbolic::CalcMonomialBasisOrderUpToOne | ( | const Variables & | x, |
bool | sort_monomial = false |
||
) |
Generates all the monomials of x
, such that the degree for x(i) is no larger than 1 for every x(i) in x
.
x | The variables whose monomials are generated. |
sort_monomial | If true, the returned monomials are sorted in the graded reverse lexicographic order. For example if x = (x₀, x₁) with x₀< x₁, then this function returns [x₀x₁, x₁, x₀, 1]. If sort_monomial=false, then we return the monomials in an arbitrary order. |
std::enable_if< is_eigen_vector_of<Derived1, symbolic::Monomial>::value && (is_eigen_vector_of<Derived2, double>::value || is_eigen_vector_of<Derived2, symbolic::Variable>::value || is_eigen_vector_of<Derived2, symbolic::Expression>::value), symbolic::Polynomial>::type drake::symbolic::CalcPolynomialWLowerTriangularPart | ( | const Eigen::MatrixBase< Derived1 > & | monomial_basis, |
const Eigen::MatrixBase< Derived2 > & | gram_lower | ||
) |
Returns the polynomial m(x)ᵀ * Q * m(x), where m(x) is the monomial basis, and Q is the Gram matrix.
monomial_basis | m(x) in the documentation. A vector of monomials. |
gram_lower | The lower triangular entries in Q, stacked columnwise into a vector. |
Expression drake::symbolic::ceil | ( | const Expression & | e | ) |
std::enable_if_t<is_eigen_scalar_same<DerivedA, Variable>::value && is_eigen_scalar_same<DerivedB, Variable>::value, bool> drake::symbolic::CheckStructuralEquality | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Checks if two Eigen::Matrix<Variable> m1
and m2
are structurally equal.
That is, it returns true if and only if m1(i, j)
is structurally equal to m2(i, j)
for all i
, j
.
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<DerivedA>, DerivedA> && std::is_base_of_v<Eigen::MatrixBase<DerivedB>, DerivedB> && std::is_same_v<typename DerivedA::Scalar, Expression> && std::is_same_v<typename DerivedB::Scalar, Expression>, bool> drake::symbolic::CheckStructuralEquality | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Checks if two Eigen::Matrix<Expression> m1
and m2
are structurally equal.
That is, it returns true if and only if m1(i, j)
is structurally equal to m2(i, j)
for all i
, j
.
Expression drake::symbolic::clamp | ( | const Expression & | v, |
const Expression & | lo, | ||
const Expression & | hi | ||
) |
Eigen::Matrix<BasisElement, rows, 1> drake::symbolic::ComputePolynomialBasisUpToDegree | ( | const Variables & | vars, |
int | degree, | ||
internal::DegreeType | degree_type | ||
) |
Returns all polynomial basis elements up to a given degree under the graded reverse lexicographic order.
rows | Number of rows or Eigen::Dynamic. |
BasisElement | A derived class of PolynomialBasisElement. |
vars | The variables appearing in the polynomial basis. |
degree | The highest total degree of the polynomial basis elements. |
degree_type | If degree_type is kAny, then the polynomial basis elements' degrees are no larger than degree . If degree_type is kEven, then the elements' degrees are even numbers no larger than degree . If degree_type is kOdd, then the elements' degrees are odd numbers no larger than degree . TODO(hongkai.dai): this will replace ComputeMonomialBasis in monomial_util.h. |
Expression drake::symbolic::cos | ( | const Expression & | e | ) |
Expression drake::symbolic::cosh | ( | const Expression & | e | ) |
int drake::symbolic::DecomposeAffineExpression | ( | const symbolic::Expression & | e, |
const std::unordered_map< symbolic::Variable::Id, int > & | map_var_to_index, | ||
EigenPtr< Eigen::RowVectorXd > | coeffs, | ||
double * | constant_term | ||
) |
Decomposes an affine combination e
= c0 + c1 * v1 + ...
cn * vn into the following:
constant term : c0 coefficient vector : [c1, ..., cn] variable vector : [v1, ..., vn]
Then, it extracts the coefficient and the constant term. A map from variable ID to int, map_var_to_index
, is used to decide a variable's index in a linear combination.
coeffs
is a row vector of double, whose length matches with the size of map_var_to_index
.map_var_to_index
should be in the range [0, map_var_to_index.size())[in] | e | The symbolic affine expression |
[in] | map_var_to_index | A mapping from variable ID to variable index, such that map_var_to_index[vi.get_ID()] = i. |
[out] | coeffs | A row vector. coeffs(i) = ci. |
[out] | constant_term | c0 in the equation above. |
std::exception | if the input expression is not affine. |
void drake::symbolic::DecomposeAffineExpressions | ( | const Eigen::Ref< const VectorX< Expression >> & | expressions, |
const Eigen::Ref< const VectorX< Variable >> & | vars, | ||
EigenPtr< Eigen::MatrixXd > | M, | ||
EigenPtr< Eigen::VectorXd > | v | ||
) |
Decomposes expressions
into M
* vars
+ v
.
std::exception | if expressions is not affine in vars . |
void drake::symbolic::DecomposeAffineExpressions | ( | const Eigen::Ref< const VectorX< symbolic::Expression >> & | v, |
Eigen::MatrixXd * | A, | ||
Eigen::VectorXd * | b, | ||
VectorX< Variable > * | vars | ||
) |
Given a vector of affine expressions v, decompose it to \( v = A vars + b \).
[in] | v | A vector of affine expressions |
[out] | A | The matrix containing the linear coefficients. |
[out] | b | The vector containing all the constant terms. |
[out] | vars | All variables. |
std::exception | if the input expressions are not affine. |
std::tuple<bool, Eigen::MatrixXd, Eigen::VectorXd, VectorX<Variable> > drake::symbolic::DecomposeL2NormExpression | ( | const symbolic::Expression & | e, |
double | psd_tol = 1e-8 , |
||
double | coefficient_tol = 1e-8 |
||
) |
Decomposes an L2 norm e
= |Ax+b|₂ into A, b, and the variable vector x (or returns false if the decomposition is not possible).
In order for the decomposition to succeed, the following conditions must be met:
e | The symbolic affine expression |
psd_tol | The tolerance for checking positive semidefiniteness. Eigenvalues less that this threshold are considered to be zero. Matrices with negative eigenvalues less than this threshold are considered to be not positive semidefinite, and will cause the decomposition to fail. |
coefficient_tol | The absolute tolerance for checking that the coefficients of the expression inside the sqrt match the coefficients of |Ax+b|₂². |
void drake::symbolic::DecomposeLinearExpressions | ( | const Eigen::Ref< const VectorX< Expression >> & | expressions, |
const Eigen::Ref< const VectorX< Variable >> & | vars, | ||
EigenPtr< Eigen::MatrixXd > | M | ||
) |
Decomposes expressions
into M
* vars
.
std::exception | if expressions is not linear in vars . |
std::tuple<MatrixX<Expression>, VectorX<Expression>, VectorX<Expression> > drake::symbolic::DecomposeLumpedParameters | ( | const Eigen::Ref< const VectorX< Expression >> & | f, |
const Eigen::Ref< const VectorX< Variable >> & | parameters | ||
) |
Given a vector of Expressions f
and a list of parameters
we define all additional variables in f
to be a vector of "non-parameter variables", n.
This method returns a factorization of f
into an equivalent "data
matrix", W, which depends only on the non-parameter variables, and a "lumped
parameter vector", α, which depends only on parameters:
f = W(n)*α(parameters) + w0(n).
std::exception | if f is not decomposable in this way (cells containing parameters may only be added or multiplied with cells containing non-parameter variables). |
void drake::symbolic::DecomposeQuadraticPolynomial | ( | const symbolic::Polynomial & | poly, |
const std::unordered_map< symbolic::Variable::Id, int > & | map_var_to_index, | ||
Eigen::MatrixXd * | Q, | ||
Eigen::VectorXd * | b, | ||
double * | c | ||
) |
Given a quadratic polynomial poly
, decomposes it into the form 0.5 * x' Q * x + b' * x + c.
[in] | poly | Quadratic polynomial to decompose. |
[in] | map_var_to_index | maps variables in poly.GetVariables() to the index in the vector x . |
Q[out] | The Hessian of the quadratic expression. |
num_variables x num_variables
. Q is a symmetric matrix. b[out] | The linear term of the quadratic expression. |
b
should be num_variables
. c[out] | The constant term of the quadratic expression. |
std::enable_if_t< std::is_same_v<typename Derived::Scalar, Polynomial>, MatrixLikewise<double, Derived> > drake::symbolic::Evaluate | ( | const Eigen::MatrixBase< Derived > & | m, |
const Environment & | env | ||
) |
Evaluates a matrix m
of symbolic polynomials using env
.
m
. std::exception | if NaN is detected during evaluation. |
std::enable_if_t<std::is_same_v<typename Derived::Scalar, Expression>, MatrixLikewise<double, Derived> > drake::symbolic::Evaluate | ( | const Eigen::MatrixBase< Derived > & | m, |
const Environment & | env = Environment{} , |
||
RandomGenerator * | random_generator = nullptr |
||
) |
Evaluates a symbolic matrix m
using env
and random_generator
.
If there is a random variable in m
which is unassigned in env
, this function uses random_generator
to sample a value and use the value to substitute all occurrences of the random variable in m
.
m
. std::exception | if NaN is detected during evaluation. |
std::exception | if m includes unassigned random variables but random_generator is nullptr . |
Eigen::SparseMatrix<double> drake::symbolic::Evaluate | ( | const Eigen::Ref< const Eigen::SparseMatrix< Expression >> & | m, |
const Environment & | env = Environment{} |
||
) |
Evaluates m
using a given environment (by default, an empty environment).
std::exception | if there exists a variable in m whose value is not provided by env . |
std::exception | if NaN is detected during evaluation. |
Evaluates a Chebyshev polynomial at a given value.
var_val | The value of the variable. |
degree | The degree of the Chebyshev polynomial. |
Eigen::Matrix<Monomial, Eigen::Dynamic, 1> drake::symbolic::EvenDegreeMonomialBasis | ( | const Variables & | vars, |
int | degree | ||
) |
Returns all even degree monomials up to a given degree under the graded reverse lexicographic order.
A monomial has an even degree if its total degree is even. So xy is an even degree monomial (degree 2) while x²y is not (degree 3). Note that graded reverse lexicographic order uses the total order among Variable which is based on a variable's unique ID. For example, for a given variable ordering x > y > z, EvenDegreeMonomialBasis({x, y, z}, 2)
returns a column vector [x², xy, y², xz, yz, z², 1]
.
vars
is a non-empty set. degree
is a non-negative integer. Expression drake::symbolic::exp | ( | const Expression & | e | ) |
void drake::symbolic::ExtractAndAppendVariablesFromExpression | ( | const symbolic::Expression & | e, |
VectorX< Variable > * | vars, | ||
std::unordered_map< symbolic::Variable::Id, int > * | map_var_to_index | ||
) |
Given an expression e
, extract all variables inside e
, append these variables to vars
if they are not included in vars
yet.
[in] | e | A symbolic expression. |
[in,out] | vars | As an input, vars contain the variables before extracting expression e . As an output, the variables in e that were not included in vars , will be appended to the end of vars . |
[in,out] | map_var_to_index. | map_var_to_index is of the same size as vars , and map_var_to_index[vars(i).get_id()] = i. This invariance holds for map_var_to_index both as the input and as the output. |
std::pair<VectorX<Variable>, std::unordered_map<symbolic::Variable::Id, int> > drake::symbolic::ExtractVariablesFromExpression | ( | const symbolic::Expression & | e | ) |
Given an expression e
, extracts all variables inside e
.
[in] | e | A symbolic expression. |
pair | pair.first is the variables in e . pair.second is the mapping from the variable ID to the index in pair.first, such that pair.second[pair.first(i).get_id()] = i |
std::pair<VectorX<Variable>, std::unordered_map<Variable::Id, int> > drake::symbolic::ExtractVariablesFromExpression | ( | const Eigen::Ref< const VectorX< Expression >> & | expressions | ) |
Overloads ExtractVariablesFromExpression but with a vector of expressions.
Expression drake::symbolic::floor | ( | const Expression & | e | ) |
Returns a formula f
, universally quantified by variables vars
.
const Expression& drake::symbolic::get_argument | ( | const Expression & | e | ) |
Returns the argument in the unary expression e
.
e
is a unary expression.} const std::map<Expression, Expression>& drake::symbolic::get_base_to_exponent_map_in_multiplication | ( | const Expression & | e | ) |
Returns the map from a base expression to its exponent expression in the multiplication expression e
.
For instance, given 7 * x^2 * y^3 * z^x, the return value maps 'x' to 2, 'y' to 3, and 'z' to 'x'.
e
is a multiplication expression.} const Formula& drake::symbolic::get_conditional_formula | ( | const Expression & | e | ) |
Returns the conditional formula in the if-then-else expression e
.
e
is an if-then-else expression. double drake::symbolic::get_constant_in_addition | ( | const Expression & | e | ) |
Returns the constant part of the addition expression e
.
For instance, given 7 + 2 * x + 3 * y, it returns 7.
e
is an addition expression.} double drake::symbolic::get_constant_in_multiplication | ( | const Expression & | e | ) |
Returns the constant part of the multiplication expression e
.
For instance, given 7 * x^2 * y^3, it returns 7.
e
is a multiplication expression.} double drake::symbolic::get_constant_value | ( | const Expression & | e | ) |
Returns the constant value of the constant expression e
.
e
is a constant expression.} const Expression& drake::symbolic::get_else_expression | ( | const Expression & | e | ) |
Returns the 'else' expression in the if-then-else expression e
.
e
is an if-then-else expression. const std::map<Expression, double>& drake::symbolic::get_expr_to_coeff_map_in_addition | ( | const Expression & | e | ) |
Returns the map from an expression to its coefficient in the addition expression e
.
For instance, given 7 + 2 * x + 3 * y, the return value maps 'x' to 2 and 'y' to 3.
e
is an addition expression.} const Expression& drake::symbolic::get_first_argument | ( | const Expression & | e | ) |
Returns the first argument of the binary expression e
.
e
is a binary expression.} const Expression& drake::symbolic::get_lhs_expression | ( | const Formula & | f | ) |
Returns the lhs-argument of a relational formula f
.
f
is a relational formula.} const MatrixX<Expression>& drake::symbolic::get_matrix_in_positive_semidefinite | ( | const Formula & | f | ) |
Returns the matrix in a positive-semidefinite formula f
.
f
is a positive-semidefinite formula.} Returns the formula in a negation formula f
.
f
is a negation formula.} Returns the set of formulas in a n-ary formula f
.
f
is a n-ary formula.} Returns the quantified formula in a forall formula f
.
f
is a forall formula.} Returns the quantified variables in a forall formula f
.
f
is a forall formula.} const Expression& drake::symbolic::get_rhs_expression | ( | const Formula & | f | ) |
Returns the rhs-argument of a relational formula f
.
f
is a relational formula.} const Expression& drake::symbolic::get_second_argument | ( | const Expression & | e | ) |
Returns the second argument of the binary expression e
.
e
is a binary expression.} const Expression& drake::symbolic::get_then_expression | ( | const Expression & | e | ) |
Returns the 'then' expression in the if-then-else expression e
.
e
is an if-then-else expression. const Expression& drake::symbolic::get_unary_expression | ( | const Formula & | f | ) |
Returns the expression in a unary expression formula f
.
Currently, an isnan() formula is the only kind of unary expression formula.
f
is a unary expression formula.} const std::vector<Expression>& drake::symbolic::get_uninterpreted_function_arguments | ( | const Expression & | e | ) |
Returns the arguments of an uninterpreted-function expression e
.
e
is an uninterpreted-function expression. const std::string& drake::symbolic::get_uninterpreted_function_name | ( | const Expression & | e | ) |
Returns the name of an uninterpreted-function expression e
.
e
is an uninterpreted-function expression. Returns the embedded variable in the variable formula f
.
f
is a variable formula. const Variable& drake::symbolic::get_variable | ( | const Expression & | e | ) |
Returns the embedded variable in the variable expression e
.
e
is a variable expression.} Variables drake::symbolic::GetDistinctVariables | ( | const Eigen::Ref< const MatrixX< Expression >> & | v | ) |
Returns the distinct variables in the matrix of expressions.
VectorX<Variable> drake::symbolic::GetVariableVector | ( | const Eigen::Ref< const VectorX< Expression >> & | expressions | ) |
Constructs a vector of variables from the vector of variable expressions.
std::exception | if there is an expression in vec which is not a variable. |
Expression drake::symbolic::if_then_else | ( | const Formula & | f_cond, |
const Expression & | e_then, | ||
const Expression & | e_else | ||
) |
if_then_else(cond, expr_then, expr_else)
The value returned by the above if-then-else expression is expr_then
if cond
is evaluated to true. Otherwise, it returns expr_else
.
The semantics is similar to the C++'s conditional expression constructed by its ternary operator, ?:. However, there is a key difference between the C++'s conditional expression and our
if_then_else
expression in a way the arguments are evaluated during the construction.
cond ? expr_then : expr_else
, the then expression expr_then
(respectively, the else expression expr_else
) is only evaluated when the conditional expression cond
is evaluated to true (respectively, when cond
is evaluated to false).if_then_else(cond, expr_then, expr_else)
, however, both arguments expr_then
and expr_else
are evaluated first and then passed to the if_then_else
function. min, max, abs
math functions using if_then_else
expression, it is highly recommended to use the provided native definitions for them because it allows solvers to detect specific math functions and to have a room for special optimizations.Returns the intersection of vars1
and vars2
.
This function has a time complexity of O(N₁ + N₂)
where N₁
and N₂
are the size of vars1
and vars2
respectively.
bool drake::symbolic::is_abs | ( | const Expression & | e | ) |
Checks if e
is an abs expression.
bool drake::symbolic::is_abs | ( | const ExpressionCell & | c | ) |
Checks if c
is an absolute-value-function expression.
bool drake::symbolic::is_acos | ( | const Expression & | e | ) |
Checks if e
is an arccosine expression.
bool drake::symbolic::is_acos | ( | const ExpressionCell & | c | ) |
Checks if c
is an arccosine expression.
bool drake::symbolic::is_addition | ( | const Expression & | e | ) |
Checks if e
is an addition expression.
bool drake::symbolic::is_addition | ( | const ExpressionCell & | c | ) |
Checks if c
is an addition expression.
bool drake::symbolic::is_asin | ( | const Expression & | e | ) |
Checks if e
is an arcsine expression.
bool drake::symbolic::is_asin | ( | const ExpressionCell & | c | ) |
Checks if c
is an arcsine expression.
bool drake::symbolic::is_atan | ( | const Expression & | e | ) |
Checks if e
is an arctangent expression.
bool drake::symbolic::is_atan | ( | const ExpressionCell & | c | ) |
Checks if c
is an arctangent expression.
bool drake::symbolic::is_atan2 | ( | const Expression & | e | ) |
Checks if e
is an arctangent2 expression.
bool drake::symbolic::is_atan2 | ( | const ExpressionCell & | c | ) |
Checks if c
is a arctangent2 expression.
bool drake::symbolic::is_binary | ( | const ExpressionCell & | c | ) |
Checks if c
is a binary expression.
bool drake::symbolic::is_ceil | ( | const Expression & | e | ) |
Checks if e
is a ceil expression.
bool drake::symbolic::is_ceil | ( | const ExpressionCell & | c | ) |
Checks if c
is a ceil expression.
bool drake::symbolic::is_conjunction | ( | const Formula & | f | ) |
Checks if f
is a conjunction (∧).
bool drake::symbolic::is_conjunction | ( | const FormulaCell & | f | ) |
Checks if f
is a conjunction (∧).
bool drake::symbolic::is_constant | ( | const Expression & | e | ) |
Checks if e
is a constant expression.
bool drake::symbolic::is_constant | ( | const Expression & | e, |
double | v | ||
) |
Checks if e
is a constant expression representing v
.
bool drake::symbolic::is_cos | ( | const Expression & | e | ) |
Checks if e
is a cosine expression.
bool drake::symbolic::is_cos | ( | const ExpressionCell & | c | ) |
Checks if c
is a cosine expression.
bool drake::symbolic::is_cosh | ( | const Expression & | e | ) |
Checks if e
is a hyperbolic-cosine expression.
bool drake::symbolic::is_cosh | ( | const ExpressionCell & | c | ) |
Checks if c
is a hyperbolic-cosine expression.
bool drake::symbolic::is_disjunction | ( | const Formula & | f | ) |
Checks if f
is a disjunction (∨).
bool drake::symbolic::is_disjunction | ( | const FormulaCell & | f | ) |
Checks if f
is a disjunction (∨).
bool drake::symbolic::is_division | ( | const Expression & | e | ) |
Checks if e
is a division expression.
bool drake::symbolic::is_division | ( | const ExpressionCell & | c | ) |
Checks if c
is a division expression.
bool drake::symbolic::is_equal_to | ( | const Formula & | f | ) |
Checks if f
is a formula representing equality (==).
bool drake::symbolic::is_equal_to | ( | const FormulaCell & | f | ) |
Checks if f
is a formula representing equality (==).
bool drake::symbolic::is_exp | ( | const Expression & | e | ) |
Checks if e
is an exp expression.
bool drake::symbolic::is_exp | ( | const ExpressionCell & | c | ) |
Checks if c
is an exp expression.
bool drake::symbolic::is_false | ( | const Formula & | f | ) |
Checks if f
is structurally equal to False formula.
bool drake::symbolic::is_false | ( | const FormulaCell & | f | ) |
Checks if f
is structurally equal to False formula.
bool drake::symbolic::is_floor | ( | const Expression & | e | ) |
Checks if e
is a floor expression.
bool drake::symbolic::is_floor | ( | const ExpressionCell & | c | ) |
Checks if c
is a floor expression.
bool drake::symbolic::is_forall | ( | const Formula & | f | ) |
Checks if f
is a Forall formula (∀).
bool drake::symbolic::is_forall | ( | const FormulaCell & | f | ) |
Checks if f
is a Forall formula (∀).
bool drake::symbolic::is_greater_than | ( | const Formula & | f | ) |
Checks if f
is a formula representing greater-than (>).
bool drake::symbolic::is_greater_than | ( | const FormulaCell & | f | ) |
Checks if f
is a formula representing greater-than (>).
bool drake::symbolic::is_greater_than_or_equal_to | ( | const Formula & | f | ) |
Checks if f
is a formula representing greater-than-or-equal-to (>=).
bool drake::symbolic::is_greater_than_or_equal_to | ( | const FormulaCell & | f | ) |
Checks if f
is a formula representing greater-than-or-equal-to (>=).
bool drake::symbolic::is_if_then_else | ( | const Expression & | e | ) |
Checks if e
is an if-then-else expression.
bool drake::symbolic::is_if_then_else | ( | const ExpressionCell & | c | ) |
Checks if c
is an if-then-else expression.
bool drake::symbolic::is_integer | ( | double | v | ) |
bool drake::symbolic::is_isnan | ( | const Formula & | f | ) |
Checks if f
is an isnan formula.
bool drake::symbolic::is_isnan | ( | const FormulaCell & | f | ) |
Checks if f
is an isnan formula.
bool drake::symbolic::is_less_than | ( | const Formula & | f | ) |
Checks if f
is a formula representing less-than (<).
bool drake::symbolic::is_less_than | ( | const FormulaCell & | f | ) |
Checks if f
is a formula representing less-than (<).
bool drake::symbolic::is_less_than_or_equal_to | ( | const Formula & | f | ) |
Checks if f
is a formula representing less-than-or-equal-to (<=).
bool drake::symbolic::is_less_than_or_equal_to | ( | const FormulaCell & | f | ) |
Checks if f
is a formula representing less-than-or-equal-to (<=).
bool drake::symbolic::is_log | ( | const Expression & | e | ) |
Checks if e
is a log expression.
bool drake::symbolic::is_log | ( | const ExpressionCell & | c | ) |
Checks if c
is a log expression.
bool drake::symbolic::is_max | ( | const Expression & | e | ) |
Checks if e
is a max expression.
bool drake::symbolic::is_max | ( | const ExpressionCell & | c | ) |
Checks if c
is a max expression.
bool drake::symbolic::is_min | ( | const Expression & | e | ) |
Checks if e
is a min expression.
bool drake::symbolic::is_min | ( | const ExpressionCell & | c | ) |
Checks if c
is a min expression.
bool drake::symbolic::is_multiplication | ( | const Expression & | e | ) |
Checks if e
is a multiplication expression.
bool drake::symbolic::is_multiplication | ( | const ExpressionCell & | c | ) |
Checks if c
is an multiplication expression.
bool drake::symbolic::is_nan | ( | const Expression & | e | ) |
Checks if e
is NaN.
bool drake::symbolic::is_nary | ( | const Formula & | f | ) |
Checks if f
is a n-ary formula ({∧, ∨}).
bool drake::symbolic::is_nary | ( | const FormulaCell & | f | ) |
Checks if f
is N-ary.
bool drake::symbolic::is_neg_one | ( | const Expression & | e | ) |
Checks if e
is -1.0.
bool drake::symbolic::is_negation | ( | const Formula & | f | ) |
Checks if f
is a negation (¬).
bool drake::symbolic::is_negation | ( | const FormulaCell & | f | ) |
Checks if f
is a negation (¬).
bool drake::symbolic::is_non_negative_integer | ( | double | v | ) |
bool drake::symbolic::is_not_equal_to | ( | const Formula & | f | ) |
Checks if f
is a formula representing disequality (!=).
bool drake::symbolic::is_not_equal_to | ( | const FormulaCell & | f | ) |
Checks if f
is a formula representing disequality (!=).
bool drake::symbolic::is_one | ( | const Expression & | e | ) |
Checks if e
is 1.0.
bool drake::symbolic::is_positive_integer | ( | double | v | ) |
bool drake::symbolic::is_positive_semidefinite | ( | const Formula & | f | ) |
Checks if f
is a positive-semidefinite formula.
bool drake::symbolic::is_positive_semidefinite | ( | const FormulaCell & | f | ) |
Checks if f
is a positive semidefinite formula.
bool drake::symbolic::is_pow | ( | const Expression & | e | ) |
Checks if e
is a power-function expression.
bool drake::symbolic::is_pow | ( | const ExpressionCell & | c | ) |
Checks if c
is a power-function expression.
bool drake::symbolic::is_relational | ( | const Formula & | f | ) |
Checks if f
is a relational formula ({==, !=, >, >=, <, <=}).
bool drake::symbolic::is_relational | ( | const FormulaCell & | f | ) |
Checks if f
is a relational formula ({==, !=, >, >=, <, <=}).
bool drake::symbolic::is_sin | ( | const Expression & | e | ) |
Checks if e
is a sine expression.
bool drake::symbolic::is_sin | ( | const ExpressionCell & | c | ) |
Checks if c
is a sine expression.
bool drake::symbolic::is_sinh | ( | const Expression & | e | ) |
Checks if e
is a hyperbolic-sine expression.
bool drake::symbolic::is_sinh | ( | const ExpressionCell & | c | ) |
Checks if c
is a hyperbolic-sine expression.
bool drake::symbolic::is_sqrt | ( | const Expression & | e | ) |
Checks if e
is a square-root expression.
bool drake::symbolic::is_sqrt | ( | const ExpressionCell & | c | ) |
Checks if c
is a square-root expression.
bool drake::symbolic::is_tan | ( | const Expression & | e | ) |
Checks if e
is a tangent expression.
bool drake::symbolic::is_tan | ( | const ExpressionCell & | c | ) |
Checks if c
is a tangent expression.
bool drake::symbolic::is_tanh | ( | const Expression & | e | ) |
Checks if e
is a hyperbolic-tangent expression.
bool drake::symbolic::is_tanh | ( | const ExpressionCell & | c | ) |
Checks if c
is a hyperbolic-tangent expression.
bool drake::symbolic::is_true | ( | const Formula & | f | ) |
Checks if f
is structurally equal to True formula.
bool drake::symbolic::is_true | ( | const FormulaCell & | f | ) |
Checks if f
is structurally equal to True formula.
bool drake::symbolic::is_two | ( | const Expression & | e | ) |
Checks if e
is 2.0.
bool drake::symbolic::is_unary | ( | const ExpressionCell & | c | ) |
Checks if c
is a unary expression.
bool drake::symbolic::is_uninterpreted_function | ( | const Expression & | e | ) |
Checks if e
is an uninterpreted-function expression.
bool drake::symbolic::is_uninterpreted_function | ( | const ExpressionCell & | c | ) |
Checks if c
is an uninterpreted-function expression.
bool drake::symbolic::is_variable | ( | const Formula & | f | ) |
Checks if f
is a variable formula.
bool drake::symbolic::is_variable | ( | const FormulaCell & | f | ) |
Checks if f
is a variable formula.
bool drake::symbolic::is_variable | ( | const Expression & | e | ) |
Checks if e
is a variable expression.
bool drake::symbolic::is_variable | ( | const ExpressionCell & | c | ) |
Checks if c
is a variable expression.
bool drake::symbolic::is_zero | ( | const Expression & | e | ) |
Checks if e
is 0.0.
bool drake::symbolic::IsAffine | ( | const Eigen::Ref< const MatrixX< Expression >> & | m, |
const Variables & | vars | ||
) |
Checks if every element in m
is affine in vars
.
m
is an empty matrix, it returns true. bool drake::symbolic::IsAffine | ( | const Eigen::Ref< const MatrixX< Expression >> & | m | ) |
Checks if every element in m
is affine.
m
is an empty matrix, it returns true. Formula drake::symbolic::isfinite | ( | const Expression & | e | ) |
Returns a Formula determining if the given expression e
has a finite value.
std::exception | if NaN is detected during evaluation. |
Formula drake::symbolic::isinf | ( | const Expression & | e | ) |
Returns a Formula determining if the given expression e
is a positive or negative infinity.
std::exception | if NaN is detected during evaluation. |
Formula drake::symbolic::isnan | ( | const Expression & | e | ) |
Returns a Formula for the predicate isnan(e) to the given expression.
This serves as the argument-dependent lookup related to std::isnan(double).
When this formula is evaluated, there are two possible outcomes:
isnan(e)
never returns true. MatrixX<Polynomial> drake::symbolic::Jacobian | ( | const Eigen::Ref< const VectorX< Polynomial >> & | f, |
const Eigen::Ref< const VectorX< Variable >> & | vars | ||
) |
Computes the Jacobian matrix J of the vector function f
with respect to vars
.
J(i,j) contains ∂f(i)/∂vars(j).
vars
is non-empty. MatrixX<Expression> drake::symbolic::Jacobian | ( | const Eigen::Ref< const VectorX< Expression >> & | f, |
const std::vector< Variable > & | vars | ||
) |
Computes the Jacobian matrix J of the vector function f
with respect to vars
.
J(i,j) contains ∂f(i)/∂vars(j).
For example, Jacobian([x * cos(y), x * sin(y), x^2], {x, y}) returns the following 3x2 matrix:
= |cos(y) -x * sin(y)| |sin(y) x * cos(y)| | 2 * x 0|
vars
is non-empty}. MatrixX<Expression> drake::symbolic::Jacobian | ( | const Eigen::Ref< const VectorX< Expression >> & | f, |
const Eigen::Ref< const VectorX< Variable >> & | vars | ||
) |
Computes the Jacobian matrix J of the vector function f
with respect to vars
.
J(i,j) contains ∂f(i)/∂vars(j).
vars
is non-empty}. Expression drake::symbolic::log | ( | const Expression & | e | ) |
Returns a conjunction of formulas
.
It performs the following simplification:
formulas
, it returns False.formulas
, it will not appear in the return value.Returns a disjunction of formulas
.
It performs the following simplification:
formulas
, it returns True.formulas
, it will not appear in the return value.MatrixX<Variable> drake::symbolic::MakeMatrixBinaryVariable | ( | int | rows, |
int | cols, | ||
const std::string & | name | ||
) |
Creates a dynamically-sized Eigen matrix of symbolic binary variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
Eigen::Matrix<Variable, rows, cols> drake::symbolic::MakeMatrixBinaryVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen matrix of symbolic binary variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
MatrixX<Variable> drake::symbolic::MakeMatrixBooleanVariable | ( | int | rows, |
int | cols, | ||
const std::string & | name | ||
) |
Creates a dynamically-sized Eigen matrix of symbolic Boolean variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
Eigen::Matrix<Variable, rows, cols> drake::symbolic::MakeMatrixBooleanVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen matrix of symbolic Boolean variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
MatrixX<Variable> drake::symbolic::MakeMatrixContinuousVariable | ( | int | rows, |
int | cols, | ||
const std::string & | name | ||
) |
Creates a dynamically-sized Eigen matrix of symbolic continuous variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
Eigen::Matrix<Variable, rows, cols> drake::symbolic::MakeMatrixContinuousVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen matrix of symbolic continuous variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
MatrixX<Variable> drake::symbolic::MakeMatrixIntegerVariable | ( | int | rows, |
int | cols, | ||
const std::string & | name | ||
) |
Creates a dynamically-sized Eigen matrix of symbolic integer variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
Eigen::Matrix<Variable, rows, cols> drake::symbolic::MakeMatrixIntegerVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen matrix of symbolic integer variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
MatrixX<Variable> drake::symbolic::MakeMatrixVariable | ( | int | rows, |
int | cols, | ||
const std::string & | name, | ||
Variable::Type | type = Variable::Type::CONTINUOUS |
||
) |
Creates a dynamically-sized Eigen matrix of symbolic variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
type | The type of variables in the matrix. |
Eigen::Matrix<Variable, rows, cols> drake::symbolic::MakeMatrixVariable | ( | const std::string & | name, |
Variable::Type | type = Variable::Type::CONTINUOUS |
||
) |
Creates a static-sized Eigen matrix of symbolic variables.
rows | The number of rows in the new matrix. |
cols | The number of cols in the new matrix. |
name | The common prefix for variables. The (i, j)-th element will be named as name(i, j) . |
type | The type of variables in the matrix. |
Rewriter drake::symbolic::MakeRuleRewriter | ( | const RewritingRule & | r | ) |
Constructs a rewriter based on a rewriting rule r
.
Creates a dynamically-sized Eigen vector of symbolic binary variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
Eigen::Matrix<Variable, rows, 1> drake::symbolic::MakeVectorBinaryVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen vector of symbolic binary variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
Creates a dynamically-sized Eigen vector of symbolic Boolean variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
Eigen::Matrix<Variable, rows, 1> drake::symbolic::MakeVectorBooleanVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen vector of symbolic Boolean variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
VectorX<Variable> drake::symbolic::MakeVectorContinuousVariable | ( | int | rows, |
const std::string & | name | ||
) |
Creates a dynamically-sized Eigen vector of symbolic continuous variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
Eigen::Matrix<Variable, rows, 1> drake::symbolic::MakeVectorContinuousVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen vector of symbolic continuous variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
Creates a dynamically-sized Eigen vector of symbolic integer variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
Eigen::Matrix<Variable, rows, 1> drake::symbolic::MakeVectorIntegerVariable | ( | const std::string & | name | ) |
Creates a static-sized Eigen vector of symbolic integer variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
VectorX<Variable> drake::symbolic::MakeVectorVariable | ( | int | rows, |
const std::string & | name, | ||
Variable::Type | type = Variable::Type::CONTINUOUS |
||
) |
Creates a dynamically-sized Eigen vector of symbolic variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
type | The type of variables in the vector. |
Eigen::Matrix<Variable, rows, 1> drake::symbolic::MakeVectorVariable | ( | const std::string & | name, |
Variable::Type | type = Variable::Type::CONTINUOUS |
||
) |
Creates a static-sized Eigen vector of symbolic variables.
rows | The size of vector. |
name | The common prefix for variables. The i-th element will be named as name(i) . |
type | The type of variables in the vector. |
Expression drake::symbolic::max | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
Expression drake::symbolic::min | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
Eigen::Matrix<Monomial, Eigen::Dynamic, 1> drake::symbolic::MonomialBasis | ( | const Variables & | vars, |
int | degree | ||
) |
Returns all monomials up to a given degree under the graded reverse lexicographic order.
Note that graded reverse lexicographic order uses the total order among Variable which is based on a variable's unique ID. For example, for a given variable ordering x > y > z, MonomialBasis({x, y, z}, 2)
returns a column vector [x^2, xy, y^2, xz, yz, z^2, x, y, z, 1]
.
vars
is a non-empty set. degree
is a non-negative integer. Eigen::Matrix<Monomial, NChooseK(n + degree, degree), 1> drake::symbolic::MonomialBasis | ( | const Variables & | vars | ) |
Returns all monomials up to a given degree under the graded reverse lexicographic order.
n | number of variables. |
degree | maximum total degree of monomials to compute. |
vars
is a non-empty set. n
. VectorX<Monomial> drake::symbolic::MonomialBasis | ( | const std::unordered_map< Variables, int > & | variables_degree | ) |
Returns all the monomials (in graded reverse lexicographic order) such that the total degree for each set of variables is no larger than a specific degree.
For example if x_set = {x₀, x₁} and y_set = {y₀, y₁}, then MonomialBasis({{x_set, 2}, {y_set, 1}}) will include all the monomials, whose total degree of x_set is no larger than 2, and the total degree of y_set is no larger than 1. Hence it can include monomials such as x₀x₁y₀, but not x₀y₀y₁ because the total degree for y_set is 2. So it would return the following set of monomials (ignoring the ordering) {x₀²y₀, x₀²y₁, x₀x₁y₀, x₀x₁y₁, x₁²y₀, x₁²y₀, x₀y₀, x₀y₁, x₁y₀, x₁y₁, x₀², x₀x₁, x₁², x₀, x₁, y₀, y₁, 1}.
variables_degree | (vars, degree) maps each set of variables vars to the maximal degree of these variables in the monomial. Namely the summation of the degree of each variable in vars is no larger than degree . |
variables_degree
don't overlap. variables_degree
are non-negative. Eigen::Matrix<Monomial, Eigen::Dynamic, 1> drake::symbolic::OddDegreeMonomialBasis | ( | const Variables & | vars, |
int | degree | ||
) |
Returns all odd degree monomials up to a given degree under the graded reverse lexicographic order.
A monomial has an odd degree if its total degree is odd. So x²y is an odd degree monomial (degree 3) while xy is not (degree 2). Note that graded reverse lexicographic order uses the total order among Variable which is based on a variable's unique ID. For example, for a given variable ordering x > y > z, OddDegreeMonomialBasis({x, y, z}, 3)
returns a column vector [x³, x²y, xy², y³, x²z, xyz, y²z, xz², yz², z³, x, y, z]
vars
is a non-empty set. degree
is a non-negative integer. std::map<ChebyshevBasisElement, double> drake::symbolic::operator * | ( | const ChebyshevBasisElement & | a, |
const ChebyshevBasisElement & | b | ||
) |
Returns the product of two Chebyshev basis elements.
Since Tₘ(x) * Tₙ(x) = 0.5 (Tₘ₊ₙ(x) + Tₘ₋ₙ(x)) if m >= n, the product of Chebyshev basis elements is the weighted sum of several Chebyshev basis elements. For example T₁(x)T₂(y) * T₃(x)T₁(y) = 0.25*(T₄(x)T₃(y) + T₂(x)T₃(y)
Returns a multiplication of two monomials, m1
and m2
.
RationalFunction drake::symbolic::operator * | ( | RationalFunction | f1, |
const RationalFunction & | f2 | ||
) |
RationalFunction drake::symbolic::operator * | ( | RationalFunction | f, |
const Polynomial & | p | ||
) |
RationalFunction drake::symbolic::operator * | ( | const Polynomial & | p, |
RationalFunction | f | ||
) |
RationalFunction drake::symbolic::operator * | ( | RationalFunction | f, |
double | c | ||
) |
RationalFunction drake::symbolic::operator * | ( | double | c, |
RationalFunction | f | ||
) |
RationalFunction drake::symbolic::operator * | ( | const Monomial & | m, |
RationalFunction | f | ||
) |
RationalFunction drake::symbolic::operator * | ( | RationalFunction | f, |
const Monomial & | m | ||
) |
std::map<MonomialBasisElement, double> drake::symbolic::operator * | ( | const MonomialBasisElement & | m1, |
const MonomialBasisElement & | m2 | ||
) |
Returns a multiplication of two monomials, m1
and m2
.
Eigen::Matrix<RationalFunction, MatrixL::RowsAtCompileTime, MatrixR::ColsAtCompileTime> drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following operations:
where RF is a shorthand for RationalFunction.
Provides the following operations:
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | GenericPolynomial< BasisElement > | p1, |
const GenericPolynomial< BasisElement > & | p2 | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | GenericPolynomial< BasisElement > | p, |
const BasisElement & | m | ||
) |
Polynomial drake::symbolic::operator * | ( | Polynomial | p1, |
const Polynomial & | p2 | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | GenericPolynomial< BasisElement > | p, |
double | c | ||
) |
Polynomial drake::symbolic::operator * | ( | Polynomial | p, |
const Monomial & | m | ||
) |
Polynomial drake::symbolic::operator * | ( | Polynomial | p, |
double | c | ||
) |
Polynomial drake::symbolic::operator * | ( | const Monomial & | m, |
Polynomial | p | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | const BasisElement & | m, |
GenericPolynomial< BasisElement > | p | ||
) |
Polynomial drake::symbolic::operator * | ( | const Monomial & | m, |
double | c | ||
) |
Polynomial drake::symbolic::operator * | ( | double | c, |
Polynomial | p | ||
) |
Polynomial drake::symbolic::operator * | ( | double | c, |
const Monomial & | m | ||
) |
Polynomial drake::symbolic::operator * | ( | Polynomial | p, |
const Variable & | v | ||
) |
Polynomial drake::symbolic::operator * | ( | const Variable & | v, |
Polynomial | p | ||
) |
Expression drake::symbolic::operator * | ( | const Expression & | e, |
const Polynomial & | p | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | const BasisElement & | m, |
double | c | ||
) |
Expression drake::symbolic::operator * | ( | const Polynomial & | p, |
const Expression & | e | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | double | c, |
GenericPolynomial< BasisElement > | p | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | double | c, |
const BasisElement & | m | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | GenericPolynomial< BasisElement > | p, |
const Variable & | v | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator * | ( | const Variable & | v, |
GenericPolynomial< BasisElement > | p | ||
) |
Eigen::Matrix< Polynomial, MatrixL::RowsAtCompileTime, MatrixR::ColsAtCompileTime > operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Expression drake::symbolic::operator * | ( | Expression | lhs, |
const Expression & | rhs | ||
) |
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, Expression> && std::is_same_v<typename MatrixR::Scalar, double>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, double> && std::is_same_v<typename MatrixR::Scalar, Expression>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, Expression> && std::is_same_v<typename MatrixR::Scalar, Variable>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, Variable> && std::is_same_v<typename MatrixR::Scalar, Expression>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, Variable> && std::is_same_v<typename MatrixR::Scalar, double>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, double> && std::is_same_v<typename MatrixR::Scalar, Variable>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, Variable> && std::is_same_v<typename MatrixR::Scalar, Variable>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
std::enable_if_t< std::is_base_of_v<Eigen::MatrixBase<MatrixL>, MatrixL> && std::is_base_of_v<Eigen::MatrixBase<MatrixR>, MatrixR> && std::is_same_v<typename MatrixL::Scalar, Expression> && std::is_same_v<typename MatrixR::Scalar, Expression>, internal::ExpressionMatMulResult<MatrixL, MatrixR> > drake::symbolic::operator * | ( | const MatrixL & | lhs, |
const MatrixR & | rhs | ||
) |
Provides the following matrix operations:
Provides the following operations:
auto drake::symbolic::operator * | ( | const Eigen::Transform< Expression, Dim, LhsMode, LhsOptions > & | t1, |
const Eigen::Transform< double, Dim, RhsMode, RhsOptions > & | t2 | ||
) |
Transform<double> * Transform<Expression> => Transform<Expression>
auto drake::symbolic::operator * | ( | const Eigen::Transform< double, Dim, LhsMode, LhsOptions > & | t1, |
const Eigen::Transform< Expression, Dim, RhsMode, RhsOptions > & | t2 | ||
) |
Transform<Expression> * Transform<double> => Transform<Expression>
Expression& drake::symbolic::operator *= | ( | Expression & | lhs, |
const Expression & | rhs | ||
) |
Formula drake::symbolic::operator!= | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::ArrayXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() != typename DerivedB::Scalar()), Formula>, typename internal::RelationalOpTraits<DerivedA, DerivedB>::ReturnType> drake::symbolic::operator!= | ( | const DerivedA & | a1, |
const DerivedB & | a2 | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1
and a2
using not-equal operator (!=).
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename Derived::Scalar() != ScalarType()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator!= | ( | const Derived & | a, |
const ScalarType & | v | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a
and a scalar v
using not-equal operator (!=).
That is, for all i and j, the (i, j)-th entry of (a != v)
has a symbolic formula a(i, j) != v
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(ScalarType() != typename Derived::Scalar()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator!= | ( | const ScalarType & | v, |
const Derived & | a | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v
and an array using
not-equal operator (!=).
That is, for all i and j, the (i, j)-th entry of (v != a)
has a symbolic formula v != a(i, j)
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::MatrixXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() != typename DerivedB::Scalar()), Formula>, Formula> drake::symbolic::operator!= | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Returns a symbolic formula representing the condition whether m1
and m2
are not the same.
The following table describes the return type of m1
!= m2
.
LHS \ RHS | EM<Expression> | EM<Variable> | EM<double> |
---|---|---|---|
EM<Expression> | Formula | Formula | Formula |
EM<Variable> | Formula | Formula | Formula |
EM<double> | Formula | Formula | bool |
In the table, EM
is a short-hand of Eigen::Matrix
.
Note that this function does not provide operator overloading for the following case. It returns bool
and is provided by Eigen.
RationalFunction drake::symbolic::operator+ | ( | RationalFunction | f1, |
const RationalFunction & | f2 | ||
) |
RationalFunction drake::symbolic::operator+ | ( | RationalFunction | f, |
const Polynomial & | p | ||
) |
RationalFunction drake::symbolic::operator+ | ( | const Polynomial & | p, |
RationalFunction | f | ||
) |
Returns set-union of var1
and var2
.
RationalFunction drake::symbolic::operator+ | ( | const Monomial & | m, |
RationalFunction | f | ||
) |
RationalFunction drake::symbolic::operator+ | ( | RationalFunction | f, |
const Monomial & | m | ||
) |
Returns set-union of vars
and {var}
.
RationalFunction drake::symbolic::operator+ | ( | RationalFunction | f, |
double | c | ||
) |
RationalFunction drake::symbolic::operator+ | ( | double | c, |
RationalFunction | f | ||
) |
Returns set-union of {var}
and vars
.
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | GenericPolynomial< BasisElement > | p1, |
const GenericPolynomial< BasisElement > & | p2 | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | GenericPolynomial< BasisElement > | p, |
const BasisElement & | m | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | GenericPolynomial< BasisElement > | p, |
double | c | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | const BasisElement & | m, |
GenericPolynomial< BasisElement > | p | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | const BasisElement & | m1, |
const BasisElement & | m2 | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | const BasisElement & | m, |
double | c | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | double | c, |
GenericPolynomial< BasisElement > | p | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | double | c, |
const BasisElement & | m | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | GenericPolynomial< BasisElement > | p, |
const Variable & | v | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator+ | ( | const Variable & | v, |
GenericPolynomial< BasisElement > | p | ||
) |
Polynomial drake::symbolic::operator+ | ( | Polynomial | p1, |
const Polynomial & | p2 | ||
) |
Polynomial drake::symbolic::operator+ | ( | Polynomial | p, |
const Monomial & | m | ||
) |
Polynomial drake::symbolic::operator+ | ( | Polynomial | p, |
double | c | ||
) |
Polynomial drake::symbolic::operator+ | ( | const Monomial & | m, |
Polynomial | p | ||
) |
Polynomial drake::symbolic::operator+ | ( | const Monomial & | m1, |
const Monomial & | m2 | ||
) |
Polynomial drake::symbolic::operator+ | ( | const Monomial & | m, |
double | c | ||
) |
Polynomial drake::symbolic::operator+ | ( | double | c, |
Polynomial | p | ||
) |
Polynomial drake::symbolic::operator+ | ( | double | c, |
const Monomial & | m | ||
) |
Polynomial drake::symbolic::operator+ | ( | Polynomial | p, |
const Variable & | v | ||
) |
Polynomial drake::symbolic::operator+ | ( | const Variable & | v, |
Polynomial | p | ||
) |
Expression drake::symbolic::operator+ | ( | const Expression & | e, |
const Polynomial & | p | ||
) |
Expression drake::symbolic::operator+ | ( | const Polynomial & | p, |
const Expression & | e | ||
) |
Expression drake::symbolic::operator+ | ( | Expression | lhs, |
const Expression & | rhs | ||
) |
Expression drake::symbolic::operator+ | ( | const Expression & | e | ) |
Expression drake::symbolic::operator+ | ( | const Variable & | var | ) |
Updates var1
with the result of set-union(var1
, var2
).
Updates vars
with the result of set-union(vars
, { var
}).
Expression& drake::symbolic::operator+= | ( | Expression & | lhs, |
const Expression & | rhs | ||
) |
RationalFunction drake::symbolic::operator- | ( | RationalFunction | f1, |
const RationalFunction & | f2 | ||
) |
RationalFunction drake::symbolic::operator- | ( | RationalFunction | f, |
const Polynomial & | p | ||
) |
RationalFunction drake::symbolic::operator- | ( | const Polynomial & | p, |
const RationalFunction & | f | ||
) |
RationalFunction drake::symbolic::operator- | ( | RationalFunction | f, |
double | c | ||
) |
RationalFunction drake::symbolic::operator- | ( | double | c, |
RationalFunction | f | ||
) |
RationalFunction drake::symbolic::operator- | ( | const Monomial & | m, |
RationalFunction | f | ||
) |
RationalFunction drake::symbolic::operator- | ( | RationalFunction | f, |
const Monomial & | m | ||
) |
Returns set-minus(var1
, vars2
).
Returns set-minus(vars
, { var
}).
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | const GenericPolynomial< BasisElement > & | p | ) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | GenericPolynomial< BasisElement > | p1, |
const GenericPolynomial< BasisElement > & | p2 | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | GenericPolynomial< BasisElement > | p, |
const BasisElement & | m | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | GenericPolynomial< BasisElement > | p, |
double | c | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | const BasisElement & | m, |
GenericPolynomial< BasisElement > | p | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | const BasisElement & | m1, |
const BasisElement & | m2 | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | const BasisElement & | m, |
double | c | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | double | c, |
GenericPolynomial< BasisElement > | p | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | double | c, |
const BasisElement & | m | ||
) |
Polynomial drake::symbolic::operator- | ( | const Polynomial & | p | ) |
Unary minus operation for polynomial.
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | GenericPolynomial< BasisElement > | p, |
const Variable & | v | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator- | ( | const Variable & | v, |
GenericPolynomial< BasisElement > | p | ||
) |
Polynomial drake::symbolic::operator- | ( | Polynomial | p1, |
const Polynomial & | p2 | ||
) |
Polynomial drake::symbolic::operator- | ( | Polynomial | p, |
const Monomial & | m | ||
) |
Polynomial drake::symbolic::operator- | ( | Polynomial | p, |
double | c | ||
) |
Polynomial drake::symbolic::operator- | ( | const Monomial & | m, |
Polynomial | p | ||
) |
Polynomial drake::symbolic::operator- | ( | const Monomial & | m1, |
const Monomial & | m2 | ||
) |
Polynomial drake::symbolic::operator- | ( | const Monomial & | m, |
double | c | ||
) |
Polynomial drake::symbolic::operator- | ( | double | c, |
Polynomial | p | ||
) |
Polynomial drake::symbolic::operator- | ( | double | c, |
const Monomial & | m | ||
) |
Polynomial drake::symbolic::operator- | ( | Polynomial | p, |
const Variable & | v | ||
) |
Polynomial drake::symbolic::operator- | ( | const Variable & | v, |
const Polynomial & | p | ||
) |
Expression drake::symbolic::operator- | ( | const Expression & | e, |
const Polynomial & | p | ||
) |
Expression drake::symbolic::operator- | ( | const Polynomial & | p, |
const Expression & | e | ||
) |
Expression drake::symbolic::operator- | ( | Expression | lhs, |
const Expression & | rhs | ||
) |
Expression drake::symbolic::operator- | ( | const Expression & | e | ) |
Expression drake::symbolic::operator- | ( | const Variable & | var | ) |
Updates var1
with the result of set-minus(var1
, var2
).
Updates vars
with the result of set-minus(vars
, {var}
).
Expression& drake::symbolic::operator-= | ( | Expression & | lhs, |
const Expression & | rhs | ||
) |
RationalFunction drake::symbolic::operator/ | ( | RationalFunction | f1, |
const RationalFunction & | f2 | ||
) |
std::exception | if the numerator of the divisor is structurally equal to zero. Note that this does not guarantee that the denominator of the result is not zero after expansion. |
RationalFunction drake::symbolic::operator/ | ( | RationalFunction | f, |
const Polynomial & | p | ||
) |
std::exception | if the divisor is structurally equal to zero. Note that this does not guarantee that the denominator of the result is not zero after expansion. |
RationalFunction drake::symbolic::operator/ | ( | const Polynomial & | p, |
const RationalFunction & | f | ||
) |
std::exception | if the numerator of the divisor is structurally equal to zero. Note that this does not guarantee that the denominator of the result is not zero after expansion. |
RationalFunction drake::symbolic::operator/ | ( | RationalFunction | f, |
double | c | ||
) |
std::exception | if c is 0 |
RationalFunction drake::symbolic::operator/ | ( | double | c, |
const RationalFunction & | f | ||
) |
std::exception | if the numerator of the divisor is structurally equal to zero. Note that this does not guarantee that the denominator of the result is not zero after expansion. |
RationalFunction drake::symbolic::operator/ | ( | const Monomial & | m, |
RationalFunction | f | ||
) |
RationalFunction drake::symbolic::operator/ | ( | RationalFunction | f, |
const Monomial & | m | ||
) |
Polynomial drake::symbolic::operator/ | ( | Polynomial | p, |
double | v | ||
) |
Returns p / v
.
Expression drake::symbolic::operator/ | ( | double | v, |
const Polynomial & | p | ||
) |
Expression drake::symbolic::operator/ | ( | const Expression & | e, |
const Polynomial & | p | ||
) |
Expression drake::symbolic::operator/ | ( | const Polynomial & | p, |
const Expression & | e | ||
) |
GenericPolynomialEnable<BasisElement> drake::symbolic::operator/ | ( | GenericPolynomial< BasisElement > | p, |
double | v | ||
) |
Returns p / v
.
Expression drake::symbolic::operator/ | ( | Expression | lhs, |
const Expression & | rhs | ||
) |
Expression& drake::symbolic::operator/= | ( | Expression & | lhs, |
const Expression & | rhs | ||
) |
bool drake::symbolic::operator< | ( | FormulaKind | k1, |
FormulaKind | k2 | ||
) |
bool drake::symbolic::operator< | ( | ExpressionKind | k1, |
ExpressionKind | k2 | ||
) |
Total ordering between ExpressionKinds.
Formula drake::symbolic::operator< | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(ScalarType() < typename Derived::Scalar()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator< | ( | const ScalarType & | v, |
const Derived & | a | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v
and an array using
less-than operator (<).
That is, for all i and j, the (i, j)-th entry of (v < a)
has a symbolic formula v < a(i, j)
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename Derived::Scalar() < ScalarType()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator< | ( | const Derived & | a, |
const ScalarType & | v | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a
and a scalar v
using less-than operator (<).
That is, for all i and j, the (i, j)-th entry of (a < v)
has a symbolic formula a(i, j) < v
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::ArrayXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() < typename DerivedB::Scalar()), Formula>, typename internal::RelationalOpTraits<DerivedA, DerivedB>::ReturnType> drake::symbolic::operator< | ( | const DerivedA & | a1, |
const DerivedB & | a2 | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1
and a2
using less-than operator (<).
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::MatrixXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() < typename DerivedB::Scalar()), Formula>, Formula> drake::symbolic::operator< | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Returns a symbolic formula representing element-wise comparison between two matrices m1
and m2
using less-than (<) operator.
The following table describes the return type of m1
< m2
.
LHS \ RHS | EM<Expression> | EM<Variable> | EM<double> |
---|---|---|---|
EM<Expression> | Formula | Formula | Formula |
EM<Variable> | Formula | Formula | Formula |
EM<double> | Formula | Formula | N/A |
In the table, EM
is a short-hand of Eigen::Matrix
.
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | out, |
const ChebyshevPolynomial & | p | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | os, |
Variable::Type | type | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | out, |
const ChebyshevBasisElement & | m | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | out, |
const Monomial & | m | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | out, |
const MonomialBasisElement & | m | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | os, |
const Formula & | f | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | os, |
const Polynomial & | p | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | os, |
const GenericPolynomial< BasisElement > & | p | ||
) |
std::ostream& drake::symbolic::operator<< | ( | std::ostream & | os, |
const Expression & | e | ||
) |
Formula drake::symbolic::operator<= | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::ArrayXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() <= typename DerivedB::Scalar()), Formula>, typename internal::RelationalOpTraits<DerivedA, DerivedB>::ReturnType> drake::symbolic::operator<= | ( | const DerivedA & | a1, |
const DerivedB & | a2 | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1
and a2
using less-than-or-equal operator (<=).
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename Derived::Scalar() <= ScalarType()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator<= | ( | const Derived & | a, |
const ScalarType & | v | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a
and a scalar v
using less-than-or-equal operator (<=).
That is, for all i and j, the (i, j)-th entry of (a <= v)
has a symbolic formula a(i, j) <= v
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(ScalarType() <= typename Derived::Scalar()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator<= | ( | const ScalarType & | v, |
const Derived & | a | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v
and an array using
less-than-or-equal operator (<=).
That is, for all i and j, the (i, j)-th entry of (v <= a)
has a symbolic formula v <= a(i, j)
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::MatrixXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() <= typename DerivedB::Scalar()), Formula>, Formula> drake::symbolic::operator<= | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Returns a symbolic formula representing element-wise comparison between two matrices m1
and m2
using less-than-or-equal operator (<=).
The following table describes the return type of m1
<= m2
.
LHS \ RHS | EM<Expression> | EM<Variable> | EM<double> |
---|---|---|---|
EM<Expression> | Formula | Formula | Formula |
EM<Variable> | Formula | Formula | Formula |
EM<double> | Formula | Formula | N/A |
In the table, EM
is a short-hand of Eigen::Matrix
.
Formula drake::symbolic::operator== | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::ArrayXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() == typename DerivedB::Scalar()), Formula>, typename internal::RelationalOpTraits<DerivedA, DerivedB>::ReturnType> drake::symbolic::operator== | ( | const DerivedA & | a1, |
const DerivedB & | a2 | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise symbolic-equality of two arrays m1
and m2
.
The following table describes the return type of m1
== m2
.
LHS \ RHS | EA<Expression> | EA<Variable> | EA<double> |
---|---|---|---|
EA<Expression> | EA<Formula> | EA<Formula> | EA<Formula> |
EA<Variable> | EA<Formula> | EA<Formula> | EA<Formula> |
EA<double> | EA<Formula> | EA<Formula> | EA<bool> |
In the table, EA
is a short-hand of Eigen::Array
.
Note that this function does not provide operator overloading for the following case. It returns Eigen::Array<bool>
and is provided by Eigen.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename Derived::Scalar() == ScalarType()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator== | ( | const Derived & | a, |
const ScalarType & | v | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a
and a scalar v
using equal-to operator (==).
That is, for all i and j, the (i, j)-th entry of (a == v)
has a symbolic formula a(i, j) == v
.
Here is an example using this operator overloading.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(ScalarType() == typename Derived::Scalar()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator== | ( | const ScalarType & | v, |
const Derived & | a | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v
and an array using
equal-to operator (==).
That is, for all i and j, the (i, j)-th entry of (v == a)
has a symbolic formula v == a(i, j)
.
Here is an example using this operator overloading.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::MatrixXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() == typename DerivedB::Scalar()), Formula>, Formula> drake::symbolic::operator== | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Returns a symbolic formula checking if two matrices m1
and m2
are equal.
The following table describes the return type of m1
== m2
.
LHS \ RHS | EM<Expression> | EM<Variable> | EM<double> |
---|---|---|---|
EM<Expression> | Formula | Formula | Formula |
EM<Variable> | Formula | Formula | Formula |
EM<double> | Formula | Formula | bool |
In the table, EM
is a short-hand of Eigen::Matrix
.
Note that this function does not provide operator overloading for the following case. It returns bool
and is provided by Eigen.
Note that this method returns a conjunctive formula which keeps its conjuncts as std::set<Formula>
internally. This set is ordered by Formula::Less
and this ordering can be different from the one in inputs. Also, any duplicated formulas are removed in construction. Please check the following example.
Formula drake::symbolic::operator> | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::ArrayXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() > typename DerivedB::Scalar()), Formula>, typename internal::RelationalOpTraits<DerivedA, DerivedB>::ReturnType> drake::symbolic::operator> | ( | const DerivedA & | a1, |
const DerivedB & | a2 | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1
and a2
using greater-than operator (>).
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename Derived::Scalar() > ScalarType()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator> | ( | const Derived & | a, |
const ScalarType & | v | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a
and a scalar v
using greater-than operator (>).
That is, for all i and j, the (i, j)-th entry of (a > v)
has a symbolic formula a(i, j) > v
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(ScalarType() > typename Derived::Scalar()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator> | ( | const ScalarType & | v, |
const Derived & | a | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v
and an array using
less-than operator (<) instead of greater-than operator (>).
That is, for all i and j, the (i, j)-th entry of (v > a)
has a symbolic formula a(i, j) < v
.
Note that given v > a
, this methods returns the result of a < v
. First of all, this formulation is mathematically equivalent to the original formulation. We implement this method in this way to be consistent with Eigen's semantics. See the definition of EIGEN_MAKE_CWISE_COMP_R_OP
in ArrayCwiseBinaryOps.h file in Eigen.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::MatrixXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() > typename DerivedB::Scalar()), Formula>, Formula> drake::symbolic::operator> | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Returns a symbolic formula representing element-wise comparison between two matrices m1
and m2
using greater-than operator (>).
The following table describes the return type of m1
> m2
.
LHS \ RHS | EM<Expression> | EM<Variable> | EM<double> |
---|---|---|---|
EM<Expression> | Formula | Formula | Formula |
EM<Variable> | Formula | Formula | Formula |
EM<double> | Formula | Formula | N/A |
In the table, EM
is a short-hand of Eigen::Matrix
.
Formula drake::symbolic::operator>= | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::ArrayXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() >= typename DerivedB::Scalar()), Formula>, typename internal::RelationalOpTraits<DerivedA, DerivedB>::ReturnType> drake::symbolic::operator>= | ( | const DerivedA & | a1, |
const DerivedB & | a2 | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison of two arrays a1
and a2
using greater-than-or-equal operator (>=).
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(typename Derived::Scalar() >= ScalarType()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator>= | ( | const Derived & | a, |
const ScalarType & | v | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between an array a
and a scalar v
using greater-than-or-equal operator (>=).
That is, for all i and j, the (i, j)-th entry of (a >= v)
has a symbolic formula a(i, j) >= v
.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::ArrayXpr> && std::is_same_v<decltype(ScalarType() >= typename Derived::Scalar()), Formula>, Eigen::Array<Formula, Derived::RowsAtCompileTime, Derived::ColsAtCompileTime> > drake::symbolic::operator>= | ( | const ScalarType & | v, |
const Derived & | a | ||
) |
Returns an Eigen array of symbolic formulas where each element includes element-wise comparison between a scalar v
and an array using
less-than-or-equal operator (<=) instead of greater-than-or-equal operator (>=).
That is, for all i and j, the (i, j)-th entry of (v >= a)
has a symbolic formula a(i, j) <= v
.
Note that given v >= a
, this methods returns the result of a <= v
. First of all, this formulation is mathematically equivalent to the original formulation. We implement this method in this way to be consistent with Eigen's semantics. See the definition of EIGEN_MAKE_CWISE_COMP_R_OP
in ArrayCwiseBinaryOps.h file in Eigen.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<DerivedA>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Eigen::internal::traits<DerivedB>::XprKind, Eigen::MatrixXpr> && std::is_same_v<decltype(typename DerivedA::Scalar() >= typename DerivedB::Scalar()), Formula>, Formula> drake::symbolic::operator>= | ( | const DerivedA & | m1, |
const DerivedB & | m2 | ||
) |
Returns a symbolic formula representing element-wise comparison between two matrices m1
and m2
using greater-than-or-equal operator (>=).
The following table describes the return type of m1
>= m2
.
LHS \ RHS | EM<Expression> | EM<Variable> | EM<double> |
---|---|---|---|
EM<Expression> | Formula | Formula | Formula |
EM<Variable> | Formula | Formula | Formula |
EM<double> | Formula | Formula | N/A |
In the table, EM
is a short-hand of Eigen::Matrix
.
Environment drake::symbolic::PopulateRandomVariables | ( | Environment | env, |
const Variables & | variables, | ||
RandomGenerator * | random_generator | ||
) |
Populates the environment env
by sampling values for the unassigned random variables in variables
using random_generator
.
Formula drake::symbolic::positive_semidefinite | ( | const Eigen::Ref< const MatrixX< Expression >> & | m | ) |
Returns a symbolic formula constraining m
to be a positive-semidefinite matrix.
By definition, a symmetric matrix m
is positive-semidefinte if xᵀ m x ≥ 0 for all vector x ∈ ℝⁿ.
std::exception | if m is not symmetric. |
m
is symmetric, which can be costly. If you want to avoid it, please consider using positive_semidefinite(m.triangularView<Eigen::Lower>())
or positive_semidefinite(m.triangularView<Eigen::Upper>())
instead of positive_semidefinite(m)
. Formula drake::symbolic::positive_semidefinite | ( | const MatrixX< Expression > & | m, |
Eigen::UpLoType | mode | ||
) |
Constructs and returns a symbolic positive-semidefinite formula from m
.
If mode
is Eigen::Lower, it's using the lower-triangular part of m
to construct a positive-semidefinite formula. If mode
is Eigen::Upper, the upper-triangular part of m
is used. It throws std::exception if has
other values. See the following code snippet.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Derived::Scalar, Expression>, Formula> drake::symbolic::positive_semidefinite | ( | const Eigen::TriangularView< Derived, Eigen::Lower > & | l | ) |
Constructs and returns a symbolic positive-semidefinite formula from a lower triangular-view l
.
See the following code snippet.
std::enable_if_t< std::is_same_v<typename Eigen::internal::traits<Derived>::XprKind, Eigen::MatrixXpr> && std::is_same_v<typename Derived::Scalar, Expression>, Formula> drake::symbolic::positive_semidefinite | ( | const Eigen::TriangularView< Derived, Eigen::Upper > & | u | ) |
Constructs and returns a symbolic positive-semidefinite formula from an upper triangular-view u
.
See the following code snippet.
Returns m
raised to p
.
std::exception | if p is negative. |
std::map<MonomialBasisElement, double> drake::symbolic::pow | ( | MonomialBasisElement | m, |
int | p | ||
) |
Returns m
raised to p
.
std::exception | if p is negative. |
RationalFunction drake::symbolic::pow | ( | const RationalFunction & | f, |
int | n | ||
) |
Returns the rational function f
raised to n
.
If n is positive, (f/g)ⁿ = fⁿ / gⁿ; If n is negative, (f/g)ⁿ = g⁻ⁿ / f⁻ⁿ; (f/g)⁰ = 1 / 1.
Polynomial drake::symbolic::pow | ( | const Polynomial & | p, |
int | n | ||
) |
Returns polynomial p
raised to n
.
GenericPolynomialEnable<BasisElement> drake::symbolic::pow | ( | const GenericPolynomial< BasisElement > & | p, |
int | n | ||
) |
Returns polynomial raised
to n
.
p | The base polynomial. |
n | The exponent of the power. |
Expression drake::symbolic::pow | ( | const Expression & | e1, |
const Expression & | e2 | ||
) |
symbolic::Expression drake::symbolic::ReplaceBilinearTerms | ( | const symbolic::Expression & | e, |
const Eigen::Ref< const VectorX< symbolic::Variable >> & | x, | ||
const Eigen::Ref< const VectorX< symbolic::Variable >> & | y, | ||
const Eigen::Ref< const MatrixX< symbolic::Expression >> & | W | ||
) |
Replaces all the bilinear product terms in the expression e
, with the corresponding terms in W
, where W
represents the matrix x * yᵀ, such that after replacement, e
does not have bilinear terms involving x
and y
.
For example, if e = x(0)*y(0) + 2 * x(0)*y(1) + x(1) * y(1) + 3 * x(1), e
has bilinear terms x(0)*y(0), x(0) * y(1) and x(2) * y(1), if we call ReplaceBilinearTerms(e, x, y, W) where W(i, j) represent the term x(i) * y(j), then this function returns W(0, 0) + 2 * W(0, 1) + W(1, 1) + 3 * x(1).
e | An expression potentially contains bilinear products between x and y. |
x | The bilinear product between x and y will be replaced by the corresponding term in W . |
std::exception | if x contains duplicate entries. |
y | The bilinear product between x and y will be replaced by the corresponding term in W. @throws std::exception if y` contains duplicate entries. |
W | Bilinear product term x(i) * y(j) will be replaced by W(i, j). If W(i,j) is not a single variable, but an expression, then this expression cannot contain a variable in either x or y. |
std::exception,if | W(i, j) is not a single variable, and also contains a variable in x or y. |
Expression drake::symbolic::sin | ( | const Expression & | e | ) |
Expression drake::symbolic::sinh | ( | const Expression & | e | ) |
Expression drake::symbolic::sqrt | ( | const Expression & | e | ) |
Expression drake::symbolic::Substitute | ( | const Expression & | e, |
const SinCosSubstitution & | subs | ||
) |
Given a substitution map q => {s, c}, substitutes instances of sin(q) and cos(q) in e
with s
and c
, with partial support for trigonometric expansions.
For instance,
Variable x{"x"}, y{"y"}; Variable sx{"sx"}, cx{"cx"}, sy{"sy"}, cy{"cy"}; SinCosSubstitution subs; subs.emplace(x, SinCos(sx, cx)); subs.emplace(y, SinCos(sy, cy)); Expression e = Substitute(x * sin(x + y), subs);
will result in the expression x * (sx*cy + cx*sy)
.
half_angle | If true, then the same workflow replaces instances of sin(q/2) and cos(q/2) in e will be replaced with s , and c . Default: false. |
The half-angle representation is more natural in many analysis computations for robots, for instance: https://underactuated.csail.mit.edu/lyapunov.html#trig_quadratic
std::exception | if a trigonometric function is not a trigonometric polynomial in q or if the e requires a trigonometric expansion that not supported yet. |
MatrixLikewise<Expression, Derived> drake::symbolic::Substitute | ( | const Eigen::MatrixBase< Derived > & | m, |
const SinCosSubstitution & | subs | ||
) |
Matrix version of sin/cos substitution.
MatrixLikewise<Expression, Derived> drake::symbolic::Substitute | ( | const Eigen::MatrixBase< Derived > & | m, |
const Substitution & | subst | ||
) |
Substitutes a symbolic matrix m
using a given substitution subst
.
m
. std::exception | if NaN is detected during substitution. |
MatrixLikewise<Expression, Derived> drake::symbolic::Substitute | ( | const Eigen::MatrixBase< Derived > & | m, |
const Variable & | var, | ||
const Expression & | e | ||
) |
Substitutes var
with e
in a symbolic matrix m
.
m
. std::exception | if NaN is detected during substitution. |
symbolic::RationalFunction drake::symbolic::SubstituteStereographicProjection | ( | const symbolic::Polynomial & | e, |
const std::vector< SinCos > & | sin_cos, | ||
const VectorX< symbolic::Variable > & | t | ||
) |
Substitutes the variables representing sine and cosine functions with their stereographic projection.
We replace cosθᵢ with (1-tᵢ²)/(1+tᵢ²), and sinθᵢ with 2tᵢ/(1+tᵢ²), and get a rational polynomial. The indeterminates of this rational polynomial are t together with the indeterminates in e
that are not cosθ or sinθ. If the input expression doesn't contain the sine and cosine functions, then the returned rational has denominator being 1. Notice that the indeterminates of e
can include variables other than cosθ and sinθ, and we impose no requirements on these variables that are not cosθ or sinθ.
e | The symbolic polynomial to be substituted. |
sin_cos | sin_cos(i) is the pair of variables (sᵢ, cᵢ), (where sᵢ=sinθᵢ, cᵢ=cosθᵢ) as documented above. |
t | New variables to express cos and sin as rationals of t. tᵢ = tan(θᵢ/2). |
t
together with the indeterminates in e
that are not cosθ or sinθ. Example * std::vector<SinCos> sin_cos; * sin_cos.emplace_back(symbolic::Variable("s0"), symbolic::Variable("c0")); * sin_cos.emplace_back(symbolic::Variable("s1"), symbolic::Variable("c1")); * Vector2<symbolic::Variable> t(symbolic::Variable("t0"), * symbolic::Variable("t1")); * const auto e_rational = * SubstituteStereographicProjection(t(0) * sin_cos[0].s*sin_cos[1].c + 1, * sin_cos, t); * // e_rational should be * // (2*t0*t0*(1-t1*t1) + (1+t0*t0)*(1+t1*t1)) * // -------------------------------------------- * // ((1+t0*t0)*(1+t1*t1)) *
void drake::symbolic::swap | ( | Expression & | a, |
Expression & | b | ||
) |
Expression drake::symbolic::tan | ( | const Expression & | e | ) |
Expression drake::symbolic::tanh | ( | const Expression & | e | ) |
Expression drake::symbolic::TaylorExpand | ( | const Expression & | f, |
const Environment & | a, | ||
int | order | ||
) |
Returns the Taylor series expansion of f
around a
of order order
.
[in] | f | Symbolic expression to approximate using Taylor series expansion. |
[in] | a | Symbolic environment which specifies the point of approximation. If a partial environment is provided, the unspecified variables are treated as symbolic variables (e.g. decision variable). |
[in] | order | Positive integer which specifies the maximum order of the resulting polynomial approximating f around a . |
std::shared_ptr<const FormulaAnd> drake::symbolic::to_conjunction | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaAnd>
.
is_conjunction(*f_ptr)
is true. std::shared_ptr<const FormulaOr> drake::symbolic::to_disjunction | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaOr>
.
is_disjunction(*f_ptr)
is true. std::shared_ptr<const FormulaEq> drake::symbolic::to_equal_to | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaEq>
.
is_equal_to(*f_ptr)
is true. std::shared_ptr<const FormulaFalse> drake::symbolic::to_false | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaFalse>
.
is_false(*f_ptr)
is true. std::shared_ptr<const FormulaForall> drake::symbolic::to_forall | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaForall>
.
is_forall(*f_ptr)
is true. std::shared_ptr<const FormulaGt> drake::symbolic::to_greater_than | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaGt>
.
is_greater_than(*f_ptr)
is true. std::shared_ptr<const FormulaGeq> drake::symbolic::to_greater_than_or_equal_to | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaGeq>
.
is_greater_than_or_equal_to(*f_ptr)
is true. std::shared_ptr<const FormulaIsnan> drake::symbolic::to_isnan | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaIsnan>
.
is_isnan(*f_ptr)
is true. std::shared_ptr<const FormulaLt> drake::symbolic::to_less_than | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaLt>
.
is_less_than(*f_ptr)
is true. std::shared_ptr<const FormulaLeq> drake::symbolic::to_less_than_or_equal_to | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaLeq>
.
is_less_than_or_equal_to(*f_ptr)
is true. std::shared_ptr<const NaryFormulaCell> drake::symbolic::to_nary | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const NaryFormulaCell>
.
is_nary(*f_ptr)
is true. std::shared_ptr<const FormulaNot> drake::symbolic::to_negation | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaNot>
.
is_negation(*f_ptr)
is true. std::shared_ptr<const FormulaNeq> drake::symbolic::to_not_equal_to | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaNeq>
.
is_not_equal_to(*f_ptr)
is true. std::shared_ptr<const FormulaPositiveSemidefinite> drake::symbolic::to_positive_semidefinite | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaPositiveSemidefinite>
.
is_positive_semidefinite(*f_ptr)
is true. std::shared_ptr<const RelationalFormulaCell> drake::symbolic::to_relational | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const RelationalFormulaCell>
.
is_relational(*f_ptr)
is true. std::shared_ptr<const FormulaTrue> drake::symbolic::to_true | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaTrue>
.
is_true(*f_ptr)
is true. std::shared_ptr<const FormulaVar> drake::symbolic::to_variable | ( | const std::shared_ptr< const FormulaCell > & | f_ptr | ) |
Casts f_ptr
to shared_ptr<const FormulaVar>
.
is_variable(*f_ptr)
is true. std::string drake::symbolic::ToLatex | ( | const Expression & | e, |
int | precision = 3 |
||
) |
Generates a LaTeX string representation of e
with floating point coefficients displayed using precision
.
Generates a LaTeX string representation of f
with floating point coefficients displayed using precision
.
Generates a Latex string representation of val
displayed with precision
, with one exception.
If the fractional part of val
is exactly zero, then val
is represented perfectly as an integer, and is displayed without the trailing decimal point and zeros (in this case, the precision
argument is ignored).
std::string drake::symbolic::ToLatex | ( | const Eigen::PlainObjectBase< Derived > & | M, |
int | precision = 3 |
||
) |
Generates a LaTeX string representation of M
with floating point coefficients displayed using precision
.
Expression drake::symbolic::uninterpreted_function | ( | std::string | name, |
std::vector< Expression > | arguments | ||
) |
Constructs an uninterpreted-function expression with name
and arguments
.
An uninterpreted function is an opaque function that has no other property than its name and a list of its arguments. This is useful to applications where it is good enough to provide abstract information of a function without exposing full details. Declaring sparsity of a system is a typical example.
Result drake::symbolic::VisitExpression | ( | Visitor * | v, |
const Expression & | e, | ||
Args &&... | args | ||
) |
Calls visitor object v
with a symbolic-expression e
, and arguments args
.
Visitor object is expected to implement the following methods which take f
and args:
VisitConstant
, VisitVariable
, VisitAddition
, VisitMultiplication
, VisitDivision
, VisitLog
, VisitAbs
, VisitExp
, VisitSqrt
, VisitPow
, VisitSin
, VisitCos
, VisitTan
, VisitAsin
, VisitAtan
, VisitAtan2
, VisitSinh
, VisitCosh
, VisitTanh
, VisitMin
, VisitMax
, VisitCeil
, VisitFloor
, VisitIfThenElse
, `VisitUninterpretedFunction.
std::exception | if NaN is detected during a visit. |
Result drake::symbolic::VisitFormula | ( | Visitor * | v, |
const Formula & | f, | ||
Args &&... | args | ||
) |
Calls visitor object v
with a symbolic formula f
, and arguments args
.
Visitor object is expected to implement the following methods which take f
and args:
VisitFalse
, VisitTrue
, VisitVariable
, VisitEqualTo
, VisitNotEqualTo, VisitGreaterThan, VisitGreaterThanOrEqualTo
, VisitLessThan
, VisitLessThanOrEqualTo
, VisitConjunction
, VisitDisjunction
, VisitNegation
, VisitForall
, VisitIsnan
, VisitPositiveSemidefinite
.
Check the implementation of NegationNormalFormConverter
class in drake/common/test/symbolic_formula_visitor_test.cc file to find an example.
Result drake::symbolic::VisitPolynomial | ( | Visitor * | v, |
const Expression & | e, | ||
Args &&... | args | ||
) |
Calls visitor object v
with a polynomial symbolic-expression e
, and arguments args
.
Visitor object is expected to implement the following methods which take f
and args:
VisitConstant
, VisitVariable
, VisitAddition
, VisitMultiplication
, VisitDivision
, VisitPow
.
std::exception | if NaN is detected during a visit. |
See the implementation of DegreeVisitor
class and Degree
function in drake/common/symbolic_monomial.cc as an example usage.