jijmodeling 2.0.0a7__cp38-abi3-manylinux_2_28_x86_64.whl → 2.0.0a8__cp38-abi3-manylinux_2_28_x86_64.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/__init__.pyi +253 -178
- jijmodeling/_jijmodeling.abi3.so +0 -0
- {jijmodeling-2.0.0a7.dist-info → jijmodeling-2.0.0a8.dist-info}/METADATA +1 -1
- jijmodeling-2.0.0a8.dist-info/RECORD +9 -0
- {jijmodeling-2.0.0a7.dist-info → jijmodeling-2.0.0a8.dist-info}/WHEEL +1 -1
- {jijmodeling-2.0.0a7.dist-info → jijmodeling-2.0.0a8.dist-info}/licenses/LICENSE.txt +3 -2
- jijmodeling-2.0.0a7.dist-info/RECORD +0 -9
jijmodeling/__init__.pyi
CHANGED
|
@@ -56,6 +56,7 @@ class Constraint:
|
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
"""
|
|
59
|
+
@property
|
|
59
60
|
def is_inequality(self) -> builtins.bool:
|
|
60
61
|
r"""
|
|
61
62
|
Returns true if the constraint is an inequality constraint.
|
|
@@ -224,8 +225,182 @@ class DecoratedProblem(typing.Protocol):
|
|
|
224
225
|
r"""
|
|
225
226
|
A variant of `Problem` that is only available in Decorator API provided by `Problem.compile`.
|
|
226
227
|
"""
|
|
228
|
+
@typing.overload
|
|
229
|
+
def Constraint(self, name:builtins.str, expressions:typing.Generator[Expression], description:typing.Optional[builtins.str]=None) -> Constraint:
|
|
230
|
+
r"""
|
|
231
|
+
Constructs `Constraint` object with comprehension syntax, __WITHOUT__ registering it to the problem.
|
|
232
|
+
Use `+=` operator to register the constraint to the problem.
|
|
233
|
+
"""
|
|
234
|
+
@typing.overload
|
|
235
|
+
def Constraint(self, name:builtins.str, expression:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], domain:typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], description:typing.Optional[builtins.str]=None) -> Constraint:
|
|
236
|
+
r"""
|
|
237
|
+
Constructs `Constraint` object from index set and function to build comparison expression from each index, __WITHOUT__ registering it to the problem.
|
|
238
|
+
Use `+=` operator to register the constraint to the problem.
|
|
239
|
+
"""
|
|
240
|
+
@typing.overload
|
|
241
|
+
def Constraint(self, name:builtins.str, expression:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], description:typing.Optional[builtins.str]=None) -> Constraint:
|
|
242
|
+
r"""
|
|
243
|
+
Constructs `Constraint` object from comparison expression, __WITHOUT__ registering it to the problem.
|
|
244
|
+
Use `+=` operator to register the constraint to the problem.
|
|
245
|
+
"""
|
|
227
246
|
def __iadd__(self, other:typing.Any) -> DecoratedProblem: ...
|
|
228
|
-
def
|
|
247
|
+
def used_placeholders(self) -> builtins.list[Placeholder]: ...
|
|
248
|
+
def get_problem_schema(self) -> dict:
|
|
249
|
+
r"""
|
|
250
|
+
Returns the schema of the problem.
|
|
251
|
+
|
|
252
|
+
Returns
|
|
253
|
+
--------
|
|
254
|
+
- `schema`: The dictionary containing the schema of the problem.
|
|
255
|
+
"""
|
|
256
|
+
def generate_random_dataset(self, _default:typing.Any, _options:typing.Any, _seed:typing.Optional[builtins.int]) -> typing.Any:
|
|
257
|
+
r"""
|
|
258
|
+
Generates a dictionary of random `InstanceDataValue` for a given problem.
|
|
259
|
+
To generate `ommx.v1.Instance` object directly, use `InstanceDataValue.generate_random_instance` instead.
|
|
260
|
+
|
|
261
|
+
Args
|
|
262
|
+
-----
|
|
263
|
+
- `options` (optional): a dictionary of range parameters for each separate placeholders. The key must be the name of the placeholder and the value must be range parameter (as described in "Range Parameters and Range Syntax" below).
|
|
264
|
+
- `default` (optional): default range parameters for placeholders which is not specified in `options`.
|
|
265
|
+
- `seed` (optional): seed for random number generation.
|
|
266
|
+
|
|
267
|
+
Returns
|
|
268
|
+
--------
|
|
269
|
+
`dict`: The dictionary from the name of placeholders to the generated `InstanceDataValue` objects. To be fed to `Interpreter.eval_problem`.
|
|
270
|
+
|
|
271
|
+
Range Parameters and Range Syntax
|
|
272
|
+
----------------------------------
|
|
273
|
+
A range parameter is a dictionary consisting of the following fields:
|
|
274
|
+
- `size` (optional): interval of natural numbers for the size of each array dimension (default: `range(1, 6)`)
|
|
275
|
+
- `value` (optional): interval of real numbers for the value of each array element (default: `range(-1.0, 1.0)` - a uniform distribution on a closed interval $[-1.0, 1.0]$).
|
|
276
|
+
|
|
277
|
+
Example range parameter config:
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
{"size": range(2, 10), "value": jm.range.value.closed(100.0, 200.0)}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Intervals are expressed as a range object.
|
|
284
|
+
Currently, the following syntax is supported for range objects:
|
|
285
|
+
|
|
286
|
+
1. Direct value of type `int` or `float` - it corresponds to a singleton interval $[a, a] = \{a\}$. In random generation context, this just means a constant fixed value.
|
|
287
|
+
2. Use the functions from `jijmodeling.range`, `jijmodeling.range.size`, or `jijmodeling.range.value` modules.
|
|
288
|
+
- Use functions from `jij.modeling.range.size` to specify (non-negative) integer intervals, and `jij.modeling.range.value` for real intervals. `jij.modeling.range` dynamically determines the type of the range based on the input.
|
|
289
|
+
- These three modules provides the following combinators (see the module documents for more details.):
|
|
290
|
+
- `closed(a, b)`: a closed interval $[a, b]$
|
|
291
|
+
- `open(a, b)`: an open interval $(a, b)$
|
|
292
|
+
- `closed_open(a, b)`: an upper half-open interval $[a, b)$
|
|
293
|
+
- `open_closed(a, b)`: a lower half-open interval $(a, b]$
|
|
294
|
+
- `greater_than(a)`: an open interval $(a, \infty)$
|
|
295
|
+
- `at_least(a)`: a closed interval $[a, \infty)$
|
|
296
|
+
- `less_than(a)`: an open interval $(-\infty, a)$
|
|
297
|
+
- `at_most(a)`: a closed interval $(-\infty, a]$
|
|
298
|
+
3. Use `range` builtin function: this is equivalent to `jijmodeling.range.value.closed_open(a, b)`.
|
|
299
|
+
- Any python range object with `step = 1` can be used as a size range; otherwise it results in runtime error.
|
|
300
|
+
4. Use a tuple: raw tuple `(a, b)` is equivalent to `jijmodeling.range.closed_open(a, b)` if `a` and `b` are either `int` or `float`.
|
|
301
|
+
- You can also use bound object as a tuple component; in such case, both tuple components must be one of the following:
|
|
302
|
+
|
|
303
|
+
1. A string `"Unbounded"` means $-\infty$ (in the first component) or $\infty$ (the second).
|
|
304
|
+
2. A dictionary `{"Included": a}` means the endpoint is inclusive.
|
|
305
|
+
3. A dictionary `{"Excluded": a}` means the endpoint is exclusive.
|
|
306
|
+
- Examples:
|
|
307
|
+
- `(1.2, 4)` is equivalent to `closed_open(1.2, 4)`,
|
|
308
|
+
- `(-1, {"Included": 1})` is equivalent to `closed(-1, 1)`,
|
|
309
|
+
- `(-5, {"Excluded": 4})` is equivalent to `closed_open(-5, 4)` and built in function `range(-5, 4)`,
|
|
310
|
+
- `({"Excluded": 1}, {"Excluded": 2.5})` is equivalent to `open(1, 2.5)`,
|
|
311
|
+
- `({"Included": -1}, "Unbounded")` is equivalent to `at_least(-1)`.
|
|
312
|
+
- `(5, "Unbounded")` is **INVALID**; `5` must be bound object.
|
|
313
|
+
5. The range object: A dictionary of form `{"start": lb, "end": ub}`, where both `lb` and `ub` are the bound object described as above.
|
|
314
|
+
|
|
315
|
+
Examples
|
|
316
|
+
---------
|
|
317
|
+
```python
|
|
318
|
+
>>> import jijmodeling as jm
|
|
319
|
+
>>> import builtins
|
|
320
|
+
>>> N = jm.Placeholder("N", dtype=jm.DataType.INTEGER)
|
|
321
|
+
>>> c = jm.Placeholder("c", dtype=jm.DataType.FLOAT, shape=(N,))
|
|
322
|
+
>>> x = jm.BinaryVar("x", shape=(N,))
|
|
323
|
+
>>> i = jm.Element("i", belong_to=N)
|
|
324
|
+
|
|
325
|
+
>>> problem = jm.Problem("problem")
|
|
326
|
+
>>> problem += jm.sum(i, c[i] * x[i])
|
|
327
|
+
|
|
328
|
+
>>> inputs = problem.generate_random_dataset(
|
|
329
|
+
... options={
|
|
330
|
+
... 'N': {"value": builtins.range(10, 20)},
|
|
331
|
+
... 'c': {"value": jm.range.value.closed(-1.0, 1.0)}
|
|
332
|
+
... # You can also specify "size" for the range of jagged array dimension size.
|
|
333
|
+
... },
|
|
334
|
+
... seed=123 # omittable
|
|
335
|
+
... )
|
|
336
|
+
>>> assert set(inputs.keys()) == {"N", "c"}
|
|
337
|
+
>>> inputs
|
|
338
|
+
{'N': 11.0, 'c': array([ 0.93914459, -0.06511935, -0.7460324 , -0.32443706, 0.99981451,
|
|
339
|
+
-0.24407535, 0.31329469, 0.52206453, -0.1291936 , 0.30443087,
|
|
340
|
+
0.53125838])}
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
"""
|
|
344
|
+
def generate_random_instance(self, _default:typing.Any, _options:typing.Any, _seed:typing.Optional[builtins.int], _hints:typing.Optional[typing.Any]) -> typing.Any:
|
|
345
|
+
r"""
|
|
346
|
+
Generates random `ommx.v1.Instance` for a given problem.
|
|
347
|
+
See also `InstanceDataValue.generate_random_dataset`.
|
|
348
|
+
|
|
349
|
+
Args
|
|
350
|
+
-----
|
|
351
|
+
- `options` (optional): a dictionary of range parameters for each separate placeholders. The key must be the name of the placeholder and the value must be range parameter (as described in "Range Parameters and Range Syntax" section in :func:`~jijmodeling.Problem.generate_random_dataset`).
|
|
352
|
+
- `default` (optional): default range parameters for placeholders which is not specified in `options`.
|
|
353
|
+
- `seed` (optional): seed for random number generation.
|
|
354
|
+
- `hints` (optional): the hints to be detected during compilation see `Interpreter.eval_problem` for more details.
|
|
355
|
+
|
|
356
|
+
Returns
|
|
357
|
+
--------
|
|
358
|
+
`instance`: The OMMX v1 instance object.
|
|
359
|
+
|
|
360
|
+
Examples
|
|
361
|
+
---------
|
|
362
|
+
```python
|
|
363
|
+
>>> import jijmodeling as jm
|
|
364
|
+
>>> import builtins
|
|
365
|
+
>>> import ommx.v1
|
|
366
|
+
>>> N = jm.Placeholder("N", dtype=jm.DataType.INTEGER)
|
|
367
|
+
>>> c = jm.Placeholder("c", dtype=jm.DataType.FLOAT, shape=(N,))
|
|
368
|
+
>>> x = jm.BinaryVar("x", shape=(N,))
|
|
369
|
+
>>> i = jm.Element("i", belong_to=N)
|
|
370
|
+
|
|
371
|
+
>>> problem = jm.Problem("problem")
|
|
372
|
+
>>> problem += jm.sum(i, c[i] * x[i])
|
|
373
|
+
|
|
374
|
+
>>> instance = problem.generate_random_instance(
|
|
375
|
+
... options={
|
|
376
|
+
... 'N': {"value": builtins.range(10, 20)},
|
|
377
|
+
... 'c': {"value": jm.range.value.closed(-1.0, 1.0)}
|
|
378
|
+
... },
|
|
379
|
+
... seed=123
|
|
380
|
+
... )
|
|
381
|
+
>>> assert type(instance) is ommx.v1.Instance
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
"""
|
|
385
|
+
def type_of(self, name:builtins.str) -> Type: ...
|
|
386
|
+
def infer(self, expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Type: ...
|
|
387
|
+
def decision_vars(self) -> builtins.dict[builtins.str, DecisionVar]:
|
|
388
|
+
r"""
|
|
389
|
+
Returns a dictionary of decision variables in the problem.
|
|
390
|
+
|
|
391
|
+
Returns
|
|
392
|
+
--------
|
|
393
|
+
`dict[str, DecisionVar]`: Dictionary mapping variable names to DecisionVar objects.
|
|
394
|
+
"""
|
|
395
|
+
def placeholders(self) -> builtins.dict[builtins.str, Placeholder]:
|
|
396
|
+
r"""
|
|
397
|
+
Returns a dictionary of placeholders in the problem.
|
|
398
|
+
|
|
399
|
+
Returns
|
|
400
|
+
--------
|
|
401
|
+
`dict[str, Placeholder]`: Dictionary mapping placeholder names to Placeholder objects.
|
|
402
|
+
"""
|
|
403
|
+
def Placeholder(self, name:typing.Optional[builtins.str]=None, *, ndim:typing.Optional[builtins.int]=None, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, dtype:DataType | type | tuple=DataType.FLOAT, jagged:builtins.bool=False, latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> Placeholder: ...
|
|
229
404
|
def Integer(self, name:typing.Optional[builtins.str]=None, *, ndim:typing.Optional[builtins.int]=None, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, jagged:builtins.bool=False, latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> Placeholder:
|
|
230
405
|
r"""
|
|
231
406
|
A shorthand for `Problem.Placeholder(dtype=int)`
|
|
@@ -439,151 +614,6 @@ class DecoratedProblem(typing.Protocol):
|
|
|
439
614
|
```
|
|
440
615
|
"""
|
|
441
616
|
def SemiContinuousVar(self, name:typing.Optional[builtins.str]=None, *, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, lower_bound:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any] | typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]], upper_bound:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any] | typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]], latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> DecisionVar: ...
|
|
442
|
-
def Constraint(self, name:builtins.str, expression:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], *, description:typing.Optional[builtins.str]=None) -> Constraint:
|
|
443
|
-
r"""
|
|
444
|
-
Constructs `Constraint` object, __WITHOUT__ registering it to the problem.
|
|
445
|
-
Use `+=` operator to register the constraint to the problem.
|
|
446
|
-
"""
|
|
447
|
-
def used_placeholders(self) -> builtins.list[Placeholder]: ...
|
|
448
|
-
def get_problem_schema(self) -> dict:
|
|
449
|
-
r"""
|
|
450
|
-
Returns the schema of the problem.
|
|
451
|
-
|
|
452
|
-
Returns
|
|
453
|
-
--------
|
|
454
|
-
- `schema`: The dictionary containing the schema of the problem.
|
|
455
|
-
"""
|
|
456
|
-
def generate_random_dataset(self, _default:typing.Any, _options:typing.Any, _seed:typing.Optional[builtins.int]) -> typing.Any:
|
|
457
|
-
r"""
|
|
458
|
-
Generates a dictionary of random `InstanceDataValue` for a given problem.
|
|
459
|
-
To generate `ommx.v1.Instance` object directly, use `InstanceDataValue.generate_random_instance` instead.
|
|
460
|
-
|
|
461
|
-
Args
|
|
462
|
-
-----
|
|
463
|
-
- `options` (optional): a dictionary of range parameters for each separate placeholders. The key must be the name of the placeholder and the value must be range parameter (as described in "Range Parameters and Range Syntax" below).
|
|
464
|
-
- `default` (optional): default range parameters for placeholders which is not specified in `options`.
|
|
465
|
-
- `seed` (optional): seed for random number generation.
|
|
466
|
-
|
|
467
|
-
Returns
|
|
468
|
-
--------
|
|
469
|
-
`dict`: The dictionary from the name of placeholders to the generated `InstanceDataValue` objects. To be fed to `Interpreter.eval_problem`.
|
|
470
|
-
|
|
471
|
-
Range Parameters and Range Syntax
|
|
472
|
-
----------------------------------
|
|
473
|
-
A range parameter is a dictionary consisting of the following fields:
|
|
474
|
-
- `size` (optional): interval of natural numbers for the size of each array dimension (default: `range(1, 6)`)
|
|
475
|
-
- `value` (optional): interval of real numbers for the value of each array element (default: `range(-1.0, 1.0)` - a uniform distribution on a closed interval $[-1.0, 1.0]$).
|
|
476
|
-
|
|
477
|
-
Example range parameter config:
|
|
478
|
-
|
|
479
|
-
```python
|
|
480
|
-
{"size": range(2, 10), "value": jm.range.value.closed(100.0, 200.0)}
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
Intervals are expressed as a range object.
|
|
484
|
-
Currently, the following syntax is supported for range objects:
|
|
485
|
-
|
|
486
|
-
1. Direct value of type `int` or `float` - it corresponds to a singleton interval $[a, a] = \{a\}$. In random generation context, this just means a constant fixed value.
|
|
487
|
-
2. Use the functions from `jijmodeling.range`, `jijmodeling.range.size`, or `jijmodeling.range.value` modules.
|
|
488
|
-
- Use functions from `jij.modeling.range.size` to specify (non-negative) integer intervals, and `jij.modeling.range.value` for real intervals. `jij.modeling.range` dynamically determines the type of the range based on the input.
|
|
489
|
-
- These three modules provides the following combinators (see the module documents for more details.):
|
|
490
|
-
- `closed(a, b)`: a closed interval $[a, b]$
|
|
491
|
-
- `open(a, b)`: an open interval $(a, b)$
|
|
492
|
-
- `closed_open(a, b)`: an upper half-open interval $[a, b)$
|
|
493
|
-
- `open_closed(a, b)`: a lower half-open interval $(a, b]$
|
|
494
|
-
- `greater_than(a)`: an open interval $(a, \infty)$
|
|
495
|
-
- `at_least(a)`: a closed interval $[a, \infty)$
|
|
496
|
-
- `less_than(a)`: an open interval $(-\infty, a)$
|
|
497
|
-
- `at_most(a)`: a closed interval $(-\infty, a]$
|
|
498
|
-
3. Use `range` builtin function: this is equivalent to `jijmodeling.range.value.closed_open(a, b)`.
|
|
499
|
-
- Any python range object with `step = 1` can be used as a size range; otherwise it results in runtime error.
|
|
500
|
-
4. Use a tuple: raw tuple `(a, b)` is equivalent to `jijmodeling.range.closed_open(a, b)` if `a` and `b` are either `int` or `float`.
|
|
501
|
-
- You can also use bound object as a tuple component; in such case, both tuple components must be one of the following:
|
|
502
|
-
|
|
503
|
-
1. A string `"Unbounded"` means $-\infty$ (in the first component) or $\infty$ (the second).
|
|
504
|
-
2. A dictionary `{"Included": a}` means the endpoint is inclusive.
|
|
505
|
-
3. A dictionary `{"Excluded": a}` means the endpoint is exclusive.
|
|
506
|
-
- Examples:
|
|
507
|
-
- `(1.2, 4)` is equivalent to `closed_open(1.2, 4)`,
|
|
508
|
-
- `(-1, {"Included": 1})` is equivalent to `closed(-1, 1)`,
|
|
509
|
-
- `(-5, {"Excluded": 4})` is equivalent to `closed_open(-5, 4)` and built in function `range(-5, 4)`,
|
|
510
|
-
- `({"Excluded": 1}, {"Excluded": 2.5})` is equivalent to `open(1, 2.5)`,
|
|
511
|
-
- `({"Included": -1}, "Unbounded")` is equivalent to `at_least(-1)`.
|
|
512
|
-
- `(5, "Unbounded")` is **INVALID**; `5` must be bound object.
|
|
513
|
-
5. The range object: A dictionary of form `{"start": lb, "end": ub}`, where both `lb` and `ub` are the bound object described as above.
|
|
514
|
-
|
|
515
|
-
Examples
|
|
516
|
-
---------
|
|
517
|
-
```python
|
|
518
|
-
>>> import jijmodeling as jm
|
|
519
|
-
>>> import builtins
|
|
520
|
-
>>> N = jm.Placeholder("N", dtype=jm.DataType.INTEGER)
|
|
521
|
-
>>> c = jm.Placeholder("c", dtype=jm.DataType.FLOAT, shape=(N,))
|
|
522
|
-
>>> x = jm.BinaryVar("x", shape=(N,))
|
|
523
|
-
>>> i = jm.Element("i", belong_to=N)
|
|
524
|
-
|
|
525
|
-
>>> problem = jm.Problem("problem")
|
|
526
|
-
>>> problem += jm.sum(i, c[i] * x[i])
|
|
527
|
-
|
|
528
|
-
>>> inputs = problem.generate_random_dataset(
|
|
529
|
-
... options={
|
|
530
|
-
... 'N': {"value": builtins.range(10, 20)},
|
|
531
|
-
... 'c': {"value": jm.range.value.closed(-1.0, 1.0)}
|
|
532
|
-
... # You can also specify "size" for the range of jagged array dimension size.
|
|
533
|
-
... },
|
|
534
|
-
... seed=123 # omittable
|
|
535
|
-
... )
|
|
536
|
-
>>> assert set(inputs.keys()) == {"N", "c"}
|
|
537
|
-
>>> inputs
|
|
538
|
-
{'N': 11.0, 'c': array([ 0.93914459, -0.06511935, -0.7460324 , -0.32443706, 0.99981451,
|
|
539
|
-
-0.24407535, 0.31329469, 0.52206453, -0.1291936 , 0.30443087,
|
|
540
|
-
0.53125838])}
|
|
541
|
-
|
|
542
|
-
```
|
|
543
|
-
"""
|
|
544
|
-
def generate_random_instance(self, _default:typing.Any, _options:typing.Any, _seed:typing.Optional[builtins.int], _hints:typing.Optional[typing.Any]) -> typing.Any:
|
|
545
|
-
r"""
|
|
546
|
-
Generates random `ommx.v1.Instance` for a given problem.
|
|
547
|
-
See also `InstanceDataValue.generate_random_dataset`.
|
|
548
|
-
|
|
549
|
-
Args
|
|
550
|
-
-----
|
|
551
|
-
- `options` (optional): a dictionary of range parameters for each separate placeholders. The key must be the name of the placeholder and the value must be range parameter (as described in "Range Parameters and Range Syntax" section in :func:`~jijmodeling.Problem.generate_random_dataset`).
|
|
552
|
-
- `default` (optional): default range parameters for placeholders which is not specified in `options`.
|
|
553
|
-
- `seed` (optional): seed for random number generation.
|
|
554
|
-
- `hints` (optional): the hints to be detected during compilation see `Interpreter.eval_problem` for more details.
|
|
555
|
-
|
|
556
|
-
Returns
|
|
557
|
-
--------
|
|
558
|
-
`instance`: The OMMX v1 instance object.
|
|
559
|
-
|
|
560
|
-
Examples
|
|
561
|
-
---------
|
|
562
|
-
```python
|
|
563
|
-
>>> import jijmodeling as jm
|
|
564
|
-
>>> import builtins
|
|
565
|
-
>>> import ommx.v1
|
|
566
|
-
>>> N = jm.Placeholder("N", dtype=jm.DataType.INTEGER)
|
|
567
|
-
>>> c = jm.Placeholder("c", dtype=jm.DataType.FLOAT, shape=(N,))
|
|
568
|
-
>>> x = jm.BinaryVar("x", shape=(N,))
|
|
569
|
-
>>> i = jm.Element("i", belong_to=N)
|
|
570
|
-
|
|
571
|
-
>>> problem = jm.Problem("problem")
|
|
572
|
-
>>> problem += jm.sum(i, c[i] * x[i])
|
|
573
|
-
|
|
574
|
-
>>> instance = problem.generate_random_instance(
|
|
575
|
-
... options={
|
|
576
|
-
... 'N': {"value": builtins.range(10, 20)},
|
|
577
|
-
... 'c': {"value": jm.range.value.closed(-1.0, 1.0)}
|
|
578
|
-
... },
|
|
579
|
-
... seed=123
|
|
580
|
-
... )
|
|
581
|
-
>>> assert type(instance) is ommx.v1.Instance
|
|
582
|
-
|
|
583
|
-
```
|
|
584
|
-
"""
|
|
585
|
-
def type_of(self, name:builtins.str) -> Type: ...
|
|
586
|
-
def infer(self, expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Type: ...
|
|
587
617
|
|
|
588
618
|
class DesugaredProblemBuilder:
|
|
589
619
|
def __call__(self) -> None: ...
|
|
@@ -659,7 +689,7 @@ class Namespace:
|
|
|
659
689
|
@staticmethod
|
|
660
690
|
def from_problem(problem:Problem) -> Namespace: ...
|
|
661
691
|
def add_placeholder(self, placeholder:Placeholder) -> None: ...
|
|
662
|
-
def Placeholder(self, name:builtins.str, *, ndim:typing.Optional[builtins.int]=None, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, dtype:DataType | type=DataType.FLOAT, jagged:builtins.bool=False, latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> Placeholder: ...
|
|
692
|
+
def Placeholder(self, name:builtins.str, *, ndim:typing.Optional[builtins.int]=None, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, dtype:DataType | type | tuple=DataType.FLOAT, jagged:builtins.bool=False, latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> Placeholder: ...
|
|
663
693
|
def add_decision_var(self, var:DecisionVar) -> None: ...
|
|
664
694
|
def type_of(self, name:builtins.str) -> Type: ...
|
|
665
695
|
def infer(self, expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Type: ...
|
|
@@ -729,6 +759,20 @@ class Placeholder:
|
|
|
729
759
|
Placeholder(name='a', ndim=2, shape=None, dtype=typing.float, jagged=False)
|
|
730
760
|
```
|
|
731
761
|
"""
|
|
762
|
+
@property
|
|
763
|
+
def name(self) -> builtins.str: ...
|
|
764
|
+
@property
|
|
765
|
+
def ndim(self) -> builtins.int: ...
|
|
766
|
+
@property
|
|
767
|
+
def shape(self) -> typing.Optional[builtins.list[Expression]]: ...
|
|
768
|
+
@property
|
|
769
|
+
def dtype(self) -> DataType | type | tuple: ...
|
|
770
|
+
@property
|
|
771
|
+
def jagged(self) -> builtins.bool: ...
|
|
772
|
+
@property
|
|
773
|
+
def description(self) -> typing.Optional[builtins.str]: ...
|
|
774
|
+
@property
|
|
775
|
+
def custom_latex(self) -> typing.Optional[builtins.str]: ...
|
|
732
776
|
def __repr__(self) -> builtins.str: ...
|
|
733
777
|
def len_at(self, index:builtins.int) -> Expression: ...
|
|
734
778
|
def __pow__(self, exponent:typing.Any, modulo:typing.Optional[typing.Any]=None) -> Expression: ...
|
|
@@ -813,7 +857,7 @@ class Problem:
|
|
|
813
857
|
def __iadd__(self, other:typing.Any) -> Problem: ...
|
|
814
858
|
def __repr__(self) -> builtins.str: ...
|
|
815
859
|
def eval(self, instance_data:dict) -> ommx.v1.Instance: ...
|
|
816
|
-
def Placeholder(self, name:builtins.str, *, ndim:typing.Optional[builtins.int]=None, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, dtype:DataType | type=DataType.FLOAT, jagged:builtins.bool=False, latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> Placeholder: ...
|
|
860
|
+
def Placeholder(self, name:builtins.str, *, ndim:typing.Optional[builtins.int]=None, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, dtype:DataType | type | tuple=DataType.FLOAT, jagged:builtins.bool=False, latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> Placeholder: ...
|
|
817
861
|
def Integer(self, name:builtins.str, *, ndim:typing.Optional[builtins.int]=None, shape:typing.Optional[typing.Sequence[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]]=None, jagged:builtins.bool=False, latex:typing.Optional[builtins.str]=None, description:typing.Optional[builtins.str]=None) -> Placeholder:
|
|
818
862
|
r"""
|
|
819
863
|
A shorthand for `Problem.Placeholder(dtype=int)`
|
|
@@ -1059,12 +1103,6 @@ class Problem:
|
|
|
1059
1103
|
>>> instance = problem.eval(instance_data)
|
|
1060
1104
|
```
|
|
1061
1105
|
"""
|
|
1062
|
-
def __new__(cls, name:builtins.str, *, sense:ProblemSense=ProblemSense.MINIMIZE) -> Problem: ...
|
|
1063
|
-
def Constraint(self, name:builtins.str, expression:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], *, description:typing.Optional[builtins.str]=None) -> Constraint:
|
|
1064
|
-
r"""
|
|
1065
|
-
Constructs `Constraint` object, __WITHOUT__ registering it to the problem.
|
|
1066
|
-
Use `+=` operator to register the constraint to the problem.
|
|
1067
|
-
"""
|
|
1068
1106
|
def used_placeholders(self) -> builtins.list[Placeholder]: ...
|
|
1069
1107
|
def get_problem_schema(self) -> dict:
|
|
1070
1108
|
r"""
|
|
@@ -1205,6 +1243,38 @@ class Problem:
|
|
|
1205
1243
|
"""
|
|
1206
1244
|
def type_of(self, name:builtins.str) -> Type: ...
|
|
1207
1245
|
def infer(self, expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Type: ...
|
|
1246
|
+
def decision_vars(self) -> builtins.dict[builtins.str, DecisionVar]:
|
|
1247
|
+
r"""
|
|
1248
|
+
Returns a dictionary of decision variables in the problem.
|
|
1249
|
+
The dictionary may contain decision variables that are not used in the problem.
|
|
1250
|
+
|
|
1251
|
+
Returns
|
|
1252
|
+
--------
|
|
1253
|
+
`dict[str, DecisionVar]`: Dictionary mapping variable names to DecisionVar objects.
|
|
1254
|
+
"""
|
|
1255
|
+
def placeholders(self) -> builtins.dict[builtins.str, Placeholder]:
|
|
1256
|
+
r"""
|
|
1257
|
+
Returns a dictionary of placeholders in the problem.
|
|
1258
|
+
The dictionary may contain placeholders that are not used in the problem;
|
|
1259
|
+
to get only used placeholders, use `used_placeholders` method.
|
|
1260
|
+
|
|
1261
|
+
Returns
|
|
1262
|
+
--------
|
|
1263
|
+
`dict[str, Placeholder]`: Dictionary mapping placeholder names to Placeholder objects.
|
|
1264
|
+
"""
|
|
1265
|
+
@typing.overload
|
|
1266
|
+
def Constraint(self, name:builtins.str, expression:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], domain:typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], description:typing.Optional[builtins.str]=None) -> Constraint:
|
|
1267
|
+
r"""
|
|
1268
|
+
Constructs `Constraint` object from index set and function to build comparison expression from each index, __WITHOUT__ registering it to the problem.
|
|
1269
|
+
Use `+=` operator to register the constraint to the problem.
|
|
1270
|
+
"""
|
|
1271
|
+
@typing.overload
|
|
1272
|
+
def Constraint(self, name:builtins.str, expression:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], description:typing.Optional[builtins.str]=None) -> Constraint:
|
|
1273
|
+
r"""
|
|
1274
|
+
Constructs `Constraint` object from comparison expression, __WITHOUT__ registering it to the problem.
|
|
1275
|
+
Use `+=` operator to register the constraint to the problem.
|
|
1276
|
+
"""
|
|
1277
|
+
def __new__(cls, name:builtins.str, *, sense:ProblemSense=ProblemSense.MINIMIZE) -> Problem: ...
|
|
1208
1278
|
|
|
1209
1279
|
class Type:
|
|
1210
1280
|
...
|
|
@@ -1215,25 +1285,10 @@ class ConstraintSense(Enum):
|
|
|
1215
1285
|
GREATER_THAN_EQUAL = ...
|
|
1216
1286
|
|
|
1217
1287
|
class DataType(Enum):
|
|
1218
|
-
r"""
|
|
1219
|
-
A datatype for JijModeling expressions
|
|
1220
|
-
"""
|
|
1221
1288
|
INTEGER = ...
|
|
1222
|
-
r"""
|
|
1223
|
-
INTEGER
|
|
1224
|
-
"""
|
|
1225
1289
|
FLOAT = ...
|
|
1226
|
-
r"""
|
|
1227
|
-
FLOAT
|
|
1228
|
-
"""
|
|
1229
1290
|
BINARY = ...
|
|
1230
|
-
r"""
|
|
1231
|
-
BINARY
|
|
1232
|
-
"""
|
|
1233
1291
|
NATURAL = ...
|
|
1234
|
-
r"""
|
|
1235
|
-
NATURAL
|
|
1236
|
-
"""
|
|
1237
1292
|
|
|
1238
1293
|
class DecisionVarKind(Enum):
|
|
1239
1294
|
BINARY = ...
|
|
@@ -1300,18 +1355,34 @@ def min(lhs:Expression | builtins.int | builtins.float | DecisionVar | Placehold
|
|
|
1300
1355
|
def neg(expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression: ...
|
|
1301
1356
|
|
|
1302
1357
|
@typing.overload
|
|
1303
|
-
def prod(
|
|
1358
|
+
def prod(index:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], operand:typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression:
|
|
1304
1359
|
r"""
|
|
1305
|
-
|
|
1360
|
+
Takes an index and an operand representing the product operation in positional style. Eg. `jm.prod(N, lambda i: x[i])`
|
|
1306
1361
|
"""
|
|
1307
1362
|
|
|
1308
1363
|
@typing.overload
|
|
1309
|
-
def prod(operand:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], axis:typing.Optional[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]
|
|
1364
|
+
def prod(operand:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], axis:typing.Optional[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]=None) -> Expression:
|
|
1365
|
+
r"""
|
|
1366
|
+
Takes the product of a set or tensor-like expression. You can use `axis` to partially reducing the tensor along specified axes. Eg. `jm.prod(N.map(lambda i: x[i]))`
|
|
1367
|
+
"""
|
|
1368
|
+
|
|
1369
|
+
@typing.overload
|
|
1370
|
+
def prod(x:typing.Generator[Expression]) -> Expression:
|
|
1371
|
+
r"""
|
|
1372
|
+
Comprehension syntax for jm.prod (NOTE: only works with decorated API!)
|
|
1373
|
+
"""
|
|
1374
|
+
|
|
1375
|
+
def product(*sets) -> Expression:
|
|
1376
|
+
r"""
|
|
1377
|
+
Takes the cartesian product of given set-like expressions.
|
|
1378
|
+
"""
|
|
1310
1379
|
|
|
1311
1380
|
def roll(operand:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], shift:typing.Any, *, axis:typing.Optional[builtins.int]=None) -> Expression: ...
|
|
1312
1381
|
|
|
1313
1382
|
def rows(array:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression: ...
|
|
1314
1383
|
|
|
1384
|
+
def set(operand:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression: ...
|
|
1385
|
+
|
|
1315
1386
|
def sin(expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression: ...
|
|
1316
1387
|
|
|
1317
1388
|
def sinh(expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression: ...
|
|
@@ -1319,17 +1390,21 @@ def sinh(expr:Expression | builtins.int | builtins.float | DecisionVar | Placeho
|
|
|
1319
1390
|
def sqrt(expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression: ...
|
|
1320
1391
|
|
|
1321
1392
|
@typing.overload
|
|
1322
|
-
def sum(
|
|
1393
|
+
def sum(index:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], operand:typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression:
|
|
1323
1394
|
r"""
|
|
1324
|
-
|
|
1395
|
+
Takes an index and an operand representing the summation operation in positional style. Eg. `jm.sum(N, lambda i: x[i])`
|
|
1325
1396
|
"""
|
|
1326
1397
|
|
|
1327
1398
|
@typing.overload
|
|
1328
|
-
def sum(operand:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], axis:typing.Optional[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]
|
|
1399
|
+
def sum(operand:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any], axis:typing.Optional[Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]]=None) -> Expression:
|
|
1329
1400
|
r"""
|
|
1330
|
-
Takes
|
|
1331
|
-
|
|
1332
|
-
|
|
1401
|
+
Takes the summation of set or tensor-like expression. You can use `axis` to partially reducing the tensor along specified axes. Eg. `jm.sum(N.map(lambda i: x[i]))`
|
|
1402
|
+
"""
|
|
1403
|
+
|
|
1404
|
+
@typing.overload
|
|
1405
|
+
def sum(x:typing.Generator[Expression]) -> Expression:
|
|
1406
|
+
r"""
|
|
1407
|
+
Comprehension syntax for jm.sum (NOTE: only works with decorated API!)
|
|
1333
1408
|
"""
|
|
1334
1409
|
|
|
1335
1410
|
def tan(expr:Expression | builtins.int | builtins.float | DecisionVar | Placeholder | list | tuple | typing.Callable[[Expression], typing.Any] | typing.Callable[[Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression], typing.Any] | typing.Callable[[Expression, Expression, Expression, Expression, Expression], typing.Any]) -> Expression: ...
|
jijmodeling/_jijmodeling.abi3.so
CHANGED
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
jijmodeling-2.0.0a8.dist-info/METADATA,sha256=3WEnd6KxSHmDdNoKBr8-h07nEo8BVG1erSdySmdXyAc,2479
|
|
2
|
+
jijmodeling-2.0.0a8.dist-info/WHEEL,sha256=CcwTYEXriNmgnpFVx3-4e5bv8abon1josawMkdrwnKI,106
|
|
3
|
+
jijmodeling-2.0.0a8.dist-info/licenses/LICENSE.txt,sha256=UDoDtHuEfRayMGh1HKVD3OR4lXFmXC4ifF2hQvwwj3w,3449
|
|
4
|
+
jijmodeling/__init__.py,sha256=43DV_WzDxS0n6FseNyfJZ6oQucO31T4qqbz3bx9JMtE,44
|
|
5
|
+
jijmodeling/__init__.pyi,sha256=4wOlffYUien9FafFQi2bHqvGT3uLkmS-93QsckYTNRI,148254
|
|
6
|
+
jijmodeling/_jijmodeling.abi3.so,sha256=y8mCZzUfPpHd6WYxD-2JCDyA5QMgzekJoqHlBq4xJgI,10318920
|
|
7
|
+
jijmodeling/_jijmodeling.pyi,sha256=9towCfPT8yTmJxvncDdME7ZCeFSSntPxAd_TT_spuXQ,162
|
|
8
|
+
jijmodeling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
jijmodeling-2.0.0a8.dist-info/RECORD,,
|
|
@@ -10,7 +10,7 @@ For these Terms and Conditions:
|
|
|
10
10
|
|
|
11
11
|
(a) "JijZept Service" means a cloud service for optimization calculation infrastructure provided by Jij Inc.
|
|
12
12
|
(b) "JijZept SDK" represents a set of software tools including "JijZept-Client" and "JijModeling" for developing programs that access the JijZept Services. This term includes sample programs provided by us.
|
|
13
|
-
(c) Company (referred to as either "the Company", "We", "Us" or "Our" in this Agreement) refers to Jij Inc.,
|
|
13
|
+
(c) Company (referred to as either "the Company", "We", "Us" or "Our" in this Agreement) refers to Jij Inc., #403, CIC, 3-3-6 Shibaura, Minato-ku, Tokyo, 108-0023.
|
|
14
14
|
(d) "Access Token" means a token necessary for connecting to the JijZept service.
|
|
15
15
|
|
|
16
16
|
2. Acknowledgment
|
|
@@ -43,4 +43,5 @@ You must enter into a separate JijZept service agreement to access the JijZept S
|
|
|
43
43
|
(b) The Company shall not be liable for any failure of the Software to operate when the User uses or uses the Software for the User's customer by incorporating or linking it with the User-provided Software.
|
|
44
44
|
(c) The User shall be responsible for confirming and examining the suitability of the relevant foreign laws and regulations applicable to the use of the Software. The Company shall not be liable for any legal liabilities related to the appropriate foreign laws and regulations.
|
|
45
45
|
|
|
46
|
-
Enacted 1 July 2021.
|
|
46
|
+
Enacted 1 July 2021.
|
|
47
|
+
Updated address on 23 July 2025.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
jijmodeling-2.0.0a7.dist-info/METADATA,sha256=xZC3whFpGaEXEnZdDY9XgJb-nd8RdpMVEk4bl6peCLk,2479
|
|
2
|
-
jijmodeling-2.0.0a7.dist-info/WHEEL,sha256=6-tNoeFxRxr3F-p67uTaSr43bvl0GT_fvzF1nDn64sQ,106
|
|
3
|
-
jijmodeling-2.0.0a7.dist-info/licenses/LICENSE.txt,sha256=T5HdEbP5NWG8fZbvF9pofeteW3HrS30V3_LvtPUHFYM,3400
|
|
4
|
-
jijmodeling/__init__.py,sha256=43DV_WzDxS0n6FseNyfJZ6oQucO31T4qqbz3bx9JMtE,44
|
|
5
|
-
jijmodeling/__init__.pyi,sha256=tIpQi5yETLtj1ENwGc5IYC7MdpMInHF12czxzWwAtUs,141965
|
|
6
|
-
jijmodeling/_jijmodeling.abi3.so,sha256=u5Qk6dX-Zu6GUs9dMzQpH-hE7jjXRbfFShJAEeSy45w,10130320
|
|
7
|
-
jijmodeling/_jijmodeling.pyi,sha256=9towCfPT8yTmJxvncDdME7ZCeFSSntPxAd_TT_spuXQ,162
|
|
8
|
-
jijmodeling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
jijmodeling-2.0.0a7.dist-info/RECORD,,
|