-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdocstrings.hpp
More file actions
3144 lines (2032 loc) · 73.6 KB
/
Copy pathdocstrings.hpp
File metadata and controls
3144 lines (2032 loc) · 73.6 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
This file contains docstrings for use in the Python bindings.
Do not edit! They were automatically extracted by pybind11_mkdoc.
*/
#define MKD_EXPAND(x) x
#define MKD_COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT
#define MKD_VA_SIZE(...) MKD_EXPAND(MKD_COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0))
#define MKD_CAT1(a, b) a ## b
#define MKD_CAT2(a, b) MKD_CAT1(a, b)
#define MKD_DOC1(n1) mkd_doc_##n1
#define MKD_DOC2(n1, n2) mkd_doc_##n1##_##n2
#define MKD_DOC3(n1, n2, n3) mkd_doc_##n1##_##n2##_##n3
#define MKD_DOC4(n1, n2, n3, n4) mkd_doc_##n1##_##n2##_##n3##_##n4
#define MKD_DOC5(n1, n2, n3, n4, n5) mkd_doc_##n1##_##n2##_##n3##_##n4##_##n5
#define MKD_DOC6(n1, n2, n3, n4, n5, n6) mkd_doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6
#define MKD_DOC7(n1, n2, n3, n4, n5, n6, n7) mkd_doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7
#define DOC(...) MKD_EXPAND(MKD_EXPAND(MKD_CAT2(MKD_DOC, MKD_VA_SIZE(__VA_ARGS__)))(__VA_ARGS__))
#if defined(__GNUG__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
static const char *mkd_doc_formatter = R"doc(Formatter for ExpressionType.)doc";
static const char *mkd_doc_formatter_2 = R"doc(Formatter for ExitStatus.)doc";
static const char *mkd_doc_formatter_format =
R"doc(Formats ExpressionType.
Args:
type: Expression type.
ctx: Format context.
Template Args:
FmtContext: Format context type.
Returns:
Format context iterator.
)doc";
static const char *mkd_doc_formatter_format_2 =
R"doc(Formats ExitStatus.
Args:
exit_status: Exit status.
ctx: Format context.
Template Args:
FmtContext: Format context type.
Returns:
Format context iterator.
)doc";
static const char *mkd_doc_formatter_m_underlying = R"doc()doc";
static const char *mkd_doc_formatter_m_underlying_2 = R"doc()doc";
static const char *mkd_doc_formatter_parse =
R"doc(Parse format string.
Args:
ctx: Format parse context.
Returns:
Format parse context iterator.
)doc";
static const char *mkd_doc_formatter_parse_2 =
R"doc(Parses format string.
Args:
ctx: Format parse context.
Returns:
Format parse context iterator.
)doc";
static const char *mkd_doc_slp = R"doc()doc";
static const char *mkd_doc_slp_2 = R"doc()doc";
static const char *mkd_doc_slp_3 = R"doc()doc";
static const char *mkd_doc_slp_4 = R"doc()doc";
static const char *mkd_doc_slp_5 = R"doc()doc";
static const char *mkd_doc_slp_DynamicsType = R"doc(Enum describing a type of system dynamics constraints.)doc";
static const char *mkd_doc_slp_DynamicsType_DISCRETE = R"doc(The dynamics are a function in the form xₖ₊₁ = f(t, xₖ, uₖ).)doc";
static const char *mkd_doc_slp_DynamicsType_EXPLICIT_ODE = R"doc(The dynamics are a function in the form dx/dt = f(t, x, u).)doc";
static const char *mkd_doc_slp_EqualityConstraints =
R"doc(A vector of equality constraints of the form cₑ(x) = 0.
Template Args:
Scalar: Scalar type.)doc";
static const char *mkd_doc_slp_EqualityConstraints_EqualityConstraints =
R"doc(Concatenates multiple equality constraints.
Args:
equality_constraints: The list of EqualityConstraints to
concatenate.
)doc";
static const char *mkd_doc_slp_EqualityConstraints_EqualityConstraints_2 =
R"doc(Concatenates multiple equality constraints.
This overload is for Python bindings only.
Args:
equality_constraints: The list of EqualityConstraints to
concatenate.
)doc";
static const char *mkd_doc_slp_EqualityConstraints_EqualityConstraints_3 =
R"doc(Constructs an equality constraint from a left and right side.
The standard form for equality constraints is c(x) = 0. This function
takes a constraint of the form lhs = rhs and converts it to lhs - rhs
= 0.
Args:
lhs: Left-hand side.
rhs: Right-hand side.
)doc";
static const char *mkd_doc_slp_EqualityConstraints_constraints = R"doc(A vector of scalar equality constraints.)doc";
static const char *mkd_doc_slp_EqualityConstraints_operator_bool = R"doc(Implicit conversion operator to bool.)doc";
static const char *mkd_doc_slp_ExitStatus = R"doc(Solver exit status. Negative values indicate failure.)doc";
static const char *mkd_doc_slp_ExitStatus_CALLBACK_REQUESTED_STOP =
R"doc(The solver returned its solution so far after the user requested a
stop.)doc";
static const char *mkd_doc_slp_ExitStatus_DIVERGING_ITERATES =
R"doc(The solver encountered diverging primal iterates xₖ and/or sₖ and gave
up.)doc";
static const char *mkd_doc_slp_ExitStatus_FACTORIZATION_FAILED = R"doc(The linear system factorization failed.)doc";
static const char *mkd_doc_slp_ExitStatus_FEASIBILITY_RESTORATION_FAILED =
R"doc(The solver failed to reach the desired tolerance, and feasibility
restoration failed to converge.)doc";
static const char *mkd_doc_slp_ExitStatus_GLOBALLY_INFEASIBLE =
R"doc(The problem setup frontend determined the problem to have an empty
feasible region.)doc";
static const char *mkd_doc_slp_ExitStatus_LINE_SEARCH_FAILED =
R"doc(The backtracking line search failed, and the problem isn't locally
infeasible.)doc";
static const char *mkd_doc_slp_ExitStatus_LOCALLY_INFEASIBLE =
R"doc(The solver determined the problem to be locally infeasible and gave
up.)doc";
static const char *mkd_doc_slp_ExitStatus_MAX_ITERATIONS_EXCEEDED =
R"doc(The solver returned its solution so far after exceeding the maximum
number of iterations.)doc";
static const char *mkd_doc_slp_ExitStatus_NONFINITE_INITIAL_GUESS =
R"doc(The solver encountered nonfinite initial cost, constraints, or
derivatives and gave up.)doc";
static const char *mkd_doc_slp_ExitStatus_SUCCESS = R"doc(Solved the problem to the desired tolerance.)doc";
static const char *mkd_doc_slp_ExitStatus_TIMEOUT =
R"doc(The solver returned its solution so far after exceeding the maximum
elapsed wall clock time.)doc";
static const char *mkd_doc_slp_ExitStatus_TOO_FEW_DOFS = R"doc(The solver determined the problem to be overconstrained and gave up.)doc";
static const char *mkd_doc_slp_ExpressionType =
R"doc(Expression type.
Used for autodiff caching.)doc";
static const char *mkd_doc_slp_ExpressionType_CONSTANT = R"doc(The expression is a constant.)doc";
static const char *mkd_doc_slp_ExpressionType_LINEAR = R"doc(The expression is composed of linear and lower-order operators.)doc";
static const char *mkd_doc_slp_ExpressionType_NONE = R"doc(There is no expression.)doc";
static const char *mkd_doc_slp_ExpressionType_NONLINEAR = R"doc(The expression is composed of nonlinear and lower-order operators.)doc";
static const char *mkd_doc_slp_ExpressionType_QUADRATIC = R"doc(The expression is composed of quadratic and lower-order operators.)doc";
static const char *mkd_doc_slp_Gradient =
R"doc(This class calculates the gradient of a variable with respect to a
vector of variables.
The gradient is only recomputed if the variable expression is
quadratic or higher order.
Template Args:
Scalar: Scalar type.)doc";
static const char *mkd_doc_slp_Gradient_2 = R"doc()doc";
static const char *mkd_doc_slp_Gradient_Gradient =
R"doc(Constructs a Gradient object.
Args:
variable: Variable of which to compute the gradient.
wrt: Variable with respect to which to compute the gradient.
)doc";
static const char *mkd_doc_slp_Gradient_Gradient_2 =
R"doc(Constructs a Gradient object.
Args:
variable: Variable of which to compute the gradient.
wrt: Vector of variables with respect to which to compute the
gradient.
)doc";
static const char *mkd_doc_slp_Gradient_get =
R"doc(Returns the gradient as a VariableMatrix.
This is useful when constructing optimization problems with
derivatives in them.
Returns:
The gradient as a VariableMatrix.
)doc";
static const char *mkd_doc_slp_Gradient_m_g = R"doc()doc";
static const char *mkd_doc_slp_Gradient_m_jacobian = R"doc()doc";
static const char *mkd_doc_slp_Gradient_value =
R"doc(Evaluates the gradient at wrt's value.
Returns:
The gradient at wrt's value.
)doc";
static const char *mkd_doc_slp_Hessian =
R"doc(This class calculates the Hessian of a variable with respect to a
vector of variables.
The gradient tree is cached so subsequent Hessian calculations are
faster, and the Hessian is only recomputed if the variable expression
is nonlinear.
Template Args:
Scalar: Scalar type.
UpLo: Which part of the Hessian to compute (Lower or Lower |
Upper). Default is Lower | Upper.)doc";
static const char *mkd_doc_slp_Hessian_2 = R"doc()doc";
static const char *mkd_doc_slp_Hessian_3 = R"doc()doc";
static const char *mkd_doc_slp_Hessian_Hessian =
R"doc(Constructs a Hessian object.
Args:
variable: Variable of which to compute the Hessian.
wrt: Variable with respect to which to compute the Hessian.
)doc";
static const char *mkd_doc_slp_Hessian_Hessian_2 =
R"doc(Constructs a Hessian object.
Args:
variable: Variable of which to compute the Hessian.
wrt: Vector of variables with respect to which to compute the
Hessian.
)doc";
static const char *mkd_doc_slp_Hessian_get =
R"doc(Returns the Hessian as a VariableMatrix.
This is useful when constructing optimization problems with
derivatives in them.
Returns:
The Hessian as a VariableMatrix.
)doc";
static const char *mkd_doc_slp_Hessian_m_H = R"doc()doc";
static const char *mkd_doc_slp_Hessian_m_cached_triplets = R"doc()doc";
static const char *mkd_doc_slp_Hessian_m_nonlinear_rows = R"doc()doc";
static const char *mkd_doc_slp_Hessian_m_output_lists = R"doc(List of output rows as column-node pairs)doc";
static const char *mkd_doc_slp_Hessian_m_top_lists =
R"doc(List of topologically sorted graphs from parent to child, one for each
row)doc";
static const char *mkd_doc_slp_Hessian_m_variables = R"doc()doc";
static const char *mkd_doc_slp_Hessian_m_wrt = R"doc()doc";
static const char *mkd_doc_slp_Hessian_value =
R"doc(Evaluates the Hessian at wrt's value.
Returns:
The Hessian at wrt's value.
)doc";
static const char *mkd_doc_slp_InequalityConstraints =
R"doc(A vector of inequality constraints of the form cᵢ(x) ≥ 0.
Template Args:
Scalar: Scalar type.)doc";
static const char *mkd_doc_slp_InequalityConstraints_InequalityConstraints =
R"doc(Concatenates multiple inequality constraints.
Args:
inequality_constraints: The list of InequalityConstraints to
concatenate.
)doc";
static const char *mkd_doc_slp_InequalityConstraints_InequalityConstraints_2 =
R"doc(Concatenates multiple inequality constraints.
This overload is for Python bindings only.
Args:
inequality_constraints: The list of InequalityConstraints to
concatenate.
)doc";
static const char *mkd_doc_slp_InequalityConstraints_InequalityConstraints_3 =
R"doc(Constructs an inequality constraint from a left and right side.
The standard form for inequality constraints is c(x) ≥ 0. This
function takes a constraints of the form lhs ≥ rhs and converts it to
lhs - rhs ≥ 0.
Args:
lhs: Left-hand side.
rhs: Right-hand side.
)doc";
static const char *mkd_doc_slp_InequalityConstraints_constraints = R"doc(A vector of scalar inequality constraints.)doc";
static const char *mkd_doc_slp_InequalityConstraints_operator_bool = R"doc(Implicit conversion operator to bool.)doc";
static const char *mkd_doc_slp_IterationInfo =
R"doc(Solver iteration information exposed to an iteration callback.
Template Args:
Scalar: Scalar type.)doc";
static const char *mkd_doc_slp_IterationInfo_A_e = R"doc(The equality constraint Jacobian.)doc";
static const char *mkd_doc_slp_IterationInfo_A_i = R"doc(The inequality constraint Jacobian.)doc";
static const char *mkd_doc_slp_IterationInfo_H = R"doc(The Hessian of the Lagrangian.)doc";
static const char *mkd_doc_slp_IterationInfo_g = R"doc(The gradient of the cost function.)doc";
static const char *mkd_doc_slp_IterationInfo_iteration = R"doc(The solver iteration.)doc";
static const char *mkd_doc_slp_IterationInfo_s = R"doc(The inequality constraint slack variables.)doc";
static const char *mkd_doc_slp_IterationInfo_x = R"doc(The decision variables.)doc";
static const char *mkd_doc_slp_IterationInfo_y = R"doc(The equality constraint dual variables.)doc";
static const char *mkd_doc_slp_IterationInfo_z = R"doc(The inequality constraint dual variables.)doc";
static const char *mkd_doc_slp_Jacobian =
R"doc(This class calculates the Jacobian of a vector of variables with
respect to a vector of variables.
The Jacobian is only recomputed if the variable expression is
quadratic or higher order.
Template Args:
Scalar: Scalar type.)doc";
static const char *mkd_doc_slp_Jacobian_2 = R"doc()doc";
static const char *mkd_doc_slp_Jacobian_3 = R"doc()doc";
static const char *mkd_doc_slp_Jacobian_Jacobian =
R"doc(Constructs a Jacobian object.
Args:
variable: Variable of which to compute the Jacobian.
wrt: Variable with respect to which to compute the Jacobian.
)doc";
static const char *mkd_doc_slp_Jacobian_Jacobian_2 =
R"doc(Constructs a Jacobian object.
Args:
variable: Variable of which to compute the Jacobian.
wrt: Vector of variables with respect to which to compute the
Jacobian.
)doc";
static const char *mkd_doc_slp_Jacobian_Jacobian_3 =
R"doc(Constructs a Jacobian object.
Args:
variables: Vector of variables of which to compute the Jacobian.
wrt: Vector of variables with respect to which to compute the
Jacobian.
)doc";
static const char *mkd_doc_slp_Jacobian_get =
R"doc(Returns the Jacobian as a VariableMatrix.
This is useful when constructing optimization problems with
derivatives in them.
Returns:
The Jacobian as a VariableMatrix.
)doc";
static const char *mkd_doc_slp_Jacobian_m_J = R"doc()doc";
static const char *mkd_doc_slp_Jacobian_m_cached_triplets = R"doc(Cached triplets for gradients of linear rows)doc";
static const char *mkd_doc_slp_Jacobian_m_nonlinear_rows =
R"doc(List of row indices for nonlinear rows whose graients will be computed
in value())doc";
static const char *mkd_doc_slp_Jacobian_m_output_lists = R"doc(List of output rows as column-node pairs)doc";
static const char *mkd_doc_slp_Jacobian_m_top_lists =
R"doc(List of topologically sorted graphs from parent to child, one for each
row)doc";
static const char *mkd_doc_slp_Jacobian_m_variables = R"doc()doc";
static const char *mkd_doc_slp_Jacobian_m_wrt = R"doc()doc";
static const char *mkd_doc_slp_Jacobian_value =
R"doc(Evaluates the Jacobian at wrt's value.
Returns:
The Jacobian at wrt's value.
)doc";
static const char *mkd_doc_slp_OCP =
R"doc(This class allows the user to pose and solve a constrained optimal
control problem (OCP) in a variety of ways.
The system is transcripted by one of three methods (direct
transcription, direct collocation, or single-shooting) and additional
constraints can be added.
In direct transcription, each state is a decision variable constrained
to the integrated dynamics of the previous state. In direct
collocation, the trajectory is modeled as a series of cubic
polynomials where the centerpoint slope is constrained. In single-
shooting, states depend explicitly as a function of all previous
states and all previous inputs.
Explicit ODEs are integrated using RK4.
For explicit ODEs, the function must be in the form dx/dt = f(t, x,
u). For discrete state transition functions, the function must be in
the form xₖ₊₁ = f(t, xₖ, uₖ).
Direct collocation requires an explicit ODE. Direct transcription and
single-shooting can use either an ODE or state transition function.
https://underactuated.mit.edu/trajopt.html goes into more detail on
each transcription method.
Template Args:
Scalar: Scalar type.)doc";
static const char *mkd_doc_slp_OCP_2 = R"doc()doc";
static const char *mkd_doc_slp_OCP_OCP =
R"doc(Builds an optimization problem using a system evolution function
(explicit ODE or discrete state transition function).
Args:
num_states: The number of system states.
num_inputs: The number of system inputs.
dt: The timestep for fixed-step integration.
num_steps: The number of control points.
dynamics: Function representing an explicit or implicit ODE, or a
discrete state transition function.
* Explicit: dx/dt = f(x, u, *)
* Implicit: f([x dx/dt]', u, *) = 0
* State transition: xₖ₊₁ = f(xₖ, uₖ)
dynamics_type: The type of system evolution function.
timestep_method: The timestep method.
transcription_method: The transcription method.
)doc";
static const char *mkd_doc_slp_OCP_OCP_2 =
R"doc(Builds an optimization problem using a system evolution function
(explicit ODE or discrete state transition function).
Args:
num_states: The number of system states.
num_inputs: The number of system inputs.
dt: The timestep for fixed-step integration.
num_steps: The number of control points.
dynamics: Function representing an explicit or implicit ODE, or a
discrete state transition function.
* Explicit: dx/dt = f(t, x, u, *)
* Implicit: f(t, [x dx/dt]', u, *) = 0
* State transition: xₖ₊₁ = f(t, xₖ, uₖ, dt)
dynamics_type: The type of system evolution function.
timestep_method: The timestep method.
transcription_method: The transcription method.
)doc";
static const char *mkd_doc_slp_OCP_U =
R"doc(Gets the input variables. After the problem is solved, this will
contain the inputs corresponding to the optimized trajectory.
Shaped (num_inputs)x(num_steps+1), although the last input step is
unused in the trajectory.
Returns:
The input variable matrix.
)doc";
static const char *mkd_doc_slp_OCP_X =
R"doc(Gets the state variables. After the problem is solved, this will
contain the optimized trajectory.
Shaped (num_states)x(num_steps+1).
Returns:
The state variable matrix.
)doc";
static const char *mkd_doc_slp_OCP_constrain_direct_collocation = R"doc(Applies direct collocation dynamics constraints.)doc";
static const char *mkd_doc_slp_OCP_constrain_direct_transcription = R"doc(Applies direct transcription dynamics constraints.)doc";
static const char *mkd_doc_slp_OCP_constrain_final_state =
R"doc(Constrains the final state.
Args:
final_state: the final state to constrain to.
)doc";
static const char *mkd_doc_slp_OCP_constrain_initial_state =
R"doc(Constrains the initial state.
Args:
initial_state: the initial state to constrain to.
)doc";
static const char *mkd_doc_slp_OCP_constrain_single_shooting = R"doc(Applies single shooting dynamics constraints.)doc";
static const char *mkd_doc_slp_OCP_dt =
R"doc(Gets the timestep variables. After the problem is solved, this will
contain the timesteps corresponding to the optimized trajectory.
Shaped 1x(num_steps+1), although the last timestep is unused in the
trajectory.
Returns:
The timestep variable matrix.
)doc";
static const char *mkd_doc_slp_OCP_final_state =
R"doc(Gets the final state in the trajectory.
Returns:
The final state of the trajectory.
)doc";
static const char *mkd_doc_slp_OCP_for_each_step =
R"doc(Sets the constraint evaluation function. This function is called
`num_steps+1` times, with the corresponding state and input
VariableMatrices.
Args:
callback: The callback f(x, u) where x is the state and u is the
input vector.
)doc";
static const char *mkd_doc_slp_OCP_for_each_step_2 =
R"doc(Sets the constraint evaluation function. This function is called
`num_steps+1` times, with the corresponding state and input
VariableMatrices.
Args:
callback: The callback f(t, x, u, dt) where t is time, x is the
state vector, u is the input vector, and dt is the
timestep duration.
)doc";
static const char *mkd_doc_slp_OCP_initial_state =
R"doc(Gets the initial state in the trajectory.
Returns:
The initial state of the trajectory.
)doc";
static const char *mkd_doc_slp_OCP_m_DT = R"doc()doc";
static const char *mkd_doc_slp_OCP_m_U = R"doc()doc";
static const char *mkd_doc_slp_OCP_m_X = R"doc()doc";
static const char *mkd_doc_slp_OCP_m_dynamics = R"doc()doc";
static const char *mkd_doc_slp_OCP_m_dynamics_type = R"doc()doc";
static const char *mkd_doc_slp_OCP_m_num_steps = R"doc()doc";
static const char *mkd_doc_slp_OCP_rk4 =
R"doc(Performs 4th order Runge-Kutta integration of dx/dt = f(t, x, u) for
dt.
Args:
f: The function to integrate. It must take two arguments x and u.
x: The initial value of x.
u: The value u held constant over the integration period.
t0: The initial time.
dt: The time over which to integrate.
)doc";
static const char *mkd_doc_slp_OCP_set_lower_input_bound =
R"doc(Sets a lower bound on the input.
Args:
lower_bound: The lower bound that inputs must always be above.
Must be shaped (num_inputs)x1.
)doc";
static const char *mkd_doc_slp_OCP_set_max_timestep =
R"doc(Sets an upper bound on the timestep.
Args:
max_timestep: The maximum timestep.
)doc";
static const char *mkd_doc_slp_OCP_set_min_timestep =
R"doc(Sets a lower bound on the timestep.
Args:
min_timestep: The minimum timestep.
)doc";
static const char *mkd_doc_slp_OCP_set_upper_input_bound =
R"doc(Sets an upper bound on the input.
Args:
upper_bound: The upper bound that inputs must always be below.
Must be shaped (num_inputs)x1.
)doc";
static const char *mkd_doc_slp_Options = R"doc(Solver options.)doc";
static const char *mkd_doc_slp_Options_diagnostics =
R"doc(Enables diagnostic output.
See https://sleipnirgroup.github.io/Sleipnir/md_usage.html#output for
more information.)doc";
static const char *mkd_doc_slp_Options_feasible_ipm =
R"doc(Enables the feasible interior-point method.
When the inequality constraints are all feasible, step sizes are
reduced when necessary to prevent them becoming infeasible again. This
is useful when parts of the problem are ill-conditioned in infeasible
regions (e.g., square root of a negative value). This can slow or
prevent progress toward a solution though, so only enable it if
necessary.)doc";
static const char *mkd_doc_slp_Options_max_iterations = R"doc(The maximum number of solver iterations before returning a solution.)doc";
static const char *mkd_doc_slp_Options_timeout = R"doc(The maximum elapsed wall clock time before returning a solution.)doc";
static const char *mkd_doc_slp_Options_tolerance = R"doc(The solver will stop once the error is below this tolerance.)doc";
static const char *mkd_doc_slp_Problem =
R"doc(This class allows the user to pose a constrained nonlinear
optimization problem in natural mathematical notation and solve it.
This class supports problems of the form:
```
minₓ f(x)
subject to cₑ(x) = 0
cᵢ(x) ≥ 0
```
where f(x) is the scalar cost function, x is the vector of decision
variables (variables the solver can tweak to minimize the cost
function), cᵢ(x) are the inequality constraints, and cₑ(x) are the
equality constraints. Constraints are equations or inequalities of the
decision variables that constrain what values the solver is allowed to
use when searching for an optimal solution.
The nice thing about this class is users don't have to put their
system in the form shown above manually; they can write it in natural
mathematical form and it'll be converted for them.
Template Args:
Scalar: Scalar type.)doc";
static const char *mkd_doc_slp_Problem_2 = R"doc()doc";
static const char *mkd_doc_slp_Problem_Problem = R"doc(Constructs the optimization problem.)doc";
static const char *mkd_doc_slp_Problem_add_callback =
R"doc(Adds a callback to be called at the beginning of each solver
iteration.
The callback for this overload should return void.
Args:
callback: The callback.
)doc";
static const char *mkd_doc_slp_Problem_add_callback_2 =
R"doc(Adds a callback to be called at the beginning of each solver
iteration.
The callback for this overload should return bool.
Args:
callback: The callback. Returning true from the callback causes
the solver to exit early with the solution it has so
far.
)doc";
static const char *mkd_doc_slp_Problem_add_persistent_callback =
R"doc(Adds a callback to be called at the beginning of each solver
iteration.
Language bindings should call this in the Problem constructor to
register callbacks that shouldn't be removed by clear_callbacks().
Persistent callbacks run after non-persistent callbacks.
Args:
callback: The callback. Returning true from the callback causes
the solver to exit early with the solution it has so
far.
)doc";
static const char *mkd_doc_slp_Problem_clear_callbacks = R"doc(Clears the registered callbacks.)doc";
static const char *mkd_doc_slp_Problem_cost_function_type =
R"doc(Returns the cost function's type.
Returns:
The cost function's type.
)doc";
static const char *mkd_doc_slp_Problem_decision_variable =
R"doc(Creates a decision variable in the optimization problem.
Decision variables have an initial value of zero.
Returns:
A decision variable in the optimization problem.
)doc";
static const char *mkd_doc_slp_Problem_decision_variable_2 =
R"doc(Creates a matrix of decision variables in the optimization problem.
Decision variables have an initial value of zero.
Args:
rows: Number of matrix rows.
cols: Number of matrix columns.
Returns:
A matrix of decision variables in the optimization problem.
)doc";
static const char *mkd_doc_slp_Problem_equality_constraint_type =
R"doc(Returns the type of the highest order equality constraint.
Returns:
The type of the highest order equality constraint.
)doc";
static const char *mkd_doc_slp_Problem_inequality_constraint_type =
R"doc(Returns the type of the highest order inequality constraint.
Returns:
The type of the highest order inequality constraint.
)doc";
static const char *mkd_doc_slp_Problem_m_decision_variables = R"doc()doc";
static const char *mkd_doc_slp_Problem_m_equality_constraints = R"doc()doc";
static const char *mkd_doc_slp_Problem_m_f = R"doc()doc";
static const char *mkd_doc_slp_Problem_m_inequality_constraints = R"doc()doc";
static const char *mkd_doc_slp_Problem_m_iteration_callbacks = R"doc()doc";
static const char *mkd_doc_slp_Problem_m_persistent_iteration_callbacks = R"doc()doc";
static const char *mkd_doc_slp_Problem_maximize =
R"doc(Tells the solver to maximize the output of the given objective
function.
Note that this is optional. If only constraints are specified, the
solver will find the closest solution to the initial conditions that's
in the feasible set.
Args:
objective: The objective function to maximize. A 1x1
VariableMatrix will implicitly convert to a Variable,
and a non-1x1 VariableMatrix will raise an assertion.
)doc";
static const char *mkd_doc_slp_Problem_maximize_2 =
R"doc(Tells the solver to maximize the output of the given objective
function.
Note that this is optional. If only constraints are specified, the
solver will find the closest solution to the initial conditions that's
in the feasible set.
Args:
objective: The objective function to maximize. A 1x1
VariableMatrix will implicitly convert to a Variable,
and a non-1x1 VariableMatrix will raise an assertion.
)doc";
static const char *mkd_doc_slp_Problem_minimize =
R"doc(Tells the solver to minimize the output of the given cost function.
Note that this is optional. If only constraints are specified, the
solver will find the closest solution to the initial conditions that's
in the feasible set.
Args:
cost: The cost function to minimize. A 1x1 VariableMatrix will
implicitly convert to a Variable, and a non-1x1
VariableMatrix will raise an assertion.
)doc";
static const char *mkd_doc_slp_Problem_minimize_2 =
R"doc(Tells the solver to minimize the output of the given cost function.
Note that this is optional. If only constraints are specified, the
solver will find the closest solution to the initial conditions that's
in the feasible set.
Args:
cost: The cost function to minimize. A 1x1 VariableMatrix will
implicitly convert to a Variable, and a non-1x1
VariableMatrix will raise an assertion.
)doc";
static const char *mkd_doc_slp_Problem_print_exit_conditions = R"doc()doc";
static const char *mkd_doc_slp_Problem_print_problem_analysis = R"doc()doc";
static const char *mkd_doc_slp_Problem_solve =
R"doc(Solves the optimization problem. The solution will be stored in the
original variables used to construct the problem.
Args:
options: Solver options.
spy: Enables writing sparsity patterns of H, Aₑ, and Aᵢ to files
named H.spy, A_e.spy, and A_i.spy respectively during solve.
Use tools/spy.py to plot them.
Returns:
The solver status.
)doc";
static const char *mkd_doc_slp_Problem_solve_ipm = R"doc()doc";
static const char *mkd_doc_slp_Problem_solve_newton = R"doc()doc";
static const char *mkd_doc_slp_Problem_solve_sqp = R"doc()doc";
static const char *mkd_doc_slp_Problem_subject_to =
R"doc(Tells the solver to solve the problem while satisfying the given
equality constraint.
Args:
constraint: The constraint to satisfy.
)doc";
static const char *mkd_doc_slp_Problem_subject_to_2 =
R"doc(Tells the solver to solve the problem while satisfying the given
equality constraint.
Args:
constraint: The constraint to satisfy.
)doc";
static const char *mkd_doc_slp_Problem_subject_to_3 =
R"doc(Tells the solver to solve the problem while satisfying the given
inequality constraint.
Args:
constraint: The constraint to satisfy.
)doc";
static const char *mkd_doc_slp_Problem_subject_to_4 =
R"doc(Tells the solver to solve the problem while satisfying the given
inequality constraint.
Args:
constraint: The constraint to satisfy.
)doc";
static const char *mkd_doc_slp_Problem_symmetric_decision_variable =
R"doc(Creates a symmetric matrix of decision variables in the optimization
problem.