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 ∧ ... ∧ fn). 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 ∨ ... ∨ fn). 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 |
| 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). | |
| using | Pattern = Expression |
| A pattern is an expression which possibly includes variables which represent placeholders. | |
| 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> |
Enumerations | |
| enum class | 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 class | FormulaKind { False , True , Var , Eq , Neq , Gt , Geq , Lt , Leq , And , Or , Not , Forall , Isnan , PositiveSemidefinite } |
| Kinds of symbolic formulas. More... | |
| enum class | SinCosSubstitutionType { kAngle , kHalfAnglePreferSin , kHalfAnglePreferCos } |
Functions | |
| std::map< ChebyshevBasisElement, double > | operator* (const ChebyshevBasisElement &a, const ChebyshevBasisElement &b) |
| Returns the product of two Chebyshev basis elements. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| bool | IsAffine (const Eigen::Ref< const MatrixX< Expression > > &m, const Variables &vars) |
| Checks if every element in m is affine in vars. | |
| bool | IsAffine (const Eigen::Ref< const MatrixX< Expression > > &m) |
| Checks if every element in m is affine. | |
| 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. | |
| 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. | |
| void | ExtractAndAppendVariablesFromExpression (const symbolic::Expression &e, std::vector< Variable > *vars, std::unordered_map< symbolic::Variable::Id, int > *map_var_to_index) |
| Given an expression e, extracts all variables inside e, appends these variables to vars if they are not included in vars yet. | |
| 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. | |
| 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. | |
| 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. | |
| 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
\). | |
| 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 + ... cn * vn into the following: | |
| 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. | |
| 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). | |
| 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. | |
| 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. | |
| 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. | |
| bool | is_constant (const Expression &e, double v) |
Checks if e is a constant expression representing v. | |
| bool | is_zero (const Expression &e) |
Checks if e is 0.0. | |
| bool | is_one (const Expression &e) |
Checks if e is 1.0. | |
| bool | is_neg_one (const Expression &e) |
Checks if e is -1.0. | |
| bool | is_two (const Expression &e) |
Checks if e is 2.0. | |
| bool | is_nan (const Expression &e) |
Checks if e is NaN. | |
| bool | is_variable (const Expression &e) |
Checks if e is a variable expression. | |
| bool | is_addition (const Expression &e) |
Checks if e is an addition expression. | |
| bool | is_multiplication (const Expression &e) |
Checks if e is a multiplication expression. | |
| bool | is_division (const Expression &e) |
Checks if e is a division expression. | |
| bool | is_log (const Expression &e) |
Checks if e is a log expression. | |
| bool | is_abs (const Expression &e) |
Checks if e is an abs expression. | |
| bool | is_exp (const Expression &e) |
Checks if e is an exp expression. | |
| bool | is_sqrt (const Expression &e) |
Checks if e is a square-root expression. | |
| bool | is_pow (const Expression &e) |
Checks if e is a power-function expression. | |
| bool | is_sin (const Expression &e) |
Checks if e is a sine expression. | |
| bool | is_cos (const Expression &e) |
Checks if e is a cosine expression. | |
| bool | is_tan (const Expression &e) |
Checks if e is a tangent expression. | |
| bool | is_asin (const Expression &e) |
Checks if e is an arcsine expression. | |
| bool | is_acos (const Expression &e) |
Checks if e is an arccosine expression. | |
| bool | is_atan (const Expression &e) |
Checks if e is an arctangent expression. | |
| bool | is_atan2 (const Expression &e) |
Checks if e is an arctangent2 expression. | |
| bool | is_sinh (const Expression &e) |
Checks if e is a hyperbolic-sine expression. | |
| bool | is_cosh (const Expression &e) |
Checks if e is a hyperbolic-cosine expression. | |
| bool | is_tanh (const Expression &e) |
Checks if e is a hyperbolic-tangent expression. | |
| bool | is_min (const Expression &e) |
Checks if e is a min expression. | |
| bool | is_max (const Expression &e) |
Checks if e is a max expression. | |
| bool | is_ceil (const Expression &e) |
Checks if e is a ceil expression. | |
| bool | is_floor (const Expression &e) |
Checks if e is a floor expression. | |
| bool | is_if_then_else (const Expression &e) |
Checks if e is an if-then-else expression. | |
| bool | is_uninterpreted_function (const Expression &e) |
Checks if e is an uninterpreted-function expression. | |
| double | get_constant_value (const Expression &e) |
Returns the constant value of the constant expression e. | |
| const Variable & | get_variable (const Expression &e) |
Returns the embedded variable in the variable expression e. | |
| const Expression & | get_argument (const Expression &e) |
Returns the argument in the unary expression e. | |
| const Expression & | get_first_argument (const Expression &e) |
Returns the first argument of the binary expression e. | |
| const Expression & | get_second_argument (const Expression &e) |
Returns the second argument of the binary expression e. | |
| double | get_constant_in_addition (const Expression &e) |
Returns the constant part of the addition expression e. | |
| 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. | |
| double | get_constant_in_multiplication (const Expression &e) |
Returns the constant part of the multiplication expression e. | |
| 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. | |
| const std::string & | get_uninterpreted_function_name (const Expression &e) |
Returns the name of an uninterpreted-function expression e. | |
| const std::vector< Expression > & | get_uninterpreted_function_arguments (const Expression &e) |
Returns the arguments of an uninterpreted-function expression e. | |
| const Formula & | get_conditional_formula (const Expression &e) |
Returns the conditional formula in the if-then-else expression e. | |
| const Expression & | get_then_expression (const Expression &e) |
Returns the 'then' expression in the if-then-else expression e. | |
| const Expression & | get_else_expression (const Expression &e) |
Returns the 'else' expression in the if-then-else expression e. | |
| 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. | |
| 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: | |
| 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: | |
| 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: | |
| 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: | |
| 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: | |
| 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: | |
| 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: | |
| 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: | |
| 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> | |
| 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> | |
| 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. | |
| 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). | |
| 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. | |
| 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. | |
| VectorX< Variable > | GetVariableVector (const Eigen::Ref< const VectorX< Expression > > &expressions) |
| Constructs a vector of variables from the vector of variable expressions. | |
| 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. | |
| 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. | |
| Variables | GetDistinctVariables (const Eigen::Ref< const MatrixX< Expression > > &v) |
| Returns the distinct variables in the matrix of expressions. | |
| 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. | |
| 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. | |
| bool | is_unary (const ExpressionCell &c) |
Checks if c is a unary expression. | |
| bool | is_binary (const ExpressionCell &c) |
Checks if c is a binary expression. | |
| bool | is_addition (const ExpressionCell &c) |
Checks if c is an addition expression. | |
| bool | is_multiplication (const ExpressionCell &c) |
Checks if c is an multiplication expression. | |
| bool | is_division (const ExpressionCell &c) |
Checks if c is a division expression. | |
| bool | is_log (const ExpressionCell &c) |
Checks if c is a log expression. | |
| bool | is_abs (const ExpressionCell &c) |
Checks if c is an absolute-value-function expression. | |
| bool | is_exp (const ExpressionCell &c) |
Checks if c is an exp expression. | |
| bool | is_sqrt (const ExpressionCell &c) |
Checks if c is a square-root expression. | |
| bool | is_pow (const ExpressionCell &c) |
Checks if c is a power-function expression. | |
| bool | is_sin (const ExpressionCell &c) |
Checks if c is a sine expression. | |
| bool | is_cos (const ExpressionCell &c) |
Checks if c is a cosine expression. | |
| bool | is_tan (const ExpressionCell &c) |
Checks if c is a tangent expression. | |
| bool | is_asin (const ExpressionCell &c) |
Checks if c is an arcsine expression. | |
| bool | is_acos (const ExpressionCell &c) |
Checks if c is an arccosine expression. | |
| bool | is_atan (const ExpressionCell &c) |
Checks if c is an arctangent expression. | |
| bool | is_atan2 (const ExpressionCell &c) |
Checks if c is a arctangent2 expression. | |
| bool | is_sinh (const ExpressionCell &c) |
Checks if c is a hyperbolic-sine expression. | |
| bool | is_cosh (const ExpressionCell &c) |
Checks if c is a hyperbolic-cosine expression. | |
| bool | is_tanh (const ExpressionCell &c) |
Checks if c is a hyperbolic-tangent expression. | |
| bool | is_min (const ExpressionCell &c) |
Checks if c is a min expression. | |
| bool | is_max (const ExpressionCell &c) |
Checks if c is a max expression. | |
| bool | is_ceil (const ExpressionCell &c) |
Checks if c is a ceil expression. | |
| bool | is_floor (const ExpressionCell &c) |
Checks if c is a floor expression. | |
| bool | is_if_then_else (const ExpressionCell &c) |
Checks if c is an if-then-else expression. | |
| bool | is_uninterpreted_function (const ExpressionCell &c) |
Checks if c is an uninterpreted-function expression. | |
| bool | operator< (ExpressionKind k1, ExpressionKind k2) |
| Total ordering between ExpressionKinds. | |
| 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. | |
| 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. | |
| bool | operator< (FormulaKind k1, FormulaKind k2) |
| Formula | forall (const Variables &vars, const Formula &f) |
Returns a formula f, universally quantified by variables vars. | |
| Formula | make_conjunction (const std::set< Formula > &formulas) |
Returns a conjunction of formulas. | |
| 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. | |
| 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. | |
| Formula | isinf (const Expression &e) |
Returns a Formula determining if the given expression e is a positive or negative infinity. | |
| Formula | isfinite (const Expression &e) |
Returns a Formula determining if the given expression e has a finite value. | |
| Formula | positive_semidefinite (const Eigen::Ref< const MatrixX< Expression > > &m) |
Returns a symbolic formula constraining m to be a positive-semidefinite matrix. | |
| Formula | positive_semidefinite (const MatrixX< Expression > &m, Eigen::UpLoType mode) |
Constructs and returns a symbolic positive-semidefinite formula from m. | |
| 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. | |
| 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. | |
| std::ostream & | operator<< (std::ostream &os, const Formula &f) |
| bool | is_false (const Formula &f) |
Checks if f is structurally equal to False formula. | |
| bool | is_true (const Formula &f) |
Checks if f is structurally equal to True formula. | |
| bool | is_variable (const Formula &f) |
Checks if f is a variable formula. | |
| bool | is_equal_to (const Formula &f) |
Checks if f is a formula representing equality (==). | |
| bool | is_not_equal_to (const Formula &f) |
Checks if f is a formula representing disequality (!=). | |
| bool | is_greater_than (const Formula &f) |
Checks if f is a formula representing greater-than (>). | |
| bool | is_greater_than_or_equal_to (const Formula &f) |
Checks if f is a formula representing greater-than-or-equal-to (>=). | |
| bool | is_less_than (const Formula &f) |
Checks if f is a formula representing less-than (<). | |
| bool | is_less_than_or_equal_to (const Formula &f) |
Checks if f is a formula representing less-than-or-equal-to (<=). | |
| bool | is_relational (const Formula &f) |
Checks if f is a relational formula ({==, !=, >, >=, <, <=}). | |
| bool | is_conjunction (const Formula &f) |
Checks if f is a conjunction (∧). | |
| bool | is_disjunction (const Formula &f) |
Checks if f is a disjunction (∨). | |
| bool | is_nary (const Formula &f) |
Checks if f is a n-ary formula ({∧, ∨}). | |
| bool | is_negation (const Formula &f) |
Checks if f is a negation (¬). | |
| bool | is_forall (const Formula &f) |
Checks if f is a Forall formula (∀). | |
| bool | is_isnan (const Formula &f) |
Checks if f is an isnan formula. | |
| bool | is_positive_semidefinite (const Formula &f) |
Checks if f is a positive-semidefinite formula. | |
| const Variable & | get_variable (const Formula &f) |
Returns the embedded variable in the variable formula f. | |
| const Expression & | get_lhs_expression (const Formula &f) |
Returns the lhs-argument of a relational formula f. | |
| const Expression & | get_rhs_expression (const Formula &f) |
Returns the rhs-argument of a relational formula f. | |
| const Expression & | get_unary_expression (const Formula &f) |
Returns the expression in a unary expression formula f. | |
| const std::set< Formula > & | get_operands (const Formula &f) |
Returns the set of formulas in a n-ary formula f. | |
| const Formula & | get_operand (const Formula &f) |
Returns the formula in a negation formula f. | |
| const Variables & | get_quantified_variables (const Formula &f) |
Returns the quantified variables in a forall formula f. | |
| const Formula & | get_quantified_formula (const Formula &f) |
Returns the quantified formula in a forall formula f. | |
| const MatrixX< Expression > & | get_matrix_in_positive_semidefinite (const Formula &f) |
Returns the matrix in a positive-semidefinite formula f. | |
| 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. | |
| 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 (==). | |
| 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 (==). | |
| 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 (<=). | |
| 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 (<=). | |
| 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 (<=). | |
| 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 (<). | |
| 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 (<). | |
| 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 (<). | |
| 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 (>=). | |
| 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 (>=). | |
| 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 (>=). | |
| 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 (>). | |
| 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 (>). | |
| 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 (>). | |
| 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 (!=). | |
| 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 (!=). | |
| 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 (!=). | |
| 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. | |
| 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. | |
| 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. | |
| 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 (<=). | |
| 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 (>). | |
| 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 (>=). | |
| bool | is_false (const FormulaCell &f) |
Checks if f is structurally equal to False formula. | |
| bool | is_true (const FormulaCell &f) |
Checks if f is structurally equal to True formula. | |
| bool | is_variable (const FormulaCell &f) |
Checks if f is a variable formula. | |
| bool | is_equal_to (const FormulaCell &f) |
Checks if f is a formula representing equality (==). | |
| bool | is_not_equal_to (const FormulaCell &f) |
Checks if f is a formula representing disequality (!=). | |
| bool | is_greater_than (const FormulaCell &f) |
Checks if f is a formula representing greater-than (>). | |
| bool | is_greater_than_or_equal_to (const FormulaCell &f) |
Checks if f is a formula representing greater-than-or-equal-to (>=). | |
| bool | is_less_than (const FormulaCell &f) |
Checks if f is a formula representing less-than (<). | |
| bool | is_less_than_or_equal_to (const FormulaCell &f) |
Checks if f is a formula representing less-than-or-equal-to (<=). | |
| bool | is_relational (const FormulaCell &f) |
Checks if f is a relational formula ({==, !=, >, >=, <, <=}). | |
| bool | is_conjunction (const FormulaCell &f) |
Checks if f is a conjunction (∧). | |
| bool | is_disjunction (const FormulaCell &f) |
Checks if f is a disjunction (∨). | |
| bool | is_nary (const FormulaCell &f) |
Checks if f is N-ary. | |
| bool | is_negation (const FormulaCell &f) |
Checks if f is a negation (¬). | |
| bool | is_forall (const FormulaCell &f) |
Checks if f is a Forall formula (∀). | |
| bool | is_isnan (const FormulaCell &f) |
Checks if f is an isnan formula. | |
| bool | is_positive_semidefinite (const FormulaCell &f) |
Checks if f is a positive semidefinite formula. | |
| std::shared_ptr< const FormulaFalse > | to_false (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaFalse>. | |
| std::shared_ptr< const FormulaTrue > | to_true (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaTrue>. | |
| std::shared_ptr< const FormulaVar > | to_variable (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaVar>. | |
| std::shared_ptr< const RelationalFormulaCell > | to_relational (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const RelationalFormulaCell>. | |
| std::shared_ptr< const FormulaEq > | to_equal_to (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaEq>. | |
| 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>. | |
| std::shared_ptr< const FormulaGt > | to_greater_than (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaGt>. | |
| 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>. | |
| std::shared_ptr< const FormulaLt > | to_less_than (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaLt>. | |
| 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>. | |
| std::shared_ptr< const FormulaAnd > | to_conjunction (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaAnd>. | |
| std::shared_ptr< const FormulaOr > | to_disjunction (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaOr>. | |
| std::shared_ptr< const NaryFormulaCell > | to_nary (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const NaryFormulaCell>. | |
| std::shared_ptr< const FormulaNot > | to_negation (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaNot>. | |
| std::shared_ptr< const FormulaForall > | to_forall (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaForall>. | |
| std::shared_ptr< const FormulaIsnan > | to_isnan (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaIsnan>. | |
| std::shared_ptr< const FormulaPositiveSemidefinite > | to_positive_semidefinite (const std::shared_ptr< const FormulaCell > &f_ptr) |
Casts f_ptr to shared_ptr<const FormulaPositiveSemidefinite>. | |
| 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. | |
| 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. | |
| MatrixX< Variable > | MakeMatrixBooleanVariable (int rows, int cols, const std::string &name) |
| Creates a dynamically-sized Eigen matrix of symbolic Boolean variables. | |
| MatrixX< Variable > | MakeMatrixBinaryVariable (int rows, int cols, const std::string &name) |
| Creates a dynamically-sized Eigen matrix of symbolic binary variables. | |
| MatrixX< Variable > | MakeMatrixContinuousVariable (int rows, int cols, const std::string &name) |
| Creates a dynamically-sized Eigen matrix of symbolic continuous variables. | |
| MatrixX< Variable > | MakeMatrixIntegerVariable (int rows, int cols, const std::string &name) |
| Creates a dynamically-sized Eigen matrix of symbolic integer variables. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| VectorX< Variable > | MakeVectorVariable (int rows, const std::string &name, Variable::Type type=Variable::Type::CONTINUOUS) |
| Creates a dynamically-sized Eigen vector of symbolic variables. | |
| VectorX< Variable > | MakeVectorBooleanVariable (int rows, const std::string &name) |
| Creates a dynamically-sized Eigen vector of symbolic Boolean variables. | |
| VectorX< Variable > | MakeVectorBinaryVariable (int rows, const std::string &name) |
| Creates a dynamically-sized Eigen vector of symbolic binary variables. | |
| VectorX< Variable > | MakeVectorContinuousVariable (int rows, const std::string &name) |
| Creates a dynamically-sized Eigen vector of symbolic continuous variables. | |
| VectorX< Variable > | MakeVectorIntegerVariable (int rows, const std::string &name) |
| Creates a dynamically-sized Eigen vector of symbolic integer variables. | |
| 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. | |
| template<int rows> | |
| Eigen::Matrix< Variable, rows, 1 > | MakeVectorBooleanVariable (const std::string &name) |
| Creates a static-sized Eigen vector of symbolic Boolean variables. | |
| template<int rows> | |
| Eigen::Matrix< Variable, rows, 1 > | MakeVectorBinaryVariable (const std::string &name) |
| Creates a static-sized Eigen vector of symbolic binary variables. | |
| template<int rows> | |
| Eigen::Matrix< Variable, rows, 1 > | MakeVectorContinuousVariable (const std::string &name) |
| Creates a static-sized Eigen vector of symbolic continuous variables. | |
| template<int rows> | |
| Eigen::Matrix< Variable, rows, 1 > | MakeVectorIntegerVariable (const std::string &name) |
| Creates a static-sized Eigen vector of symbolic integer variables. | |
| 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. | |
| Variables & | operator+= (Variables &vars1, const Variables &vars2) |
Updates var1 with the result of set-union(var1, var2). | |
| Variables & | operator+= (Variables &vars, const Variable &var) |
Updates vars with the result of set-union(vars, { var }). | |
| Variables | operator+ (Variables vars1, const Variables &vars2) |
Returns set-union of var1 and var2. | |
| Variables | operator+ (Variables vars, const Variable &var) |
Returns set-union of vars and {var}. | |
| Variables | operator+ (const Variable &var, Variables vars) |
Returns set-union of {var} and vars. | |
| Variables & | operator-= (Variables &vars1, const Variables &vars2) |
Updates var1 with the result of set-minus(var1, var2). | |
| Variables & | operator-= (Variables &vars, const Variable &var) |
Updates vars with the result of set-minus(vars, {var}). | |
| Variables | operator- (Variables vars1, const Variables &vars2) |
Returns set-minus(var1, vars2). | |
| Variables | operator- (Variables vars, const Variable &var) |
Returns set-minus(vars, { var }). | |
| Variables | intersect (const Variables &vars1, const Variables &vars2) |
Returns the intersection of vars1 and vars2. | |
| 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. | |
| template<typename BasisElement> | |
| GenericPolynomialEnable< BasisElement > | pow (const GenericPolynomial< BasisElement > &p, int n) |
Returns polynomial raised to n. | |
| 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. | |
| std::string | ToLatex (const Formula &f, int precision=3) |
| Generates a LaTeX string representation of f with floating point coefficients displayed using precision. | |
| std::string | ToLatex (double val, int precision=3) |
| Generates a Latex string representation of val displayed with precision, with one exception. | |
| 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. | |
| 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. | |
| Monomial | pow (Monomial m, int p) |
| Returns m raised to p. | |
| 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. | |
| std::map< MonomialBasisElement, double > | pow (MonomialBasisElement m, int p) |
Returns m raised to p. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| Polynomial | operator- (const Polynomial &p) |
| Unary minus operation for polynomial. | |
| 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. | |
| 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. | |
| 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: | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| template<typename MatrixL, typename MatrixR> | |
| Eigen::Matrix< RationalFunction, MatrixL::RowsAtCompileTime, MatrixR::ColsAtCompileTime > | operator* (const MatrixL &lhs, const MatrixR &rhs) |
| Provides the following operations: | |
| 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. | |
| Rewriter | MakeRuleRewriter (const RewritingRule &r) |
Constructs a rewriter based on a rewriting rule r. | |
| 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. | |
| template<typename Derived> | |
| MatrixLikewise< Expression, Derived > | Substitute (const Eigen::MatrixBase< Derived > &m, const SinCosSubstitution &subs) |
| Matrix version of sin/cos substitution. | |
| 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. | |
| using GenericPolynomialEnable |
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 abs | ( | const Expression & | e | ) |
| Expression acos | ( | const Expression & | e | ) |
| Expression asin | ( | const Expression & | e | ) |
| Expression atan | ( | const Expression & | e | ) |
| Expression atan2 | ( | const Expression & | e1, |
| const Expression & | e2 ) |
|
nodiscard |
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. |
|
nodiscard |
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 ceil | ( | const Expression & | e | ) |
| 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.
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< 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.
That is, it returns true if and only if m1(i, j) is structurally equal to m2(i, j) for all i, j.
| Expression clamp | ( | const Expression & | v, |
| const Expression & | lo, | ||
| const Expression & | hi ) |
| 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.
| 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 cos | ( | const Expression & | e | ) |
| Expression cosh | ( | const Expression & | e | ) |
| 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 + ... 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.| [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 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 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 > > 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 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 > > 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 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. |
| [out] | Q | The Hessian of the quadratic expression. |
| [out] | b | linear term of the quadratic expression. |
| [out] | c | The constant term of the quadratic expression. |
|
nodiscard |
Evaluates a matrix m of symbolic polynomials using env.
| std::exception | if NaN is detected during evaluation. |
| 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.
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 > 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 > 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 exp | ( | const Expression & | e | ) |
| void ExtractAndAppendVariablesFromExpression | ( | const symbolic::Expression & | e, |
| std::vector< Variable > * | vars, | ||
| std::unordered_map< symbolic::Variable::Id, int > * | map_var_to_index ) |
Given an expression e, extracts all variables inside e, appends 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 | 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< Variable::Id, int > > ExtractVariablesFromExpression | ( | const Eigen::Ref< const VectorX< Expression > > & | expressions | ) |
Overloads ExtractVariablesFromExpression but with a vector of expressions.
| 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.
| [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 |
| Expression floor | ( | const Expression & | e | ) |
Returns a formula f, universally quantified by variables vars.
| const Expression & get_argument | ( | const Expression & | e | ) |
Returns the argument in the unary expression e.
e is a unary expression.} | 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.
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 & 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 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 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 get_constant_value | ( | const Expression & | e | ) |
Returns the constant value of the constant expression e.
e is a constant expression.} | const Expression & 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 > & 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 & get_first_argument | ( | const Expression & | e | ) |
Returns the first argument of the binary expression e.
e is a binary expression.} | const Expression & get_lhs_expression | ( | const Formula & | f | ) |
Returns the lhs-argument of a relational formula f.
f is a relational formula.} | const MatrixX< Expression > & 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 & get_rhs_expression | ( | const Formula & | f | ) |
Returns the rhs-argument of a relational formula f.
f is a relational formula.} | const Expression & get_second_argument | ( | const Expression & | e | ) |
Returns the second argument of the binary expression e.
e is a binary expression.} | const Expression & 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 & 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 > & 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 & get_uninterpreted_function_name | ( | const Expression & | e | ) |
Returns the name of an uninterpreted-function expression e.
e is an uninterpreted-function expression. | const Variable & get_variable | ( | const Expression & | e | ) |
Returns the embedded variable in the variable expression e.
e is a variable expression.} Returns the embedded variable in the variable formula f.
f is a variable formula. | Variables GetDistinctVariables | ( | const Eigen::Ref< const MatrixX< Expression > > & | v | ) |
Returns the distinct variables in the matrix of expressions.
| VectorX< Variable > 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 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.
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).expr_then and expr_else are evaluated first and then passed to the if_then_else function.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 is_abs | ( | const Expression & | e | ) |
Checks if e is an abs expression.
| bool is_abs | ( | const ExpressionCell & | c | ) |
Checks if c is an absolute-value-function expression.
| bool is_acos | ( | const Expression & | e | ) |
Checks if e is an arccosine expression.
| bool is_acos | ( | const ExpressionCell & | c | ) |
Checks if c is an arccosine expression.
| bool is_addition | ( | const Expression & | e | ) |
Checks if e is an addition expression.
| bool is_addition | ( | const ExpressionCell & | c | ) |
Checks if c is an addition expression.
| bool is_asin | ( | const Expression & | e | ) |
Checks if e is an arcsine expression.
| bool is_asin | ( | const ExpressionCell & | c | ) |
Checks if c is an arcsine expression.
| bool is_atan | ( | const Expression & | e | ) |
Checks if e is an arctangent expression.
| bool is_atan | ( | const ExpressionCell & | c | ) |
Checks if c is an arctangent expression.
| bool is_atan2 | ( | const Expression & | e | ) |
Checks if e is an arctangent2 expression.
| bool is_atan2 | ( | const ExpressionCell & | c | ) |
Checks if c is a arctangent2 expression.
| bool is_binary | ( | const ExpressionCell & | c | ) |
Checks if c is a binary expression.
| bool is_ceil | ( | const Expression & | e | ) |
Checks if e is a ceil expression.
| bool is_ceil | ( | const ExpressionCell & | c | ) |
Checks if c is a ceil expression.
| bool is_conjunction | ( | const Formula & | f | ) |
Checks if f is a conjunction (∧).
| bool is_conjunction | ( | const FormulaCell & | f | ) |
Checks if f is a conjunction (∧).
| bool is_constant | ( | const Expression & | e | ) |
Checks if e is a constant expression.
| bool is_constant | ( | const Expression & | e, |
| double | v ) |
Checks if e is a constant expression representing v.
| bool is_cos | ( | const Expression & | e | ) |
Checks if e is a cosine expression.
| bool is_cos | ( | const ExpressionCell & | c | ) |
Checks if c is a cosine expression.
| bool is_cosh | ( | const Expression & | e | ) |
Checks if e is a hyperbolic-cosine expression.
| bool is_cosh | ( | const ExpressionCell & | c | ) |
Checks if c is a hyperbolic-cosine expression.
| bool is_disjunction | ( | const Formula & | f | ) |
Checks if f is a disjunction (∨).
| bool is_disjunction | ( | const FormulaCell & | f | ) |
Checks if f is a disjunction (∨).
| bool is_division | ( | const Expression & | e | ) |
Checks if e is a division expression.
| bool is_division | ( | const ExpressionCell & | c | ) |
Checks if c is a division expression.
| bool is_equal_to | ( | const Formula & | f | ) |
Checks if f is a formula representing equality (==).
| bool is_equal_to | ( | const FormulaCell & | f | ) |
Checks if f is a formula representing equality (==).
| bool is_exp | ( | const Expression & | e | ) |
Checks if e is an exp expression.
| bool is_exp | ( | const ExpressionCell & | c | ) |
Checks if c is an exp expression.
| bool is_false | ( | const Formula & | f | ) |
Checks if f is structurally equal to False formula.
| bool is_false | ( | const FormulaCell & | f | ) |
Checks if f is structurally equal to False formula.
| bool is_floor | ( | const Expression & | e | ) |
Checks if e is a floor expression.
| bool is_floor | ( | const ExpressionCell & | c | ) |
Checks if c is a floor expression.
| bool is_forall | ( | const Formula & | f | ) |
Checks if f is a Forall formula (∀).
| bool is_forall | ( | const FormulaCell & | f | ) |
Checks if f is a Forall formula (∀).
| bool is_greater_than | ( | const Formula & | f | ) |
Checks if f is a formula representing greater-than (>).
| bool is_greater_than | ( | const FormulaCell & | f | ) |
Checks if f is a formula representing greater-than (>).
| bool is_greater_than_or_equal_to | ( | const Formula & | f | ) |
Checks if f is a formula representing greater-than-or-equal-to (>=).
| bool is_greater_than_or_equal_to | ( | const FormulaCell & | f | ) |
Checks if f is a formula representing greater-than-or-equal-to (>=).
| bool is_if_then_else | ( | const Expression & | e | ) |
Checks if e is an if-then-else expression.
| bool is_if_then_else | ( | const ExpressionCell & | c | ) |
Checks if c is an if-then-else expression.
| bool is_integer | ( | double | v | ) |
| bool is_isnan | ( | const Formula & | f | ) |
Checks if f is an isnan formula.
| bool is_isnan | ( | const FormulaCell & | f | ) |
Checks if f is an isnan formula.
| bool is_less_than | ( | const Formula & | f | ) |
Checks if f is a formula representing less-than (<).
| bool is_less_than | ( | const FormulaCell & | f | ) |
Checks if f is a formula representing less-than (<).
| bool is_less_than_or_equal_to | ( | const Formula & | f | ) |
Checks if f is a formula representing less-than-or-equal-to (<=).
| bool is_less_than_or_equal_to | ( | const FormulaCell & | f | ) |
Checks if f is a formula representing less-than-or-equal-to (<=).
| bool is_log | ( | const Expression & | e | ) |
Checks if e is a log expression.
| bool is_log | ( | const ExpressionCell & | c | ) |
Checks if c is a log expression.
| bool is_max | ( | const Expression & | e | ) |
Checks if e is a max expression.
| bool is_max | ( | const ExpressionCell & | c | ) |
Checks if c is a max expression.
| bool is_min | ( | const Expression & | e | ) |
Checks if e is a min expression.
| bool is_min | ( | const ExpressionCell & | c | ) |
Checks if c is a min expression.
| bool is_multiplication | ( | const Expression & | e | ) |
Checks if e is a multiplication expression.
| bool is_multiplication | ( | const ExpressionCell & | c | ) |
Checks if c is an multiplication expression.
| bool is_nan | ( | const Expression & | e | ) |
Checks if e is NaN.
| bool is_nary | ( | const Formula & | f | ) |
Checks if f is a n-ary formula ({∧, ∨}).
| bool is_nary | ( | const FormulaCell & | f | ) |
Checks if f is N-ary.
| bool is_neg_one | ( | const Expression & | e | ) |
Checks if e is -1.0.
| bool is_negation | ( | const Formula & | f | ) |
Checks if f is a negation (¬).
| bool is_negation | ( | const FormulaCell & | f | ) |
Checks if f is a negation (¬).
| bool is_non_negative_integer | ( | double | v | ) |
| bool is_not_equal_to | ( | const Formula & | f | ) |
Checks if f is a formula representing disequality (!=).
| bool is_not_equal_to | ( | const FormulaCell & | f | ) |
Checks if f is a formula representing disequality (!=).
| bool is_one | ( | const Expression & | e | ) |
Checks if e is 1.0.
| bool is_positive_integer | ( | double | v | ) |
| bool is_positive_semidefinite | ( | const Formula & | f | ) |
Checks if f is a positive-semidefinite formula.
| bool is_positive_semidefinite | ( | const FormulaCell & | f | ) |
Checks if f is a positive semidefinite formula.
| bool is_pow | ( | const Expression & | e | ) |
Checks if e is a power-function expression.
| bool is_pow | ( | const ExpressionCell & | c | ) |
Checks if c is a power-function expression.
| bool is_relational | ( | const Formula & | f | ) |
Checks if f is a relational formula ({==, !=, >, >=, <, <=}).
| bool is_relational | ( | const FormulaCell & | f | ) |
Checks if f is a relational formula ({==, !=, >, >=, <, <=}).
| bool is_sin | ( | const Expression & | e | ) |
Checks if e is a sine expression.
| bool is_sin | ( | const ExpressionCell & | c | ) |
Checks if c is a sine expression.
| bool is_sinh | ( | const Expression & | e | ) |
Checks if e is a hyperbolic-sine expression.
| bool is_sinh | ( | const ExpressionCell & | c | ) |
Checks if c is a hyperbolic-sine expression.
| bool is_sqrt | ( | const Expression & | e | ) |
Checks if e is a square-root expression.
| bool is_sqrt | ( | const ExpressionCell & | c | ) |
Checks if c is a square-root expression.
| bool is_tan | ( | const Expression & | e | ) |
Checks if e is a tangent expression.
| bool is_tan | ( | const ExpressionCell & | c | ) |
Checks if c is a tangent expression.
| bool is_tanh | ( | const Expression & | e | ) |
Checks if e is a hyperbolic-tangent expression.
| bool is_tanh | ( | const ExpressionCell & | c | ) |
Checks if c is a hyperbolic-tangent expression.
| bool is_true | ( | const Formula & | f | ) |
Checks if f is structurally equal to True formula.
| bool is_true | ( | const FormulaCell & | f | ) |
Checks if f is structurally equal to True formula.
| bool is_two | ( | const Expression & | e | ) |
Checks if e is 2.0.
| bool is_unary | ( | const ExpressionCell & | c | ) |
Checks if c is a unary expression.
| bool is_uninterpreted_function | ( | const Expression & | e | ) |
Checks if e is an uninterpreted-function expression.
| bool is_uninterpreted_function | ( | const ExpressionCell & | c | ) |
Checks if c is an uninterpreted-function expression.
| bool is_variable | ( | const Expression & | e | ) |
Checks if e is a variable expression.
| bool is_variable | ( | const ExpressionCell & | c | ) |
Checks if c is a variable expression.
| bool is_variable | ( | const Formula & | f | ) |
Checks if f is a variable formula.
| bool is_variable | ( | const FormulaCell & | f | ) |
Checks if f is a variable formula.
| bool is_zero | ( | const Expression & | e | ) |
Checks if e is 0.0.
| bool IsAffine | ( | const Eigen::Ref< const MatrixX< Expression > > & | m | ) |
Checks if every element in m is affine.
| bool IsAffine | ( | const Eigen::Ref< const MatrixX< Expression > > & | m, |
| const Variables & | vars ) |
Checks if every element in m is affine in vars.
| Formula 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 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 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:
| 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.
J(i,j) contains ∂f(i)/∂vars(j).
vars is non-empty}. | 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.
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}.
|
nodiscard |
Computes the Jacobian matrix J of the vector function f with respect to vars.
J(i,j) contains ∂f(i)/∂vars(j).
| Expression 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.| Eigen::Matrix< Variable, rows, cols > 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). |
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 > 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). |
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 > 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). |
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 > 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). |
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 > 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. |
| 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.
| 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 MakeRuleRewriter | ( | const RewritingRule & | r | ) |
Constructs a rewriter based on a rewriting rule r.
| Eigen::Matrix< Variable, rows, 1 > 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 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 > 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). |
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 > 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 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 > 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). |
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 > 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. |
| VectorX< Variable > 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. |
| Expression max | ( | const Expression & | e1, |
| const Expression & | e2 ) |
| Expression min | ( | const Expression & | e1, |
| const Expression & | e2 ) |
|
nodiscard |
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. |
| 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.
| n | number of variables. |
| degree | maximum total degree of monomials to compute. |
vars is a non-empty set. n. 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.
|
constexpr |
| 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.
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::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 (!=).
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 > 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< 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.
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.
| Formula 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 > > 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).
| GenericPolynomialEnable< BasisElement > operator* | ( | const BasisElement & | m, |
| double | c ) |
| GenericPolynomialEnable< BasisElement > operator* | ( | const BasisElement & | m, |
| GenericPolynomial< BasisElement > | p ) |
| std::map< ChebyshevBasisElement, double > 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)
| auto operator* | ( | const Eigen::Transform< double, Dim, LhsMode, LhsOptions > & | t1, |
| const Eigen::Transform< Expression, Dim, RhsMode, RhsOptions > & | t2 ) |
Transform<Expression> * Transform<double> => Transform<Expression>
| auto operator* | ( | const Eigen::Transform< Expression, Dim, LhsMode, LhsOptions > & | t1, |
| const Eigen::Transform< double, Dim, RhsMode, RhsOptions > & | t2 ) |
Transform<double> * Transform<Expression> => Transform<Expression>
|
nodiscard |
| 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:
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 > > 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 > > 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 > > 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 > > 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 > > 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 > > 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 > > operator* | ( | const MatrixL & | lhs, |
| const MatrixR & | rhs ) |
Provides the following matrix operations:
Provides the following operations:
| Eigen::Matrix< Polynomial, MatrixL::RowsAtCompileTime, MatrixR::ColsAtCompileTime > operator* | ( | const MatrixL & | lhs, |
| const MatrixR & | rhs ) |
Provides the following matrix operations:
| Eigen::Matrix< RationalFunction, MatrixL::RowsAtCompileTime, MatrixR::ColsAtCompileTime > operator* | ( | const MatrixL & | lhs, |
| const MatrixR & | rhs ) |
Provides the following operations:
where RF is a shorthand for RationalFunction.
Provides the following operations:
|
nodiscard |
|
nodiscard |
| RationalFunction operator* | ( | const Monomial & | m, |
| RationalFunction | f ) |
| std::map< MonomialBasisElement, double > operator* | ( | const MonomialBasisElement & | m1, |
| const MonomialBasisElement & | m2 ) |
Returns a multiplication of two monomials, m1 and m2.
|
nodiscard |
| RationalFunction operator* | ( | const Polynomial & | p, |
| RationalFunction | f ) |
| GenericPolynomialEnable< BasisElement > operator* | ( | const Variable & | v, |
| GenericPolynomial< BasisElement > | p ) |
|
nodiscard |
| GenericPolynomialEnable< BasisElement > operator* | ( | double | c, |
| const BasisElement & | m ) |
|
nodiscard |
| GenericPolynomialEnable< BasisElement > operator* | ( | double | c, |
| GenericPolynomial< BasisElement > | p ) |
|
nodiscard |
| RationalFunction operator* | ( | double | c, |
| RationalFunction | f ) |
| Expression operator* | ( | Expression | lhs, |
| const Expression & | rhs ) |
| GenericPolynomialEnable< BasisElement > operator* | ( | GenericPolynomial< BasisElement > | p, |
| const BasisElement & | m ) |
| GenericPolynomialEnable< BasisElement > operator* | ( | GenericPolynomial< BasisElement > | p, |
| const Variable & | v ) |
| GenericPolynomialEnable< BasisElement > operator* | ( | GenericPolynomial< BasisElement > | p, |
| double | c ) |
| GenericPolynomialEnable< BasisElement > operator* | ( | GenericPolynomial< BasisElement > | p1, |
| const GenericPolynomial< BasisElement > & | p2 ) |
Returns a multiplication of two monomials, m1 and m2.
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| RationalFunction operator* | ( | RationalFunction | f, |
| const Monomial & | m ) |
| RationalFunction operator* | ( | RationalFunction | f, |
| const Polynomial & | p ) |
| RationalFunction operator* | ( | RationalFunction | f, |
| double | c ) |
| RationalFunction operator* | ( | RationalFunction | f1, |
| const RationalFunction & | f2 ) |
| Expression & operator*= | ( | Expression & | lhs, |
| const Expression & | rhs ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | const BasisElement & | m, |
| double | c ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | const BasisElement & | m, |
| GenericPolynomial< BasisElement > | p ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | const BasisElement & | m1, |
| const BasisElement & | m2 ) |
| Expression operator+ | ( | const Expression & | e | ) |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| RationalFunction operator+ | ( | const Monomial & | m, |
| RationalFunction | f ) |
|
nodiscard |
|
nodiscard |
| RationalFunction operator+ | ( | const Polynomial & | p, |
| RationalFunction | f ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | const Variable & | v, |
| GenericPolynomial< BasisElement > | p ) |
|
nodiscard |
| Expression operator+ | ( | const Variable & | var | ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | double | c, |
| const BasisElement & | m ) |
|
nodiscard |
| GenericPolynomialEnable< BasisElement > operator+ | ( | double | c, |
| GenericPolynomial< BasisElement > | p ) |
|
nodiscard |
| RationalFunction operator+ | ( | double | c, |
| RationalFunction | f ) |
| Expression operator+ | ( | Expression | lhs, |
| const Expression & | rhs ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | GenericPolynomial< BasisElement > | p, |
| const BasisElement & | m ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | GenericPolynomial< BasisElement > | p, |
| const Variable & | v ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | GenericPolynomial< BasisElement > | p, |
| double | c ) |
| GenericPolynomialEnable< BasisElement > operator+ | ( | GenericPolynomial< BasisElement > | p1, |
| const GenericPolynomial< BasisElement > & | p2 ) |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| RationalFunction operator+ | ( | RationalFunction | f, |
| const Monomial & | m ) |
| RationalFunction operator+ | ( | RationalFunction | f, |
| const Polynomial & | p ) |
| RationalFunction operator+ | ( | RationalFunction | f, |
| double | c ) |
| RationalFunction operator+ | ( | RationalFunction | f1, |
| const RationalFunction & | f2 ) |
Returns set-union of var1 and var2.
| Expression & operator+= | ( | Expression & | lhs, |
| const Expression & | rhs ) |
Updates vars with the result of set-union(vars, { var }).
Updates var1 with the result of set-union(var1, var2).
| GenericPolynomialEnable< BasisElement > operator- | ( | const BasisElement & | m, |
| double | c ) |
| GenericPolynomialEnable< BasisElement > operator- | ( | const BasisElement & | m, |
| GenericPolynomial< BasisElement > | p ) |
| GenericPolynomialEnable< BasisElement > operator- | ( | const BasisElement & | m1, |
| const BasisElement & | m2 ) |
| Expression operator- | ( | const Expression & | e | ) |
|
nodiscard |
| GenericPolynomialEnable< BasisElement > operator- | ( | const GenericPolynomial< BasisElement > & | p | ) |
|
nodiscard |
|
nodiscard |
| RationalFunction operator- | ( | const Monomial & | m, |
| RationalFunction | f ) |
|
nodiscard |
|
nodiscard |
Unary minus operation for polynomial.
|
nodiscard |
| RationalFunction operator- | ( | const Polynomial & | p, |
| const RationalFunction & | f ) |
|
nodiscard |
| GenericPolynomialEnable< BasisElement > operator- | ( | const Variable & | v, |
| GenericPolynomial< BasisElement > | p ) |
| Expression operator- | ( | const Variable & | var | ) |
| GenericPolynomialEnable< BasisElement > operator- | ( | double | c, |
| const BasisElement & | m ) |
|
nodiscard |
| GenericPolynomialEnable< BasisElement > operator- | ( | double | c, |
| GenericPolynomial< BasisElement > | p ) |
|
nodiscard |
| RationalFunction operator- | ( | double | c, |
| RationalFunction | f ) |
| Expression operator- | ( | Expression | lhs, |
| const Expression & | rhs ) |
| GenericPolynomialEnable< BasisElement > operator- | ( | GenericPolynomial< BasisElement > | p, |
| const BasisElement & | m ) |
| GenericPolynomialEnable< BasisElement > operator- | ( | GenericPolynomial< BasisElement > | p, |
| const Variable & | v ) |
| GenericPolynomialEnable< BasisElement > operator- | ( | GenericPolynomial< BasisElement > | p, |
| double | c ) |
| GenericPolynomialEnable< BasisElement > operator- | ( | GenericPolynomial< BasisElement > | p1, |
| const GenericPolynomial< BasisElement > & | p2 ) |
|
nodiscard |
|
nodiscard |
|
nodiscard |
|
nodiscard |
| RationalFunction operator- | ( | RationalFunction | f, |
| const Monomial & | m ) |
| RationalFunction operator- | ( | RationalFunction | f, |
| const Polynomial & | p ) |
| RationalFunction operator- | ( | RationalFunction | f, |
| double | c ) |
| RationalFunction operator- | ( | RationalFunction | f1, |
| const RationalFunction & | f2 ) |
| Expression & operator-= | ( | Expression & | lhs, |
| const Expression & | rhs ) |
Updates vars with the result of set-minus(vars, {var}).
Updates var1 with the result of set-minus(var1, var2).
|
nodiscard |
| RationalFunction operator/ | ( | const Monomial & | m, |
| RationalFunction | f ) |
|
nodiscard |
| RationalFunction 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 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. |
|
nodiscard |
| Expression operator/ | ( | Expression | lhs, |
| const Expression & | rhs ) |
| GenericPolynomialEnable< BasisElement > operator/ | ( | GenericPolynomial< BasisElement > | p, |
| double | v ) |
Returns p / v.
|
nodiscard |
Returns p / v.
| RationalFunction operator/ | ( | RationalFunction | f, |
| const Monomial & | m ) |
| RationalFunction 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 operator/ | ( | RationalFunction | f, |
| double | c ) |
| std::exception | if c is 0 |
| RationalFunction 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. |
| Expression & operator/= | ( | Expression & | lhs, |
| const Expression & | rhs ) |
| 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 (<).
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 > 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 > 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.
| Formula 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 > > 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).
| bool operator< | ( | ExpressionKind | k1, |
| ExpressionKind | k2 ) |
Total ordering between ExpressionKinds.
| bool operator< | ( | FormulaKind | k1, |
| FormulaKind | k2 ) |
| std::ostream & operator<< | ( | std::ostream & | os, |
| const Expression & | e ) |
| std::ostream & operator<< | ( | std::ostream & | os, |
| const Formula & | f ) |
| std::ostream & operator<< | ( | std::ostream & | os, |
| const GenericPolynomial< BasisElement > & | p ) |
| std::ostream & operator<< | ( | std::ostream & | os, |
| const Polynomial & | p ) |
| std::ostream & operator<< | ( | std::ostream & | os, |
| Variable::Type | type ) |
| std::ostream & operator<< | ( | std::ostream & | out, |
| const ChebyshevBasisElement & | m ) |
| std::ostream & operator<< | ( | std::ostream & | out, |
| const ChebyshevPolynomial & | p ) |
| std::ostream & operator<< | ( | std::ostream & | out, |
| const Monomial & | m ) |
| std::ostream & operator<< | ( | std::ostream & | out, |
| const MonomialBasisElement & | m ) |
| 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 (<=).
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 > 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< 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 (<=).
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 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 > > 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< 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 (==).
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.
@code
Eigen::Array<Variable, 2, 2> a;
a << Variable{"x"}, Variable{"y"},
Variable{"z"}, Variable{"w"};
Eigen::Array<Formula, 2, 2> f = (a == 3.5);
// Here f = |(x == 3.5) (y == 3.5)|
// |(z == 3.5) (w == 3.5)|.
@endcode
| 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.
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< 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.
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 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 > > 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< 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 (>).
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 > 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< 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 (>).
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 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 > > 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< 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 (>=).
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 > 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< 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 (>=).
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 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 > > 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.
| 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.
| Formula 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). | 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.
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 > 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.
| Formula 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.
| Expression pow | ( | const Expression & | e1, |
| const Expression & | e2 ) |
| GenericPolynomialEnable< BasisElement > pow | ( | const GenericPolynomial< BasisElement > & | p, |
| int | n ) |
Returns polynomial raised to n.
| p | The base polynomial. |
| n | The exponent of the power. |
|
nodiscard |
Returns polynomial p raised to n.
| RationalFunction 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.
Returns m raised to p.
| std::exception | if p is negative. |
| std::map< MonomialBasisElement, double > pow | ( | MonomialBasisElement | m, |
| int | p ) |
Returns m raised to p.
| std::exception | if p is negative. |
| 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.
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. |
| 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 sin | ( | const Expression & | e | ) |
| Expression sinh | ( | const Expression & | e | ) |
| Expression sqrt | ( | const Expression & | e | ) |
| MatrixLikewise< Expression, Derived > Substitute | ( | const Eigen::MatrixBase< Derived > & | m, |
| const SinCosSubstitution & | subs ) |
Matrix version of sin/cos substitution.
| MatrixLikewise< Expression, Derived > 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 > 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. |
| 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.
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).
| subs | When set to one of the half_angle options, 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. |
|
nodiscard |
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). |
* 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 swap | ( | Expression & | a, |
| Expression & | b ) |
| Expression tan | ( | const Expression & | e | ) |
| Expression tanh | ( | const Expression & | e | ) |
| Expression 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 > 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 ToLatex | ( | const Eigen::PlainObjectBase< Derived > & | M, |
| int | precision = 3 ) |
Generates a LaTeX string representation of M with floating point coefficients displayed using precision.
| std::string ToLatex | ( | const Expression & | e, |
| int | precision = 3 ) |
Generates a LaTeX string representation of e with floating point coefficients displayed using precision.
| std::string ToLatex | ( | const Formula & | f, |
| int | precision = 3 ) |
Generates a LaTeX string representation of f with floating point coefficients displayed using precision.
| std::string ToLatex | ( | double | val, |
| int | precision = 3 ) |
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).
| Expression 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 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 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 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.