@@ -166,7 +166,8 @@ def objective(self, value: ArraySymbol):
166166 def binary (self , shape : None | _ShapeLike = None ,
167167 lower_bound : None | np .typing .ArrayLike = None ,
168168 upper_bound : None | np .typing .ArrayLike = None ,
169- subject_to : None | np .typing .ArrayLike = None ) -> BinaryVariable :
169+ subject_to : None | list [tuple (int , str | list [str ], float |
170+ list [float ])] = None ) -> BinaryVariable :
170171 r"""Create a binary symbol as a decision variable.
171172
172173 Args:
@@ -183,13 +184,13 @@ def binary(self, shape: None | _ShapeLike = None,
183184 array of tuples where each tuple has the form: (axis, operators, bounds)
184185 - axis (int): The axis along which the bounds are applied.
185186 - operators (str | array[str]): The operator(s) ("<=", "==", or ">=").
186- A single operator applies to all hyperslices along the axis; an
187- array specifies one operator per hyperslice .
187+ A single operator applies to all slices along the axis; an
188+ array specifies one operator per slice .
188189 - bounds (float | array[float]): The bound value(s). A single value
189- applies to all hyperslices ; an array specifies one bound per hyperslice .
190- If provided, the sum of values within each hyperslice along the specified
191- axis must satisfy the corresponding operator–bound pair.
192- Note: At most one axis-wise bound may be provided.
190+ applies to all slices ; an array specifies one bound per slice .
191+ If provided, the sum of values within each slice along the
192+ specified axis must satisfy the corresponding operator–bound
193+ pair. Note: At most one axis-wise bound may be provided.
193194
194195 Returns:
195196 A binary symbol.
@@ -230,13 +231,13 @@ def binary(self, shape: None | _ShapeLike = None,
230231 This example adds a :math:`(2x3)`-sized binary symbol with
231232 index-wise lower bounds and an axis-wise bound along axis 1. Let
232233 x_i (int i : 0 <= i <= 2) denote the sum of the values within
233- hyperslice i along axis 1. For each state defined for this symbol:
234+ slice i along axis 1. For each state defined for this symbol:
234235 (x_0 <= 0), (x_1 == 2), and (x_2 >= 1).
235236
236237 >>> from dwave.optimization.model import Model
237238 >>> import numpy as np
238239 >>> model = Model()
239- >>> n = model.binary([2, 3], lower_bound=[[0, 1, 1], [0, 1, 0]],
240+ >>> b = model.binary([2, 3], lower_bound=[[0, 1, 1], [0, 1, 0]],
240241 ... subject_to=[(1, ["<=", "==", ">="], [0, 2, 1])])
241242 >>> np.all(n.axis_wise_bounds() == [(1, ["<=", "==", ">="], [0, 2, 1])])
242243 True
@@ -508,8 +509,8 @@ def integer(
508509 shape : None | _ShapeLike = None ,
509510 lower_bound : None | numpy .typing .ArrayLike = None ,
510511 upper_bound : None | numpy .typing .ArrayLike = None ,
511- subject_to : None | np . typing . ArrayLike = None
512- ) -> IntegerVariable :
512+ subject_to : None | list [ tuple ( int , str | list [ str ], float |
513+ list [ float ])] = None ) -> IntegerVariable :
513514 r"""Create an integer symbol as a decision variable.
514515
515516 Args:
@@ -526,13 +527,13 @@ def integer(
526527 array of tuples where each tuple has the form: (axis, operators, bounds)
527528 - axis (int): The axis along which the bounds are applied.
528529 - operators (str | array[str]): The operator(s) ("<=", "==", or ">=").
529- A single operator applies to all hyperslices along the axis; an
530- array specifies one operator per hyperslice .
530+ A single operator applies to all slice along the axis; an array
531+ specifies one operator per slice .
531532 - bounds (float | array[float]): The bound value(s). A single value
532- applies to all hyperslices ; an array specifies one bound per hyperslice .
533- If provided, the sum of values within each hyperslice along the specified
534- axis must satisfy the corresponding operator–bound pair.
535- Note: At most one axis-wise bound may be provided.
533+ applies to all slices ; an array specifies one bound per slice .
534+ If provided, the sum of values within each slice along the
535+ specified axis must satisfy the corresponding operator–bound
536+ pair. Note: At most one axis-wise bound may be provided.
536537
537538 Returns:
538539 An integer symbol.
@@ -574,7 +575,7 @@ def integer(
574575 This example adds a :math:`(2x3)`-sized integer symbol with general
575576 lower and upper bounds and an axis-wise bound along axis 1. Let x_i
576577 (int i : 0 <= i <= 2) denote the sum of the values within
577- hyperslice i along axis 1. For each state defined for this symbol:
578+ slice i along axis 1. For each state defined for this symbol:
578579 (x_0 <= 2), (x_1 <= 4), and (x_2 <= 5).
579580
580581 >>> from dwave.optimization.model import Model
0 commit comments