File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
5
5
[project ]
6
6
name = " qocogen"
7
- version = " 0.1.4 "
7
+ version = " 0.1.5 "
8
8
description = " QOCOGEN: Custom Code Generator for the QOCO solver"
9
9
readme = " README.md"
10
10
requires-python = " >=3.8"
Original file line number Diff line number Diff line change @@ -14,6 +14,19 @@ def _generate_solver(
14
14
):
15
15
solver_dir = output_dir + "/" + name
16
16
17
+ # Need to handle case where 0 is in P.data, A.data, or G.data.
18
+ if P is not None :
19
+ for i in range (P .nnz ):
20
+ if P .data [i ] == 0 :
21
+ P .data [i ] += 1e-16
22
+ if A is not None :
23
+ for i in range (A .nnz ):
24
+ if A .data [i ] == 0 :
25
+ A .data [i ] += 1e-16
26
+ if G is not None :
27
+ for i in range (G .nnz ):
28
+ if G .data [i ] == 0 :
29
+ G .data [i ] += 1e-16
17
30
print ("\n " )
18
31
if os .path .exists (solver_dir ):
19
32
print ("Removing existing solver." )
@@ -1674,7 +1687,7 @@ def generate_utils(
1674
1687
' printf("| QOCO Custom Generated Solver |\\ n");\n '
1675
1688
)
1676
1689
f .write (
1677
- ' printf("| (c) Govind M. Chari, 2024 |\\ n");\n '
1690
+ ' printf("| (c) Govind M. Chari, 2025 |\\ n");\n '
1678
1691
)
1679
1692
f .write (
1680
1693
' printf("| University of Washington Autonomous Controls Lab |\\ n");\n '
You can’t perform that action at this time.
0 commit comments