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.
@@ -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