jijmodeling 1.10.2__cp312-cp312-manylinux_2_28_aarch64.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.

Potentially problematic release.


This version of jijmodeling might be problematic. Click here for more details.

jijmodeling/dataset.py ADDED
@@ -0,0 +1,5 @@
1
+ from ._jijmodeling import dataset as _dataset # type: ignore
2
+ import sys
3
+
4
+ for component in _dataset.__all__:
5
+ setattr(sys.modules[__name__], component, getattr(_dataset, component))
@@ -0,0 +1,105 @@
1
+ # This file is automatically generated by pyo3_stub_gen
2
+ # ruff: noqa: E501, F401
3
+
4
+ import typing
5
+
6
+ class Miplib:
7
+ r"""
8
+ Automatically load problems from the MIPLIB dataset.
9
+
10
+ Warning: the whole dataset is downloaded and cached in your filesystem when
11
+ first used. It is quite large (~300MB download, ~600MB extracted), so the
12
+ time it takes to download will likely be significant. We recommend first
13
+ trying to use this class in a REPL to assure the dataset has been cached.
14
+
15
+ The dataset is stored at `{data_dir}/jijmodeling/miplib`, where
16
+ `{data_dir}` depends on your operating system:
17
+
18
+ |Platform| {data_dir} location | Example/System Default |
19
+ |:-------|:---------------------------------------|:-----------------------------------------|
20
+ |Linux |`$XDG_DATA_HOME` or `$HOME/.local/share`|`/home/alice/.local/share` |
21
+ |macOS |`$HOME/Library/Application Support` |`/Users/Alice/Library/Application Support`|
22
+ |Windows |`%AppData% |`C:\Users\Alice\AppData\Roaming` |
23
+
24
+
25
+ Examples
26
+ ---------
27
+ ```python
28
+ >>> import jijmodeling.dataset
29
+
30
+ Initialize the dataset. If not cached in your filesystem, this will take several minutes.
31
+ >>> miplib = jijmodeling.dataset.Miplib()
32
+
33
+ Show names of each available instance.
34
+ >>> miplib.available_names # doctest: +ELLIPSIS
35
+ [...]
36
+
37
+ Get basic statistics of a specific instance.
38
+ >>> miplib.instance_statistics["unitcal_7"]
39
+ {'variable': 25755, 'constraint': 48939, 'binary': 2856, 'integer': 0, 'continuous': 22899, 'non_zero': 127595}
40
+
41
+ Load "revised-submissions/miplib2010_pg/instances/pg.mps.gz" in benchmark.zip
42
+ >>> problem, instance_data = miplib.load("pg")
43
+
44
+ ```
45
+ """
46
+ available_names: list[str]
47
+ instance_statistics: typing.Any
48
+ def __new__(cls,verbose = ...): ...
49
+ def load(self, name:str) -> tuple:
50
+ r"""
51
+ Load a problem from the MIPLIB dataset.
52
+ """
53
+ ...
54
+
55
+
56
+ class Qplib:
57
+ r"""
58
+ Automatically load problems from the MIPLIB dataset.
59
+
60
+ Warning: the whole dataset is downloaded and cached in your filesystem when
61
+ first used. It is quite large (~700MB download, ~1.5GB extracted), so the
62
+ time it takes to download will likely be significant. We recommend first
63
+ trying to use this class in a REPL to assure the dataset has been cached.
64
+
65
+ The dataset is stored at `{data_dir}/jijmodeling/qplib`, where
66
+ `{data_dir}` depends on your operating system:
67
+
68
+ |Platform| {data_dir} location | Example/System Default |
69
+ |:-------|:---------------------------------------|:-----------------------------------------|
70
+ |Linux |`$XDG_DATA_HOME` or `$HOME/.local/share`|`/home/alice/.local/share` |
71
+ |macOS |`$HOME/Library/Application Support` |`/Users/Alice/Library/Application Support`|
72
+ |Windows |`%AppData% |`C:\Users\Alice\AppData\Roaming` |
73
+
74
+
75
+ Examples
76
+ ---------
77
+ ```python
78
+ >>> import jijmodeling.dataset
79
+
80
+ Initialize the dataset. If not cached in your filesystem, this will take several minutes.
81
+ >>> qplib = jijmodeling.dataset.Qplib()
82
+
83
+ Show the names of each available instance.
84
+ >>> qplib.available_names # doctest: +ELLIPSIS
85
+ [...]
86
+
87
+ Get basic statistics of a specific instance.
88
+ >>> qplib.instance_statistics["QPLIB_2205"]
89
+ {'variables': 2884, 'constraints': 2874, 'binary': 958, 'integer': 0, 'continuous': 1926, 'non_zero': 13013}
90
+
91
+ Load a problem instance from QPLIB.
92
+ >>> problem, instance_data = qplib.load("QPLIB_1976")
93
+
94
+ ```
95
+ """
96
+ available_names: list[str]
97
+ instance_statistics: typing.Any
98
+ def __new__(cls,verbose = ...): ...
99
+ def load(self, name:str) -> tuple:
100
+ r"""
101
+ Load a problem from the QPLIB dataset.
102
+ """
103
+ ...
104
+
105
+
@@ -0,0 +1,13 @@
1
+ # `jijmodeling.jijmodeling` is a module corresponding to the shared library created by PyO3,
2
+ # and `jijmodeling.jijmodeling.experimental` is its submodule defined dynamically
3
+ # while the initialization of the shared library.
4
+ #
5
+ # This file defines a new sub-module `jijmodeling.experimental`,
6
+ # and exposes all the components in `jijmodeling.jijmodeling.experimental`
7
+ #
8
+
9
+ from ._jijmodeling import experimental as _experimental # type: ignore
10
+ import sys
11
+
12
+ for component in _experimental.__all__:
13
+ setattr(sys.modules[__name__], component, getattr(_experimental, component))
@@ -0,0 +1,301 @@
1
+ # This file is automatically generated by pyo3_stub_gen
2
+ # ruff: noqa: E501, F401
3
+
4
+ import numpy
5
+ import numpy.typing
6
+ import typing
7
+ from enum import Enum, auto
8
+
9
+ class EvaluationResult:
10
+ objective: float
11
+ constraints: dict[str, Violation]
12
+ penalties: dict[str, Violation]
13
+ def __new__(cls,objective = ...,constraints = ...,penalties = ...): ...
14
+ def __str__(self) -> str:
15
+ ...
16
+
17
+ def __repr__(self) -> str:
18
+ ...
19
+
20
+
21
+ class MeasuringTime:
22
+ def __new__(cls,solving_time:typing.Optional[SolvingTime], system_time:typing.Optional[SystemTime]): ...
23
+ def __str__(self) -> str:
24
+ ...
25
+
26
+ def __repr__(self) -> str:
27
+ ...
28
+
29
+ def total(self) -> float:
30
+ r"""
31
+ Returns the total time measurred, across both `SolvingTime` and `SystemTime`.
32
+ """
33
+ ...
34
+
35
+ def view_solving_time(self) -> SolvingTime:
36
+ r"""
37
+ Returns a readonly view of the internal `SolvingTime` field.
38
+ """
39
+ ...
40
+
41
+ def view_system_time(self) -> SystemTime:
42
+ r"""
43
+ Returns a readonly view of the internal `SystemTime` field.
44
+ """
45
+ ...
46
+
47
+
48
+ class Sample:
49
+ r"""
50
+ A Sample representing an individual solution found by running the mathematical optimization model.
51
+
52
+ Variables in `var_values` are stored in instances of `SparseVarValues`. This uses a dictionary
53
+ style, retaining only non-zero elements. For example, if the values for a two-dimensional
54
+ decision variable are `x = [[0, 1, 2], [1, 0, 0]]`, they will be stored as
55
+ `{(0,1): 1, (0,2): 2, (1,0): 1}`. To retrieve this, use `sample.var_values["x"].values`.
56
+ If you want a dense array of decision variables, you can use the `to_dense()` method.
57
+
58
+ `run_id` is a unique identifier of the run in which this sample was found.
59
+ Note that this is not the same as a unique identifier of the Sample.
60
+ """
61
+ run_id: str
62
+ num_occurrences: int
63
+ run_info: dict[str, None | str | int | float | list | dict]
64
+ var_values: dict[str, SparseVarValues]
65
+ eval: EvaluationResult
66
+ def __new__(cls,num_occurrences = ...,run_id = ...,run_info = ...,var_values = ...,eval = ...): ...
67
+ @staticmethod
68
+ def from_dense_arrays(dict,num_occurrences = ...,var_types = ...,run_id = ...,meta_info = ...) -> Sample:
69
+ ...
70
+
71
+ def __str__(self) -> str:
72
+ ...
73
+
74
+ def __repr__(self) -> str:
75
+ ...
76
+
77
+ def __eq__(self, other:typing.Any) -> bool:
78
+ ...
79
+
80
+ def is_feasible(self, epsilon = ...) -> bool:
81
+ ...
82
+
83
+ def to_dense(self) -> dict[str, numpy.typing.NDArray[numpy.float64]]:
84
+ ...
85
+
86
+ @staticmethod
87
+ def from_dict(dict:dict) -> Sample:
88
+ r"""
89
+ Converts a python dictionary into a SampleSet.
90
+
91
+ This is intended to be used primarily with dictionaries generated by
92
+ the `to_dict()` method. As such sparse value maps must be represented as
93
+ association lists.
94
+ """
95
+ ...
96
+
97
+ def to_dict(self) -> typing.Any:
98
+ r"""
99
+ Converts this SampleSet into a regular python dictionary.
100
+
101
+ Note that this dictionary has a slightly different structure to better support JSON
102
+ serialization of the output dictionary: sparse values are stored differently. Any mapping
103
+ with tuples as keys is transformed into an association list of key-value pairs,
104
+ that is, `[(k1, v1), (k2, v2), ...]`.
105
+ """
106
+ ...
107
+
108
+
109
+ class SampleIter:
110
+ def __iter__(self) -> SampleIter:
111
+ ...
112
+
113
+ def __next__(self) -> Sample:
114
+ ...
115
+
116
+
117
+ class SampleSet:
118
+ data: list[Sample]
119
+ set_id: str
120
+ set_info: dict[str, None | str | int | float | list | dict]
121
+ run_info: dict[str, None | str | int | float | list | dict]
122
+ measuring_time: MeasuringTime
123
+ run_times: dict[str, MeasuringTime]
124
+ def __new__(cls,data = ...,*,set_id = ...,set_info = ...,run_info = ...,measuring_time = ...,run_times = ...): ...
125
+ def __str__(self) -> str:
126
+ ...
127
+
128
+ def __repr__(self) -> str:
129
+ ...
130
+
131
+ def __eq__(self, other:typing.Any) -> bool:
132
+ ...
133
+
134
+ def __len__(self) -> int:
135
+ ...
136
+
137
+ def __getitem__(self, idx:int) -> Sample:
138
+ ...
139
+
140
+ def __iter__(self) -> SampleIter:
141
+ ...
142
+
143
+ @staticmethod
144
+ def from_array(samples:typing.Sequence[typing.Mapping[str, numpy.typing.NDArray[numpy.float64] | list]]) -> SampleSet:
145
+ r"""
146
+ Builds a SampleSet from a list of dictionaries, where each entry is interpreted as a sample.
147
+
148
+ Args
149
+ -----
150
+ - `samples`(`list[dict[str, list | numpy.ndarray]]`)
151
+ """
152
+ ...
153
+
154
+ @staticmethod
155
+ def concat(family:typing.Sequence[SampleSet]) -> SampleSet:
156
+ r"""
157
+ Creates a single SampleSet by concatenating a list of multiple SampleSets.
158
+
159
+ Args
160
+ -----
161
+ - `family` (`list[SampleSet]`)
162
+ """
163
+ ...
164
+
165
+ @staticmethod
166
+ def from_dict(dict:dict) -> SampleSet:
167
+ r"""
168
+ Converts a python dictionary into a SampleSet.
169
+
170
+ This is intended to be used primarily with dictionaries generated by
171
+ the `to_dict()` method. As such sparse value maps must be represented as
172
+ association lists.
173
+ """
174
+ ...
175
+
176
+ def to_dict(self) -> typing.Any:
177
+ r"""
178
+ Converts this SampleSet into a regular python dictionary.
179
+
180
+ Note that this dictionary has a slightly different structure to better support JSON
181
+ serialization of the output dictionary: sparse values are stored differently. Any mapping
182
+ with tuples as keys is transformed into an association list of key-value pairs,
183
+ that is, `[(k1, v1), (k2, v2), ...]`.
184
+ """
185
+ ...
186
+
187
+ def feasibles(self, epsilon = ...) -> SampleSet:
188
+ r"""
189
+ Returns a SampleSet containing only the feasible samples.
190
+
191
+ Args
192
+ -----
193
+ - `epsilon` (`float`, optional): Tolerance threshold for constraint violations. Defaults to $1e-8$.
194
+
195
+ Returns
196
+ --------
197
+ - `SampleSet`: a feasible subset of the current set.
198
+ """
199
+ ...
200
+
201
+ def separate(self) -> dict[str, SampleSet]:
202
+ r"""
203
+ Splits this `SampleSet` based on the `run_id` of the samples.
204
+
205
+ In other words, for each distinct `run_id` among the `Sample`s contained in this instance, a
206
+ new `SampleSet` is created to store all `Sample`s with that ID.
207
+
208
+ Returns
209
+ -----
210
+ - `sets` (dict[str, SampleSet]): The separated SampleSets. Keys are the run IDs.
211
+ """
212
+ ...
213
+
214
+ def lowest(self, epsilon = ...) -> list[Sample]:
215
+ r"""
216
+ Returns a list of the feasible samples which have the lowest objective value.
217
+ If there are no feasible solutions, this returns an empty list.
218
+
219
+ Args
220
+ -----
221
+ - `epsilon` (`float`, optional): Tolerance threshold. Objective values within this tolerance are included, even if not exactly the minimum value. Defaults to $1e-8$.
222
+
223
+ Returns
224
+ -----
225
+ `lowest_samples`: A list of Sample objects with the lowest ojective value in this SampleSet.
226
+ """
227
+ ...
228
+
229
+
230
+ class SolvingTime:
231
+ compiling_time: float
232
+ transpiling_time: float
233
+ preprocess_time: float
234
+ solving_time: float
235
+ decoding_time: float
236
+ postprocess_time: float
237
+ def __new__(cls,compiling_time = ...,transpiling_time = ...,preprocess_time = ...,solving_time = ...,decoding_time = ...,postprocess_time = ...): ...
238
+ def __str__(self) -> str:
239
+ ...
240
+
241
+ def __repr__(self) -> str:
242
+ ...
243
+
244
+ def total(self) -> float:
245
+ ...
246
+
247
+
248
+ class SparseVarValues:
249
+ name: str
250
+ values: dict[typing.Tuple[int, ...], float]
251
+ var_type: VarType
252
+ shape: tuple
253
+ def __new__(cls,name,values,shape,var_type = ...): ...
254
+ def __str__(self) -> str:
255
+ ...
256
+
257
+ def __repr__(self) -> str:
258
+ ...
259
+
260
+ @staticmethod
261
+ def from_array(name,array,var_type = ...) -> SparseVarValues:
262
+ ...
263
+
264
+ def to_dense(self) -> numpy.typing.NDArray[numpy.float64]:
265
+ ...
266
+
267
+
268
+ class SystemTime:
269
+ posting_time: typing.Optional[float]
270
+ request_queuing_time: typing.Optional[float]
271
+ fetching_problem_time: typing.Optional[float]
272
+ fetching_result_time: typing.Optional[float]
273
+ deserialize_time: typing.Optional[float]
274
+ def __new__(cls,posting_time = ...,request_queuing_time = ...,fetching_problem_time = ...,fetching_result_time = ...,deserialize_time = ...): ...
275
+ def __str__(self) -> str:
276
+ ...
277
+
278
+ def __repr__(self) -> str:
279
+ ...
280
+
281
+
282
+ class Violation:
283
+ name: str
284
+ total_violation: float
285
+ expr_values: dict[typing.Tuple[int, ...], float]
286
+ def __new__(cls,name:str, total_violation:float, expr_values:typing.Mapping[typing.Tuple[int, ...], float]): ...
287
+ def __str__(self) -> str:
288
+ ...
289
+
290
+ def __repr__(self) -> str:
291
+ ...
292
+
293
+
294
+ class VarType(Enum):
295
+ CONTINUOUS = auto()
296
+ INTEGER = auto()
297
+ BINARY = auto()
298
+
299
+ def from_old_sampleset(sampleset:typing.Any) -> SampleSet:
300
+ ...
301
+
jijmodeling/py.typed ADDED
File without changes
@@ -0,0 +1,14 @@
1
+ # `jijmodeling.jijmodeling` is a module corresponding to the shared library
2
+ # created by PyO3,
3
+ # and `jijmodeling.jijmodeling.range` is its submodule defined dynamically
4
+ # while the initialization of the shared library.
5
+ #
6
+ # This file defines a new sub-module `jijmodeling.range`,
7
+ # and exposes all the components in `jijmodeling.jijmodeling.range`
8
+ #
9
+
10
+ from .._jijmodeling import range as _range # type: ignore
11
+ import sys
12
+
13
+ for component in _range.__all__:
14
+ setattr(sys.modules[__name__], component, getattr(_range, component))
@@ -0,0 +1,55 @@
1
+ # This file is automatically generated by pyo3_stub_gen
2
+ # ruff: noqa: E501, F401
3
+
4
+ import typing
5
+ from . import size
6
+ from . import value
7
+
8
+ def at_least(bd:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
9
+ r"""
10
+ `at_least(lb)` returns a closed interval $[\mathtt{lb}, \infty)$; that is, $x \in \mathtt{at\_least(lb)} \iff x \geq \mathtt{lb}$.
11
+ """
12
+ ...
13
+
14
+ def at_most(bd:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
15
+ r"""
16
+ `at_most(ub)` returns a closed interval $(-\infty, \mathtt{ub}]$; that is, $x \in \mathtt{at\_most(ub)} \iff x \leq \mathtt{ub}$.
17
+ """
18
+ ...
19
+
20
+ def closed(lb:int | float,ub:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
21
+ r"""
22
+ `closed(lb, ub)` returns a closed interval $[\mathtt{lb}, \mathtt{ub}]$; that is, $x \in \mathtt{closed(lb, ub)} \iff \mathtt{lb} \leq x \leq \mathtt{ub}$
23
+ """
24
+ ...
25
+
26
+ def closed_open(lb:int | float,ub:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
27
+ r"""
28
+ `closed_open(lb, ub)` returns a upper half-open interval $[\mathtt{lb}, \mathtt{ub})$; that is, $x \in \mathtt{closed\_open(lb, ub)} \iff \mathtt{lb} \leq x < \mathtt{ub}$. For size range, it is same as the python's standard `range(lb, ub)` function.
29
+ """
30
+ ...
31
+
32
+ def greater_than(bd:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
33
+ r"""
34
+ `greater_than(lb)` returns an open interval $(\mathtt{lb}, \infty)$; that is, $x \in \mathtt{greater\_than(lb)} \iff x > \mathtt{lb}$.
35
+ """
36
+ ...
37
+
38
+ def less_than(bd:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
39
+ r"""
40
+ `less_than(ub)` returns an open interval $(-\infty, \mathtt{ub})$; that is, $x \in \mathtt{less\_than(ub)} \iff x < \mathtt{ub}$. For size range, it is same as the python's standard `range(ub)` function.
41
+ """
42
+ ...
43
+
44
+ def open(lb:int | float,ub:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
45
+ r"""
46
+ `open(lb, ub)` returns an open interval $(\mathtt{lb}, \mathtt{ub})$; that is, $x \in \mathtt{open(lb, ub)} \iff \mathtt{lb} < x < \mathtt{ub}$
47
+ """
48
+ ...
49
+
50
+ def open_closed(lb:int | float,ub:int | float) -> dict[str, dict[str, int] | typing.Literal['Unbounded']] | dict[str, dict[str, float] | typing.Literal['Unbounded']]:
51
+ r"""
52
+ `open_closed(lb, ub)` returns a lower half-open interval $(\mathtt{lb}, \mathtt{ub}]$; that is, $x \in \mathtt{open\_closed(lb, ub)} \iff \mathtt{lb} < x \leq \mathtt{ub}$.
53
+ """
54
+ ...
55
+
@@ -0,0 +1,14 @@
1
+ # `jijmodeling.jijmodeling` is a module corresponding to the shared library
2
+ # created by PyO3,
3
+ # and `jijmodeling.jijmodeling.range` is its submodule defined dynamically
4
+ # while the initialization of the shared library.
5
+ #
6
+ # This file defines a new sub-module `jijmodeling.range`,
7
+ # and exposes all the components in `jijmodeling.jijmodeling.range`
8
+ #
9
+
10
+ from . import size as _size # type: ignore
11
+ import sys
12
+
13
+ for component in _size.__all__: # type: ignore
14
+ setattr(sys.modules[__name__], component, getattr(_size, component))
@@ -0,0 +1,53 @@
1
+ # This file is automatically generated by pyo3_stub_gen
2
+ # ruff: noqa: E501, F401
3
+
4
+ import typing
5
+
6
+ def at_least(arg:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
7
+ r"""
8
+ `at_least(lb)` returns a closed interval $[\mathtt{lb}, \infty)$; that is, $x \in \mathtt{at\_least(lb)} \iff x \geq \mathtt{lb}$.
9
+ """
10
+ ...
11
+
12
+ def at_most(bd:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
13
+ r"""
14
+ `at_most(ub)` returns a closed interval $(-\infty, \mathtt{ub}]$; that is, $x \in \mathtt{at\_most(ub)} \iff x \leq \mathtt{ub}$.
15
+ """
16
+ ...
17
+
18
+ def closed(lb:int,ub:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
19
+ r"""
20
+ `closed(lb, ub)` returns a closed interval $[\mathtt{lb}, \mathtt{ub}]$; that is, $x \in \mathtt{closed(lb, ub)} \iff \mathtt{lb} \leq x \leq \mathtt{ub}$
21
+ """
22
+ ...
23
+
24
+ def closed_open(lb:int,ub:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
25
+ r"""
26
+ `closed_open(lb, ub)` returns a upper half-open interval $[\mathtt{lb}, \mathtt{ub})$; that is, $x \in \mathtt{closed\_open(lb, ub)} \iff \mathtt{lb} \leq x < \mathtt{ub}$. For size range, it is same as the python's standard `range(lb, ub)` function.
27
+ """
28
+ ...
29
+
30
+ def greater_than(arg:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
31
+ r"""
32
+ `greater_than(lb)` returns an open interval $(\mathtt{lb}, \infty)$; that is, $x \in \mathtt{greater\_than(lb)} \iff x > \mathtt{lb}$.
33
+ """
34
+ ...
35
+
36
+ def less_than(bd:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
37
+ r"""
38
+ `less_than(ub)` returns an open interval $(-\infty, \mathtt{ub})$; that is, $x \in \mathtt{less\_than(ub)} \iff x < \mathtt{ub}$. For size range, it is same as the python's standard `range(ub)` function.
39
+ """
40
+ ...
41
+
42
+ def open(lb:int,ub:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
43
+ r"""
44
+ `open(lb, ub)` returns an open interval $(\mathtt{lb}, \mathtt{ub})$; that is, $x \in \mathtt{open(lb, ub)} \iff \mathtt{lb} < x < \mathtt{ub}$
45
+ """
46
+ ...
47
+
48
+ def open_closed(lb:int,ub:int) -> dict[str, dict[str, int] | typing.Literal['Unbounded']]:
49
+ r"""
50
+ `open_closed(lb, ub)` returns a lower half-open interval $(\mathtt{lb}, \mathtt{ub}]$; that is, $x \in \mathtt{open\_closed(lb, ub)} \iff \mathtt{lb} < x \leq \mathtt{ub}$.
51
+ """
52
+ ...
53
+
@@ -0,0 +1,14 @@
1
+ # `jijmodeling.jijmodeling` is a module corresponding to the shared library
2
+ # created by PyO3,
3
+ # and `jijmodeling.jijmodeling.range` is its submodule defined dynamically
4
+ # while the initialization of the shared library.
5
+ #
6
+ # This file defines a new sub-module `jijmodeling.range`,
7
+ # and exposes all the components in `jijmodeling.jijmodeling.range`
8
+ #
9
+
10
+ from . import value as _value # type: ignore
11
+ import sys
12
+
13
+ for component in _value.__all__: # type: ignore
14
+ setattr(sys.modules[__name__], component, getattr(_value, component))
@@ -0,0 +1,53 @@
1
+ # This file is automatically generated by pyo3_stub_gen
2
+ # ruff: noqa: E501, F401
3
+
4
+ import typing
5
+
6
+ def at_least(arg:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
7
+ r"""
8
+ `at_least(lb)` returns a closed interval $[\mathtt{lb}, \infty)$; that is, $x \in \mathtt{at\_least(lb)} \iff x \geq \mathtt{lb}$.
9
+ """
10
+ ...
11
+
12
+ def at_most(bd:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
13
+ r"""
14
+ `at_most(ub)` returns a closed interval $(-\infty, \mathtt{ub}]$; that is, $x \in \mathtt{at\_most(ub)} \iff x \leq \mathtt{ub}$.
15
+ """
16
+ ...
17
+
18
+ def closed(lb:float,ub:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
19
+ r"""
20
+ `closed(lb, ub)` returns a closed interval $[\mathtt{lb}, \mathtt{ub}]$; that is, $x \in \mathtt{closed(lb, ub)} \iff \mathtt{lb} \leq x \leq \mathtt{ub}$
21
+ """
22
+ ...
23
+
24
+ def closed_open(lb:float,ub:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
25
+ r"""
26
+ `closed_open(lb, ub)` returns a upper half-open interval $[\mathtt{lb}, \mathtt{ub})$; that is, $x \in \mathtt{closed\_open(lb, ub)} \iff \mathtt{lb} \leq x < \mathtt{ub}$. For size range, it is same as the python's standard `range(lb, ub)` function.
27
+ """
28
+ ...
29
+
30
+ def greater_than(arg:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
31
+ r"""
32
+ `greater_than(lb)` returns an open interval $(\mathtt{lb}, \infty)$; that is, $x \in \mathtt{greater\_than(lb)} \iff x > \mathtt{lb}$.
33
+ """
34
+ ...
35
+
36
+ def less_than(bd:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
37
+ r"""
38
+ `less_than(ub)` returns an open interval $(-\infty, \mathtt{ub})$; that is, $x \in \mathtt{less\_than(ub)} \iff x < \mathtt{ub}$. For size range, it is same as the python's standard `range(ub)` function.
39
+ """
40
+ ...
41
+
42
+ def open(lb:float,ub:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
43
+ r"""
44
+ `open(lb, ub)` returns an open interval $(\mathtt{lb}, \mathtt{ub})$; that is, $x \in \mathtt{open(lb, ub)} \iff \mathtt{lb} < x < \mathtt{ub}$
45
+ """
46
+ ...
47
+
48
+ def open_closed(lb:float,ub:float) -> dict[str, dict[str, float] | typing.Literal['Unbounded']]:
49
+ r"""
50
+ `open_closed(lb, ub)` returns a lower half-open interval $(\mathtt{lb}, \mathtt{ub}]$; that is, $x \in \mathtt{open\_closed(lb, ub)} \iff \mathtt{lb} < x \leq \mathtt{ub}$.
51
+ """
52
+ ...
53
+