diffapqp 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diffapqp/__init__.py +11 -0
- diffapqp-0.1.0.dist-info/METADATA +457 -0
- diffapqp-0.1.0.dist-info/RECORD +14 -0
- diffapqp-0.1.0.dist-info/WHEEL +5 -0
- diffapqp-0.1.0.dist-info/licenses/LICENSE +201 -0
- diffapqp-0.1.0.dist-info/top_level.txt +2 -0
- lao/__init__.py +14 -0
- lao/__version__.py +1 -0
- lao/cvxpy_compat.py +69 -0
- lao/diffapqp/__init__.py +2 -0
- lao/diffapqp/layer.py +702 -0
- lao/diffapqp/solve_result.py +55 -0
- lao/diffapqp/value_layer.py +799 -0
- lao/utils.py +459 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""Small data containers for the batched CVXPY solve pipeline."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
|
|
5
|
+
import cvxpy as cp
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class SampleSolveResult:
|
|
11
|
+
"""One sample's standardized QP solve result."""
|
|
12
|
+
|
|
13
|
+
primal: np.ndarray
|
|
14
|
+
dual_eq: np.ndarray
|
|
15
|
+
dual_ineq: np.ndarray
|
|
16
|
+
value: float
|
|
17
|
+
raw_solution: object
|
|
18
|
+
timing: dict
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass
|
|
22
|
+
class PreparedSolveData:
|
|
23
|
+
"""CVXPY data prepared for one sample before entering the solver."""
|
|
24
|
+
|
|
25
|
+
cvxpy_prob: cp.Problem
|
|
26
|
+
data: dict
|
|
27
|
+
chain: object
|
|
28
|
+
inverse_data: object
|
|
29
|
+
prepare_time: float
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class PreparedSolveTask:
|
|
34
|
+
"""One solve task with prepared CVXPY data and solver options."""
|
|
35
|
+
|
|
36
|
+
prepared: PreparedSolveData
|
|
37
|
+
solver: str
|
|
38
|
+
warm_start: bool
|
|
39
|
+
verbose: bool
|
|
40
|
+
solver_args: dict
|
|
41
|
+
n_eq_standard: int
|
|
42
|
+
n_ineq_standard: int
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass
|
|
46
|
+
class LayerSolveSummary:
|
|
47
|
+
"""Batched solve summary needed by the solution-map layer."""
|
|
48
|
+
|
|
49
|
+
primal: np.ndarray
|
|
50
|
+
dual_eq: np.ndarray
|
|
51
|
+
dual_ineq: np.ndarray
|
|
52
|
+
raw_solutions: list
|
|
53
|
+
timing: dict
|
|
54
|
+
active_ineq_indices: list
|
|
55
|
+
inequality_rhs: np.ndarray
|