code: def QP_smo(Q, p, a, b, c, y, tau, a0, X):
      """\
  Minimizes xQx + Px, 
     subject to a_i <= x_i <= b_i for all i
     and y.x = c
  
     X are the array of input points (their labels should be in y)
      """
      # initial alpha (must be feasible)
      alpha = a0
      l = alpha.size
      ym, yp = (y < 0).nonzero()[0], (y > 0).nonzero()[0]
      while 1:
          Isets = getIndexSets(alpha, a, b, y)
          Iub = getIub(*Isets)
          Ilb = getIlb(*Isets)
          F = (dot(Q, alpha) + p) / y
          if QPOptimalQ(Iub, Ilb, F, tau):
              break
          B = getViolatingPair(Isets[0], Iub, Ilb, F, tau)
          # now solve the 2d subproblem
          aa = smo_sub2d(Q, y, alpha, X, B[0], B[1], ym, yp)
          print("aa: %s" % str(aa))
          alpha[B[0]], alpha[B[1]] = aa
          print(alpha)
          break
  
file_path: mystic/_examples/test_smo1.py
imports: from numpy import *
  import matplotlib.pyplot
  from mystic.svc import *
  from mystic.symbolic import linear_symbolic, solve, generate_solvers, generate_constraint
  from mystic import suppressed
  from mystic.solvers import diffev
label_desc: Use image node_id 10 for calling a global function with example usage: QP_smo(Q, p, a, b, c, y, tau, a0, X) without return types