parameters: (self, origin, supremum, gen, hgr,
                              printout=False)
return_statement: return C_new
docstring: Build a hypercube with triangulations symmetric to C0.
  
          Parameters
          ----------
          origin : vec
          supremum : vec (tuple)
          gen : generation
          hgr : parent homology group rank
docstring_summary: Build a hypercube with triangulations symmetric to C0.
docstring_tokens: Build a hypercube with triangulations symmetric to C0 .
function: def construct_hypercube(self, origin, supremum, gen, hgr,
                              printout=False):
          """
          Build a hypercube with triangulations symmetric to C0.
  
          Parameters
          ----------
          origin : vec
          supremum : vec (tuple)
          gen : generation
          hgr : parent homology group rank
          """
  
          # Initiate new cell
          C_new = Cell(gen, hgr, origin, supremum)
          C_new.centroid = tuple(
              (np.array(origin) + np.array(supremum)) / 2.0)
  
          # Build new indexed vertex list
          V_new = []
  
          # Cached calculation
          for i, v in enumerate(self.C0()[:-1]):
              t1 = self.generate_sub_cell_t1(origin, v.x)
              t2 = self.generate_sub_cell_t2(supremum, v.x)
  
              vec = t1 + t2
  
              vec = tuple(vec)
              C_new.add_vertex(self.V[vec])
              V_new.append(vec)
  
          # Add new centroid
          C_new.add_vertex(self.V[C_new.centroid])
          V_new.append(C_new.centroid)
  
          # Connect new vertices #TODO: Thread into other loop; no need for V_new
          for i, connections in enumerate(self.graph):
              # Present vertex V_new[i]; connect to all connections:
              for j in connections:
                  self.V[V_new[i]].connect(self.V[V_new[j]])
  
          if printout:
              print("A sub hyper cube with:")
              print("origin: {}".format(origin))
              print("supremum: {}".format(supremum))
              for v in C_new():
                  v.print_out()
  
          # Append the new cell to the to complex
          self.H[gen].append(C_new)
  
          return C_new
function_tokens: def construct_hypercube ( self , origin , supremum , gen , hgr , printout = False ) : # Initiate new cell C_new = Cell ( gen , hgr , origin , supremum ) C_new . centroid = tuple ( ( np . array ( origin ) + np . array ( supremum ) ) / 2.0 ) # Build new indexed vertex list V_new = [ ] # Cached calculation for i , v in enumerate ( self . C0 ( ) [ : - 1 ] ) : t1 = self . generate_sub_cell_t1 ( origin , v . x ) t2 = self . generate_sub_cell_t2 ( supremum , v . x ) vec = t1 + t2 vec = tuple ( vec ) C_new . add_vertex ( self . V [ vec ] ) V_new . append ( vec ) # Add new centroid C_new . add_vertex ( self . V [ C_new . centroid ] ) V_new . append ( C_new . centroid ) # Connect new vertices #TODO: Thread into other loop; no need for V_new for i , connections in enumerate ( self . graph ) : # Present vertex V_new[i]; connect to all connections: for j in connections : self . V [ V_new [ i ] ] . connect ( self . V [ V_new [ j ] ] ) if printout : print ( "A sub hyper cube with:" ) print ( "origin: {}" . format ( origin ) ) print ( "supremum: {}" . format ( supremum ) ) for v in C_new ( ) : v . print_out ( ) # Append the new cell to the to complex self . H [ gen ] . append ( C_new ) return C_new