blob: ef574fe8e887e360bd59fe544555910dd32d3f9e [file] [log] [blame]
Austin Schuh9049e202022-02-20 17:34:16 -08001.. _c_interface:
2
3C
4=====
5
6
7
8
9.. _C_main_API:
10
11Main solver API
12---------------
13
14The main C API is imported from the header :code:`osqp.h` and provides the following functions
15
16
17.. doxygenfunction:: osqp_setup
18
19.. doxygenfunction:: osqp_solve
20
21.. doxygenfunction:: osqp_cleanup
22
23
24.. _C_sublevel_API:
25
26Sublevel API
27------------
28Sublevel C API is also imported from the header :code:`osqp.h` and provides the following functions
29
30Warm start
31^^^^^^^^^^
32OSQP automatically warm starts primal and dual variables from the previous QP solution. If you would like to warm start their values manually, you can use
33
34.. doxygenfunction:: osqp_warm_start
35
36.. doxygenfunction:: osqp_warm_start_x
37
38.. doxygenfunction:: osqp_warm_start_y
39
40
41.. _c_cpp_update_data :
42
43Update problem data
44^^^^^^^^^^^^^^^^^^^
45Problem data can be updated without executing the setup again using the following functions.
46
47.. doxygenfunction:: osqp_update_lin_cost
48
49.. doxygenfunction:: osqp_update_lower_bound
50
51.. doxygenfunction:: osqp_update_upper_bound
52
53.. doxygenfunction:: osqp_update_bounds
54
55.. doxygenfunction:: osqp_update_P
56
57.. doxygenfunction:: osqp_update_A
58
59.. doxygenfunction:: osqp_update_P_A
60
61
62
63.. _c_cpp_data_types :
64
65Data types
66----------
67
68The most basic used datatypes are
69
70* :code:`c_int`: can be :code:`long` or :code:`int` if the compiler flag :code:`DLONG` is set or not
71* :code:`c_float`: can be a :code:`float` or a :code:`double` if the compiler flag :code:`DFLOAT` is set or not.
72
73
74
75The relevant structures used in the API are
76
77Data
78^^^^
79
80.. doxygenstruct:: OSQPData
81 :members:
82
83The matrices are defined in `Compressed Sparse Column (CSC) format <https://people.sc.fsu.edu/~jburkardt/data/cc/cc.html>`_ using zero-based indexing.
84
85.. doxygenstruct:: csc
86 :members:
87
88Settings
89^^^^^^^^
90
91.. doxygenstruct:: OSQPSettings
92 :members:
93
94Solution
95^^^^^^^^
96
97.. doxygenstruct:: OSQPSolution
98 :members:
99
100Info
101^^^^^
102
103.. doxygenstruct:: OSQPInfo
104 :members:
105
106Workspace
107^^^^^^^^^
108
109.. doxygenstruct:: OSQPWorkspace
110 :members:
111
112
113Scaling
114^^^^^^^
115
116.. doxygenstruct:: OSQPScaling
117 :members:
118
119Polish
120^^^^^^
121.. doxygenstruct:: OSQPPolish
122 :members:
123
124
125
126.. TODO: Add sublevel API
127.. TODO: Add using your own linear system solver