Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
monomial_util.h File Reference
#include <cstddef>
#include <functional>
#include <map>
#include <set>
#include <unordered_map>
#include <Eigen/Core>
#include "drake/common/drake_assert.h"
#include "drake/common/hash.h"
#include "drake/common/symbolic/polynomial.h"
Include dependency graph for monomial_util.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  GradedReverseLexOrder< VariableOrder >
 Implements Graded reverse lexicographic order. More...

Namespaces

namespace  drake
namespace  drake::symbolic

Functions

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< MonomialMonomialBasis (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< MonomialCalcMonomialBasisOrderUpToOne (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.