forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecision_variable.h
31 lines (23 loc) · 911 Bytes
/
decision_variable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <list>
#include <Eigen/Core>
#include "drake/common/symbolic/expression.h"
namespace drake {
namespace solvers {
using DecisionVariable = symbolic::Variable;
template <int rows, int cols>
using MatrixDecisionVariable = Eigen::Matrix<symbolic::Variable, rows, cols>;
template <int rows>
using VectorDecisionVariable = MatrixDecisionVariable<rows, 1>;
using MatrixXDecisionVariable =
MatrixDecisionVariable<Eigen::Dynamic, Eigen::Dynamic>;
using VectorXDecisionVariable = VectorDecisionVariable<Eigen::Dynamic>;
using VariableRefList = std::list<Eigen::Ref<const VectorXDecisionVariable>>;
/**
* Concatenates each element in \p var_list into a single Eigen vector of
* decision variables, returns this concatenated vector.
*/
[[nodiscard]] VectorXDecisionVariable ConcatenateVariableRefList(
const VariableRefList& var_list);
} // namespace solvers
} // namespace drake