forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclp_solver.h
53 lines (43 loc) · 1.33 KB
/
clp_solver.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 <Eigen/Core>
#include "drake/common/drake_copyable.h"
#include "drake/solvers/solver_base.h"
namespace drake {
namespace solvers {
/**
* The CLP solver details after calling Solve() function. The user can call
* MathematicalProgramResult::get_solver_details<ClpSolver>() to obtain the
* details.
*/
struct ClpSolverDetails {
// Refer to ClpModel::status() function for the meaning of the status code.
// -1: unknown error.
// 0: optimal.
// 1: primal infeasible
// 2: dual infeasible
// 3: stopped on iterations or time.
// 4: stopped due to errors
// 5: stopped by event handler
int status;
};
class ClpSolver final : public SolverBase {
public:
DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(ClpSolver)
using Details = ClpSolverDetails;
ClpSolver();
~ClpSolver() final;
/// @name Static versions of the instance methods with similar names.
//@{
static SolverId id();
static bool is_available();
static bool is_enabled();
static bool ProgramAttributesSatisfied(const MathematicalProgram&);
//@}
// A using-declaration adds these methods into our class's Doxygen.
using SolverBase::Solve;
private:
void DoSolve(const MathematicalProgram&, const Eigen::VectorXd&,
const SolverOptions&, MathematicalProgramResult*) const final;
};
} // namespace solvers
} // namespace drake