Skip to content

Placeholder

Placeholder

Bases: _variable.Variable

Placeholder variable.

Variables for pouring in data when converting to QUBO or to MIP. When using the Placeholder class, you can specify the specific value to be placed in the Placeholder by using the ph_value argument of methods such as .to_pyqubo and .to_lp of the Problem class. If you want to handle array data that cannot be defined with shape (called jagged array), you can use the JaggedArray class.

Example
import jijmodeling as jm
d = jm.Placeholder("d", ndim=2)
d.ndim
# 2

ArrayShape

Bases: Placeholder

Shape of variable.

Example
import jijmodeling as jm
d = jm.Placeholder("d", dim=1)
n = d.shape[0]
print(type(n))
# <class 'ArrayShape'>

__init__(array, dimension, uuid=None)

Basically, a user does not call the constuctor directly; an object of.

this class is created instead when shape value of a variable is None.

Parameters:

Name Type Description Default
array Variable

parent array

required
dimension int

dimension is corresponded this object.

required

Last update: 2023年7月5日