forked from sammy-tri/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
csdp_cpp_wrapper.h
32 lines (28 loc) · 1.14 KB
/
csdp_cpp_wrapper.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
#pragma once
namespace drake {
namespace solvers {
namespace internal {
namespace csdp {
// Add CDSP's types into this namespace.
extern "C" {
#include <csdp/blockmat.h>
#include <csdp/index.h>
#include <csdp/parameters.h>
} // extern C
// Wrap CSDP's C functions with our own C++ functions, for error handling.
int cpp_easy_sdp(const char* params_pathname, int n, int k,
struct blockmatrix C, double* a,
struct constraintmatrix* constraints, double constant_offset,
struct blockmatrix* pX, double** py, struct blockmatrix* pZ,
double* ppobj, double* pdobj);
void cpp_free_mat(struct blockmatrix A);
void cpp_free_prob(int n, int k, struct blockmatrix C, double* a,
struct constraintmatrix* constraints, struct blockmatrix X,
double* y, struct blockmatrix Z);
void cpp_initsoln(int n, int k, struct blockmatrix C, double* a,
struct constraintmatrix* constraints, struct blockmatrix* pX0,
double** py0, struct blockmatrix* pZ0);
} // namespace csdp
} // namespace internal
} // namespace solvers
} // namespace drake