class_docstr: Linear constraint on the variables.
  
  The constraint has the general inequality form::
  
      lb <= A.dot(x) <= ub
  
  Here the vector of independent variables x is passed as ndarray of shape
  (n,) and the matrix A has shape (m, n).
  
  It is possible to use equal bounds to represent an equality constraint or
  infinite bounds to represent a one-sided constraint.
  
  Parameters
  ----------
  A : {array_like, sparse matrix}, shape (m, n)
      Matrix defining the constraint.
  lb, ub : dense array_like, optional
      Lower and upper limits on the constraint. Each array must have the
      shape (m,) or be a scalar, in the latter case a bound will be the same
      for all components of the constraint. Use ``np.inf`` with an
      appropriate sign to specify a one-sided constraint.
      Set components of `lb` and `ub` equal to represent an equality
      constraint. Note that you can mix constraints of different types:
      interval, one-sided or equality, by setting different components of
      `lb` and `ub` as  necessary. Defaults to ``lb = -np.inf``
      and ``ub = np.inf`` (no limits).
  keep_feasible : dense array_like of bool, optional
      Whether to keep the constraint components feasible throughout
      iterations. A single value set this property for all components.
      Default is False. Has no effect for equality constraints.
class_docstr_tok: ["Linear","constraint","on","the","variables",".","The","constraint","has","the","general","inequality","form",":",":","lb","<","=","A.dot","(","x",")","<","=","ub","Here","the","vector","of","independent","variables","x","is","passed","as","ndarray","of","shape","(","n",",",")","and","the","matrix","A","has","shape","(","m",",","n",")",".","It","is","possible","to","use","equal","bounds","to","represent","an","equality","constraint","or","infinite","bounds","to","represent","a","one-sided","constraint",".","Parameters","--","--","--","--","--","A",":","{","array_like",",","sparse","matrix","}",",","shape","(","m",",","n",")","Matrix","defining","the","constraint",".","lb",",","ub",":","dense","array_like",",","optional","Lower","and","upper","limits","on","the","constraint",".","Each","array","must","have","the","shape","(","m",",",")","or","be","a","scalar",",","in","the","latter","case","a","bound","will","be","the","same","for","all","components","of","the","constraint",".","Use","``","np.inf","``","with","an","appropriate","sign","to","specify","a","one-sided","constraint",".","Set","components","of","`","lb","`","and","`","ub","`","equal","to","represent","an","equality","constraint",".","Note","that","you","can","mix","constraints","of","different","types",":","interval",",","one-sided","or","equality",",","by","setting","different","components","of","`","lb","`","and","`","ub","`","as","necessary",".","Defaults","to","``","lb","=","-np.inf","``","and","``","ub","=","np.inf","``","(","no","limits",")",".","keep_feasible",":","dense","array_like","of","bool",",","optional","Whether","to","keep","the","constraint","components","feasible","throughout","iterations",".","A","single","value","set","this","property","for","all","components",".","Default","is","False",".","Has","no","effect","for","equality","constraints","."]
code: def __init__(self, A, lb=-np.inf, ub=np.inf, keep_feasible=False):
      if not issparse(A):
          # In some cases, if the constraint is not valid, this emits a
          # VisibleDeprecationWarning about ragged nested sequences
          # before eventually causing an error. `scipy.optimize.milp` would
          # prefer that this just error out immediately so it can handle it
          # rather than concerning the user.
          with catch_warnings():
              simplefilter("error")
              self.A = np.atleast_2d(A).astype(np.float64)
      else:
          self.A = A
      if issparse(lb) or issparse(ub):
          raise ValueError("Constraint limits must be dense arrays.")
      self.lb = np.atleast_1d(lb).astype(np.float64)
      self.ub = np.atleast_1d(ub).astype(np.float64)
  
      if issparse(keep_feasible):
          raise ValueError("`keep_feasible` must be a dense array.")
      self.keep_feasible = np.atleast_1d(keep_feasible).astype(bool)
      self._input_validation()
  
imports: import numpy
  from ._hessian_update_strategy import BFGS
  from ._differentiable_functions import VectorFunction, LinearVectorFunction, IdentityVectorFunction
  from ._optimize import OptimizeWarning
  from warnings import warn, catch_warnings, simplefilter, filterwarnings
  from scipy.sparse import issparse
label_desc: Use image node_id 2 to create a new LinearConstraint object  with example: obj = LinearConstraint(A, lb, ub, keep_feasible)