Research Article

Computing the Discrete Compactness of Orthogonal Pseudo-Polytopes via Their 𝑛 D-EVM Representation

Algorithm 4

Computing the number of (n-1)D adjacencies between the hypervoxels that originally defined an nD-OPP p.
Input:   An nD-EVM p and the number n of dimensions.
Output:  The number of internal contacts, perpendicular to the XA-axis, between
     the hypervoxels that originally composed p.
Procedure  InternalContacts(EVM p, int n)
      EVM hvl// Current couplet of p.
      EVM Si, Sj// Previous and next sections about hvl.
      EVM Sint // The result of intersecting the projections of Si and Sj.
      int c1// Common XA-coordinate of couplet hvl.
      int c2// Common XA-coordinate of couplet next to hvl.
      int nCoords// Number of integer coordinates between c1 and c2.
      int L = 0// Number of internal contacts ((n-1)D adjacencies).
      Si = InitEVM( )
      c1 = GetCoordNextHvl(p)
      hvl = ReadHvl(p)
      while (Not(EndEVM(p)))
     Sj = GetSection(Si, hvl)
     c2 = GetCoordNextHvl(p)
     nCoords = c2-c1-1
     L = L + nCoords * Content(Sj, n - 1)
     Sint = BooleanOperation(Si, Sj, Intersection, n - 1)
     L = L + Content(Sint , n - 1)
     Si = Sj
     c1 = c2
     hvl = ReadHvl(p)// Read next couplet.
     end-of-while
     return L
end-of-procedure