parameters: (self)
return_statement: return
docstring: Split the central edge between the origin and supremum of
          a cell and add the new vertex to the complex
docstring_summary: Split the central edge between the origin and supremum of
          a cell and add the new vertex to the complex
docstring_tokens: Split the central edge between the origin and supremum of a cell and add the new vertex to the complex
function: def add_centroid(self):
          """Split the central edge between the origin and supremum of
          a cell and add the new vertex to the complex"""
          self.centroid = list(
              (np.array(self.origin) + np.array(self.supremum)) / 2.0)
          self.C0.add_vertex(self.V[tuple(self.centroid)])
          self.C0.centroid = self.centroid
  
          # Disconnect origin and supremum
          self.V[tuple(self.origin)].disconnect(self.V[tuple(self.supremum)])
  
          # Connect centroid to all other vertices
          for v in self.C0():
              self.V[tuple(self.centroid)].connect(self.V[tuple(v.x)])
  
          self.centroid_added = True
          return
function_tokens: def add_centroid ( self ) : self . centroid = list ( ( np . array ( self . origin ) + np . array ( self . supremum ) ) / 2.0 ) self . C0 . add_vertex ( self . V [ tuple ( self . centroid ) ] ) self . C0 . centroid = self . centroid # Disconnect origin and supremum self . V [ tuple ( self . origin ) ] . disconnect ( self . V [ tuple ( self . supremum ) ] ) # Connect centroid to all other vertices for v in self . C0 ( ) : self . V [ tuple ( self . centroid ) ] . connect ( self . V [ tuple ( v . x ) ] ) self . centroid_added = True return