def ub(self, ub):
if self.equality.any():
raise ValueError(
"The ub array can not be set "
"when there are indices of the "
"equality array that are True")
if ub is None:
ub = numpy.inf
if isinstance(ub, numpy.ndarray):
numpy.copyto(self._ub, ub)
elif isinstance(ub, NumericValue):
raise ValueError("ub must be set to "
"a simple numeric type "
"or a numpy array")
else:
self._ub.fill(ub)
评论列表
文章目录