docstr: Split a hypersimplex S into two sub simplices by building a hyperplane
  which connects to a new vertex on an edge (the longest edge in
  dim = {2, 3}) and every other vertex in the simplex that is not
  connected to the edge being split.
  
  This function utilizes the knowledge that the problem is specified
  with symmetric constraints
  
  The longest edge is tracked by an ordering of the
  vertices in every simplices, the edge between first and second
  vertex is the longest edge to be split in the next iteration.
docstr_tok: ["Split","a","hypersimplex","S","into","two","sub","simplices","by","building","a","hyperplane","which","connects","to","a","new","vertex","on","an","edge","(","the","longest","edge","in","dim","=","{","2",",","3","}",")","and","every","other","vertex","in","the","simplex","that","is","not","connected","to","the","edge","being","split",".","This","function","utilizes","the","knowledge","that","the","problem","is","specified","with","symmetric","constraints","The","longest","edge","is","tracked","by","an","ordering","of","the","vertices","in","every","simplices",",","the","edge","between","first","and","second","vertex","is","the","longest","edge","to","be","split","in","the","next","iteration","."]
code: def split_simplex_symmetry(self, S, gen):
      """
      Split a hypersimplex S into two sub simplices by building a hyperplane
      which connects to a new vertex on an edge (the longest edge in
      dim = {2, 3}) and every other vertex in the simplex that is not
      connected to the edge being split.
  
      This function utilizes the knowledge that the problem is specified
      with symmetric constraints
  
      The longest edge is tracked by an ordering of the
      vertices in every simplices, the edge between first and second
      vertex is the longest edge to be split in the next iteration.
      """
      # If not gen append
      try:
          self.H[gen]
      except IndexError:
          self.H.append([])
  
      # Find new vertex.
      # V_new_x = tuple((np.array(C()[0].x) + np.array(C()[1].x)) / 2.0)
      s = S()
      firstx = s[0].x
      lastx = s[-1].x
      V_new = self.V[tuple((np.array(firstx) + np.array(lastx)) / 2.0)]
  
      # Disconnect old longest edge
      self.V[firstx].disconnect(self.V[lastx])
  
      # Connect new vertices to all other vertices
      for v in s[:]:
          v.connect(self.V[V_new.x])
  
      # New "lower" simplex
      S_new_l = Simplex(gen, S.hg_n, self.generation_cycle, self.dim)
      S_new_l.add_vertex(s[0])
      S_new_l.add_vertex(V_new)  # Add new vertex
      for v in s[1:-1]:  # Add all other vertices
          S_new_l.add_vertex(v)
  
      # New "upper" simplex
      S_new_u = Simplex(gen, S.hg_n, S.generation_cycle, self.dim)
  
      # First vertex on new long edge
      S_new_u.add_vertex(s[S_new_u.generation_cycle + 1])
  
      for v in s[1:-1]:  # Remaining vertices
          S_new_u.add_vertex(v)
  
      for k, v in enumerate(s[1:-1]):  # iterate through inner vertices
          if k == S.generation_cycle:
              S_new_u.add_vertex(V_new)
          else:
              S_new_u.add_vertex(v)
  
      S_new_u.add_vertex(s[-1])  # Second vertex on new long edge
  
      self.H[gen].append(S_new_l)
      self.H[gen].append(S_new_u)
  
      return
  
imports: import numpy
  import copy
label_desc: Use image node_id 12 for calling the Complex obj's underlying member method code with example usage: obj.split_simplex_symmetry(S, gen) without return types