class_docstr: Barrier optimization problem:
      minimize fun(x) - barrier_parameter*sum(log(s))
      subject to: constr_eq(x)     = 0
                constr_ineq(x) + s = 0
docstr: Returns scaled gradient.
  
  Return scaled gradient:
      gradient = [             grad(x)             ]
                 [ -barrier_parameter*ones(n_ineq) ]
  and scaled Jacobian matrix:
      jacobian = [  jac_eq(x)  0  ]
                 [ jac_ineq(x) S  ]
  Both of them scaled by the previously defined scaling factor.
docstr_tok: ["Returns","scaled","gradient",".","Return","scaled","gradient",":","gradient","=","[","grad","(","x",")","]","[","-barrier_parameter","*","ones","(","n_ineq",")","]","and","scaled","Jacobian","matrix",":","jacobian","=","[","jac_eq","(","x",")","0","]","[","jac_ineq","(","x",")","S","]","Both","of","them","scaled","by","the","previously","defined","scaling","factor","."]
code: def gradient_and_jacobian(self, z):
      """Returns scaled gradient.
  
      Return scaled gradient:
          gradient = [             grad(x)             ]
                     [ -barrier_parameter*ones(n_ineq) ]
      and scaled Jacobian matrix:
          jacobian = [  jac_eq(x)  0  ]
                     [ jac_ineq(x) S  ]
      Both of them scaled by the previously defined scaling factor.
      """
      # Get variables and slack variables
      x = self.get_variables(z)
      s = self.get_slack(z)
      # Compute first derivatives
      g = self.grad(x)
      J_eq, J_ineq = self.jac(x)
      # Return gradient and Jacobian
      return (
          self._compute_gradient(g),
          self._compute_jacobian(J_eq, J_ineq, s),
      )
  
imports: import scipy.sparse
  import numpy
  from .equality_constrained_sqp import equality_constrained_sqp
  from scipy.sparse.linalg import LinearOperator
label_desc: Use image node_id 9 for calling the BarrierSubproblem obj's underlying member method code with example usage: obj.gradient_and_jacobian(z) and returns: self,  self