-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
exponential_cone_program_examples.h
47 lines (41 loc) · 1.54 KB
/
exponential_cone_program_examples.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
#pragma once
#include "drake/solvers/mathematical_program.h"
#include "drake/solvers/solver_interface.h"
namespace drake {
namespace solvers {
namespace test {
/**
* Solves a trivial problem with exponential cone constraint
* min y*exp(z/y)
* s.t y + z = 1
* y > 0
* @param check_dual If set to true, we will also check the dual solution.
*/
void ExponentialConeTrivialExample(const SolverInterface& solver, double tol,
bool check_dual);
/**
* For a random variable x (assuming that the sample space of x is {0, 1, 2,
* 3}), with a given probability p(x), find the other probability q(x), such
* that the KL divergence KL(p(x) | q(x)) is minimized. The optimal probability
* is q(x) = p(x).
*/
void MinimizeKLDivergence(const SolverInterface& solver, double tol);
/**
* Given several points, find the smallest ellipsoid that covers these points.
* Mathematically, this problem can be formulated as
* max log(det(S))
* s.t. ⌈S b/2⌉ is positive semidifinite.
* ⌊bᵀ/2 c ⌋
* pᵀ * S * p + bᵀ * p + c <= 1 for all p.
* where the ellipsoid is described as {x | xᵀ*S*x + bᵀ*x + c <= 1}, and p is
* a point to be covered.
*/
void MinimalEllipsoidCoveringPoints(const SolverInterface& solver, double tol);
/* Impose the constraint log(det(X)) >= 1
* Note that this requires both exponential cone and positive semidefinite
* constraint.
*/
void MatrixLogDeterminantLower(const SolverInterface& solver, double tol);
} // namespace test
} // namespace solvers
} // namespace drake