forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogram_attribute.h
53 lines (38 loc) · 1.86 KB
/
program_attribute.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <ostream>
#include <string>
#include <unordered_set>
#include "drake/common/hash.h"
namespace drake {
namespace solvers {
enum class ProgramAttribute {
kGenericCost, ///< A generic cost, doesn't belong to any specific cost type
/// below.
kGenericConstraint, ///< A generic constraint, doesn't belong to any specific
/// constraint type below.
kQuadraticCost, ///< A quadratic function as the cost.
kQuadraticConstraint, ///< A constraint on a quadratic function.
kLinearCost, ///< A linear function as the cost.
kLinearConstraint, ///< A constraint on a linear function.
kLinearEqualityConstraint, ///< An equality constraint on a linear function.
kLinearComplementarityConstraint, ///< A linear complementarity constraint in
/// the form 0 ≤ z ⊥ Mz+q ≥ 0.
kLorentzConeConstraint, ///< A Lorentz cone constraint.
kRotatedLorentzConeConstraint, ///< A rotated Lorentz cone constraint.
kPositiveSemidefiniteConstraint, /// A positive semidefinite constraint.
kExponentialConeConstraint, /// An exponential cone constraint.
kBinaryVariable, /// variable taking binary value {0, 1}.
kCallback, /// support callback during solving the problem.
};
using ProgramAttributes = std::unordered_set<ProgramAttribute, DefaultHash>;
/**
* Returns true if @p required is a subset of @p supported.
*/
bool AreRequiredAttributesSupported(const ProgramAttributes& required,
const ProgramAttributes& supported);
std::string to_string(const ProgramAttribute&);
std::ostream& operator<<(std::ostream&, const ProgramAttribute&);
std::string to_string(const ProgramAttributes&);
std::ostream& operator<<(std::ostream&, const ProgramAttributes&);
} // namespace solvers
} // namespace drake