scs 3.2.8__cp314-cp314t-win_amd64.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.
scs/__init__.py ADDED
@@ -0,0 +1,210 @@
1
+ #!/usr/bin/env python
2
+
3
+
4
+ # start delvewheel patch
5
+ def _delvewheel_patch_1_11_1():
6
+ import os
7
+ if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'scs.libs'))):
8
+ os.add_dll_directory(libs_dir)
9
+
10
+
11
+ _delvewheel_patch_1_11_1()
12
+ del _delvewheel_patch_1_11_1
13
+ # end delvewheel patch
14
+
15
+ from warnings import warn
16
+ from scipy import sparse
17
+ from scs import _scs_direct
18
+
19
+ __version__ = _scs_direct.version()
20
+ __sizeof_int__ = _scs_direct.sizeof_int()
21
+ __sizeof_float__ = _scs_direct.sizeof_float()
22
+
23
+ _USE_INDIRECT_DEFAULT = False
24
+
25
+
26
+ # SCS return integers correspond to one of these flags:
27
+ # (copied from scs/include/glbopts.h)
28
+ INFEASIBLE_INACCURATE = -7 # SCS best guess infeasible
29
+ UNBOUNDED_INACCURATE = -6 # SCS best guess unbounded
30
+ SIGINT = -5 # interrupted by sig int
31
+ FAILED = -4 # SCS failed
32
+ INDETERMINATE = -3 # indeterminate (norm too small)
33
+ INFEASIBLE = -2 # primal infeasible, dual unbounded
34
+ UNBOUNDED = -1 # primal unbounded, dual infeasible
35
+ UNFINISHED = 0 # never returned, used as placeholder
36
+ SOLVED = 1 # problem solved to desired accuracy
37
+ SOLVED_INACCURATE = 2 # SCS best guess solved
38
+
39
+
40
+ # Choose which SCS to import based on settings.
41
+ def _select_scs_module(stgs):
42
+
43
+ if stgs.pop("gpu", False): # False by default
44
+ if not stgs.pop("use_indirect", _USE_INDIRECT_DEFAULT):
45
+ raise NotImplementedError(
46
+ "For the GPU direct solver, pass `use_indirect=False cudss=True`.")
47
+ from scs import _scs_gpu
48
+
49
+ return _scs_gpu
50
+
51
+ if stgs.pop("mkl", False): # False by default
52
+ if stgs.pop("use_indirect", False):
53
+ raise NotImplementedError(
54
+ "MKL indirect solver not yet available, pass `use_indirect=False`."
55
+ )
56
+ from scs import _scs_mkl
57
+
58
+ return _scs_mkl
59
+
60
+ if stgs.pop("cudss", False): # False by default
61
+ if stgs.pop("use_indirect", False):
62
+ raise NotImplementedError(
63
+ "cuDSS is a direct solver, pass `use_indirect=False`."
64
+ )
65
+ from scs import _scs_cudss
66
+
67
+ return _scs_cudss
68
+
69
+ if stgs.pop("use_indirect", _USE_INDIRECT_DEFAULT):
70
+ from scs import _scs_indirect
71
+
72
+ return _scs_indirect
73
+
74
+ return _scs_direct
75
+
76
+
77
+ class SCS(object):
78
+ def __init__(self, data, cone, **settings):
79
+ """Initialize the SCS solver.
80
+
81
+ @param data Dictionary containing keys `P`, `A`, `b`, `c`.
82
+ @param cone Dictionary containing cone information.
83
+ @param settings Settings as kwargs, see docs.
84
+
85
+ """
86
+ self._settings = settings
87
+ if not data or not cone:
88
+ raise ValueError("Missing data or cone information")
89
+
90
+ if "b" not in data or "c" not in data:
91
+ raise ValueError("Missing one of b, c from data dictionary")
92
+ if "A" not in data:
93
+ raise ValueError("Missing A from data dictionary")
94
+
95
+ A = data["A"]
96
+ b = data["b"]
97
+ c = data["c"]
98
+
99
+ if A is None or b is None or c is None:
100
+ raise ValueError("Incomplete data specification")
101
+
102
+ if not sparse.issparse(A):
103
+ raise TypeError("A is required to be a sparse matrix")
104
+ if not A.format == "csc":
105
+ warn(
106
+ "Converting A to a CSC (compressed sparse column) matrix;"
107
+ " may take a while."
108
+ )
109
+ A = A.tocsc()
110
+
111
+ if sparse.issparse(b):
112
+ b = b.todense()
113
+
114
+ if sparse.issparse(c):
115
+ c = c.todense()
116
+
117
+ m = len(b)
118
+ n = len(c)
119
+
120
+ if not A.has_sorted_indices:
121
+ A.sort_indices()
122
+ Adata, Aindices, Acolptr = A.data, A.indices, A.indptr
123
+ if A.shape != (m, n):
124
+ raise ValueError("A shape not compatible with b,c")
125
+
126
+ Pdata, Pindices, Pcolptr = None, None, None
127
+ if "P" in data:
128
+ P = data["P"]
129
+ if P is not None:
130
+ if not sparse.issparse(P):
131
+ raise TypeError("P is required to be a sparse matrix")
132
+ if P.shape != (n, n):
133
+ raise ValueError("P shape not compatible with A,b,c")
134
+ if not P.format == "csc":
135
+ warn(
136
+ "Converting P to a CSC (compressed sparse column) "
137
+ "matrix; may take a while."
138
+ )
139
+ P = P.tocsc()
140
+ # extract upper triangular component only
141
+ if sparse.tril(P, -1).data.size > 0:
142
+ P = sparse.triu(P, format="csc")
143
+ if not P.has_sorted_indices:
144
+ P.sort_indices()
145
+ Pdata, Pindices, Pcolptr = P.data, P.indices, P.indptr
146
+
147
+ # Which scs are we using (scs_direct, scs_indirect, ...)
148
+ _scs = _select_scs_module(self._settings)
149
+
150
+ # Initialize solver
151
+ self._solver = _scs.SCS(
152
+ (m, n),
153
+ Adata,
154
+ Aindices,
155
+ Acolptr,
156
+ Pdata,
157
+ Pindices,
158
+ Pcolptr,
159
+ b,
160
+ c,
161
+ cone,
162
+ **self._settings
163
+ )
164
+
165
+ def solve(self, warm_start=True, x=None, y=None, s=None):
166
+ """Solve the optimization problem.
167
+
168
+ @param warm_start Whether to warm-start. By default the solution of
169
+ the previous problem is used as the warm-start. The
170
+ warm-start can be overriden to another value by
171
+ passing `x`, `y`, `s` args.
172
+ @param x Primal warm-start override.
173
+ @param y Dual warm-start override.
174
+ @param s Slack warm-start override.
175
+
176
+ @return dictionary with solution with keys:
177
+ 'x' - primal solution
178
+ 's' - primal slack solution
179
+ 'y' - dual solution
180
+ 'info' - information dictionary (see docs)
181
+ """
182
+ return self._solver.solve(warm_start, x, y, s)
183
+
184
+ def update(self, b=None, c=None):
185
+ """Update the `b` vector, `c` vector, or both, before another solve.
186
+
187
+ After a solve we can reuse the SCS workspace in another solve if the
188
+ only problem data that has changed are the `b` and `c` vectors.
189
+
190
+ @param b New `b` vector.
191
+ @param c New `c` vector.
192
+
193
+ """
194
+ self._solver.update(b, c)
195
+
196
+
197
+ # Backwards compatible helper function that simply calls the main API.
198
+ def solve(data, cone, **settings):
199
+ solver = SCS(data, cone, **settings)
200
+
201
+ # Hack out the warm start data from old API
202
+ x = y = s = None
203
+ if "x" in data:
204
+ x = data["x"]
205
+ if "y" in data:
206
+ y = data["y"]
207
+ if "s" in data:
208
+ s = data["s"]
209
+
210
+ return solver.solve(warm_start=True, x=x, y=y, s=s)
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ Version: 1.11.1
2
+ Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-bwksi8gf\\cp314t-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-bwksi8gf\\cp314t-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-bwksi8gf\\cp314t-win_amd64\\built_wheel\\scs-3.2.8-cp314-cp314t-win_amd64.whl']
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Brendan O'Donoghue
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,54 @@
1
+ Metadata-Version: 2.1
2
+ Name: scs
3
+ Version: 3.2.8
4
+ Summary: Splitting conic solver
5
+ Author-Email: Brendan O'Donoghue <bodonoghue85@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2017 Brendan O'Donoghue
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Classifier: License :: OSI Approved :: MIT License
29
+ Classifier: Programming Language :: C
30
+ Classifier: Programming Language :: Python
31
+ Classifier: Programming Language :: Python :: 3
32
+ Classifier: Programming Language :: Python :: 3.11
33
+ Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: Programming Language :: Python :: 3.13
35
+ Classifier: Programming Language :: Python :: 3 :: Only
36
+ Classifier: Programming Language :: Python :: Implementation :: CPython
37
+ Classifier: Operating System :: Microsoft :: Windows
38
+ Classifier: Operating System :: POSIX
39
+ Classifier: Operating System :: Unix
40
+ Classifier: Operating System :: MacOS
41
+ Requires-Python: >=3.9
42
+ Requires-Dist: numpy
43
+ Requires-Dist: scipy
44
+ Description-Content-Type: text/markdown
45
+
46
+ scs-python
47
+ ===
48
+
49
+ [![Build Status](https://github.com/bodono/scs-python/actions/workflows/build.yml/badge.svg)](https://github.com/bodono/scs-python/actions/workflows/build.yml)
50
+ [![Documentation](https://img.shields.io/badge/docs-online-brightgreen?logo=read-the-docs&style=flat)](https://www.cvxgrp.org/scs/)
51
+ [![PyPI Downloads/Month](https://static.pepy.tech/personalized-badge/scs?period=month&units=abbreviation&left_color=grey&right_color=brightgreen&left_text=downloads/month)](https://pepy.tech/project/scs)
52
+
53
+ Python interface for [SCS](https://github.com/cvxgrp/scs) 3.0.0 and higher.
54
+ The full documentation is available [here](https://www.cvxgrp.org/scs/).
@@ -0,0 +1,11 @@
1
+ scs/_scs_direct.cp314t-win_amd64.dll.a,sha256=hGUo8U_v3waxxvEEhMUQ0LjT6XZxno_0bUOZGlqFtBo,1796
2
+ scs/_scs_direct.cp314t-win_amd64.pyd,sha256=sSmeHhXVRF3j3RyXOHE-i-w-F2xNgWQNVujsyNlx8uE,190783
3
+ scs/_scs_indirect.cp314t-win_amd64.dll.a,sha256=yzHDpTi8RsYyiOqxsVwDNJmVf-CnicI0oP0w1d8MH6Y,1822
4
+ scs/_scs_indirect.cp314t-win_amd64.pyd,sha256=FvT5QnqUq_xKuT7bx_ler6kZsLm4-3br5FN7PDiJlm8,163167
5
+ scs/__init__.py,sha256=TlbCWs7Cvl0358gTbAjiSWK6AtyI-HBp4sUKLXdRsaA,6959
6
+ scs-3.2.8.dist-info/DELVEWHEEL,sha256=LeWqNGUr5iNKePc1VLp3r_nuG4ftLYuQu8C0ETOu3p8,400
7
+ scs-3.2.8.dist-info/LICENSE,sha256=7Lc8bCEkAOhTRGOUitKX0hhZiZ-e_jS1V_naEQR5YDw,1096
8
+ scs-3.2.8.dist-info/METADATA,sha256=NXOnuqeyO5Kl7oCCTUjivQngCggQqXZN25VJyCSVxGU,2806
9
+ scs-3.2.8.dist-info/RECORD,,
10
+ scs-3.2.8.dist-info/WHEEL,sha256=bptiEuhFO_SRCWh6pKadvOBI9eKlFVzU5R6pIzoecmk,86
11
+ scs.libs/openblas-b2d49d518a79c6ab6a81a0e5be0c1c94.dll,sha256=stSdUYp5xqtqgaDlvgwclBtPD2nY9DrS3u33M-TqcxU,28011520
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: meson
3
+ Root-Is-Purelib: false
4
+ Tag: cp314-cp314t-win_amd64