Differences

This shows you the differences between two versions of the page.

Link to this comparison view

documentation:latest:graph:lattice [2019/08/13 10:31]
documentation:latest:graph:lattice [2019/11/15 22:01] (current)
Line 1: Line 1:
 +====== BigObject Lattice<​Decoration,​ SeqType> ======
 +//from application [[..:​graph|graph]]//​\\
 +\\
 + A Lattice is a poset where join and meet exist for any two elements. It is realized as a directed graph.
 +
 +  ? Type Parameters:
 +  :: ''​Decoration'':​ additional data associated with each node.  Should be derived from ''​[[..:​graph#​BasicDecoration |BasicDecoration]]''​.
 +  :: ''​SeqType'':​ tag describing the node ordering, should be ''​[[..:​graph#​Sequential |Sequential]]''​ or ''​[[..:​graph#​Nonsequential |Nonsequential]]''​.
 +  ? derived from:
 +  : ''​[[..:​graph:​Graph |Graph]]''​
 +  ? Specializations:​
 +  :: ''​Lattice::​BasicLattice'': ​ A ''​[[..:​graph:​Lattice |Lattice]]''​ with a ''​[[..:​graph#​BasicDecoration |BasicDecoration]]'',​ which corresponds to the legacy HasseDiagram type
 +===== Properties =====
 +
 +==== Combinatorics ====
 + These properties capture combinatorial information of the object. ​ Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.
 +----
 +{{anchor:​bottom_node:​}}
 +  ?  **''​BOTTOM_NODE''​**
 +  :: The index of the bottom node
 +    ? Type:
 +    :''​[[..:​common#​Int |Int]]''​
 +    ? Example:
 +    :: The following prints the bottom node of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​BOTTOM_NODE;​
 + 0
 +</​code>​
 +
 +
 +----
 +{{anchor:​decoration:​}}
 +  ?  **''​DECORATION''​**
 +  :: This is the data associated to each node. The prototype for this is ''​[[..:​graph#​BasicDecoration |BasicDecoration]]'',​ which consists of properties face and rank.
 +    ? Type:
 +    :''​[[..:​common#​NodeMap |NodeMap]]<​[[..:​common#​Directed |Directed]],​Decoration>''​
 +    ? Example:
 +    :: The following prints this property of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​DECORATION;​
 + ({} 0)
 + ({0} 1)
 + ({1} 1)
 + ({2} 1)
 + ({1 2} 2)
 + ({0 2} 2)
 + ({0 1} 2)
 + ({0 1 2} 3)
 +</​code>​
 +
 +
 +----
 +{{anchor:​dims:​}}
 +  ?  **''​DIMS''​**
 +  :: Kept only for backwards compatibility. Basically encodes the ''​[[..:​graph:​Lattice#​INVERSE_RANK_MAP |INVERSE_RANK_MAP]]''​ in FaceLattice objects prior to 3.0.7
 +    ? Type:
 +    :''​[[..:​common#​Array |Array]]<​[[..:​common#​Int |Int]]>''​
 +
 +
 +----
 +{{anchor:​faces:​}}
 +  ?  **''​FACES''​**
 +  :: The face of each node, realized as a NodeMap. This property is kept for two reasons: As a convenient way to access only the face part of the decoration (in this case the property is temporary) and for reasons of backwards compatibility.
 +    ? Type:
 +    :''​[[..:​common#​NodeMap |NodeMap]]<​[[..:​common#​Directed |Directed]],​[[..:​common#​Set |Set]]<​[[..:​common#​Int |Int]]%%>>​%%''​
 +    ? Example:
 +    :: The following prints the faces of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​FACES;​
 + {}
 + {0}
 + {1}
 + {2}
 + {1 2}
 + {0 2}
 + {0 1}
 + {0 1 2}
 +</​code>​
 +
 +
 +----
 +{{anchor:​inverse_rank_map:​}}
 +  ?  **''​INVERSE_RANK_MAP''​**
 +  :: This property provides an efficient way to enumerate all nodes of a given rank. Internally these are realized differently,​ depending on whether the Lattice is ''​[[..:​graph#​Sequential |Sequential]]''​ or ''​[[..:​graph#​Nonsequential |Nonsequential]]''​. Both provide the same user methods though.
 +    ? Type:
 +    :''​[[..:​graph#​InverseRankMap |InverseRankMap]]<​SeqType>''​
 +    ? Example:
 +    :: The following prints this property of the face lattice of the 2-simplex (triangle), where the tuples represent the ranges of nodes belonging to a specific rank:
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​INVERSE_RANK_MAP;​
 + {(0 (0 0)) (1 (1 3)) (2 (4 6)) (3 (7 7))}
 +</​code>​
 +
 +
 +----
 +{{anchor:​top_node:​}}
 +  ?  **''​TOP_NODE''​**
 +  :: The index of the top node
 +    ? Type:
 +    :''​[[..:​common#​Int |Int]]''​
 +    ? Example:
 +    :: The following prints the top node of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​TOP_NODE;​
 + 7
 +</​code>​
 +
 +
 +----
 +===== Methods =====
 +
 +==== Combinatorics ====
 + These methods capture combinatorial information of the object. ​ Combinatorial properties only depend on combinatorial data of the object like, e.g., the face lattice.
 +----
 +{{anchor:​dual_faces:​}}
 +  ?  **''​dual_faces()''​**
 +  ::
 +    ? Returns:
 +    :''​[[..:​common#​Array |Array]]<​[[..:​common#​Set |Set]]<​[[..:​common#​Int |Int]]%%>>​%%''​
 +    ? Example:
 +    :: The following prints the dual faces of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​dual_faces();​
 + {0 1 2}
 + {1 2}
 + {0 2}
 + {0 1}
 + {0}
 + {1}
 + {2}
 + {}
 +</​code>​
 +
 +
 +----
 +{{anchor:​nodes_of_rank:​}}
 +  ?  **''​nodes_of_rank([[..:​common#​Int |Int]] r)''​**
 +  ::
 +    ? Parameters:
 +    :: ''​[[..:​common#​Int |Int]]''​ ''​r''​
 +    ? Returns:
 +    :''​[[..:​common#​List |List]]<​[[..:​common#​Int |Int]]>''​
 +    ? Example:
 +    :: The following prints the nodes of rank 1 of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​nodes_of_rank(1);​
 + {1 2 3}
 +</​code>​
 +
 +
 +----
 +{{anchor:​nodes_of_rank_range:​}}
 +  ?  **''​nodes_of_rank_range([[..:​common#​Int |Int]] r1, [[..:​common#​Int |Int]] r2)''​**
 +  ::
 +    ? Parameters:
 +    :: ''​[[..:​common#​Int |Int]]''​ ''​r1''​
 +    :: ''​[[..:​common#​Int |Int]]''​ ''​r2''​
 +    ? Returns:
 +    :''​[[..:​common#​List |List]]<​[[..:​common#​Int |Int]]>''​
 +    ? Example:
 +    :: The following prints the nodes with rank between 1 and 2 of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​nodes_of_rank_range(1,​2);​
 + {1 2 3 4 5 6}
 +</​code>​
 +
 +
 +----
 +{{anchor:​rank:​}}
 +  ?  **''​rank()''​**
 +  ::
 +    ? Returns:
 +    :''​[[..:​common#​Int |Int]]''​
 +    ? Example:
 +    :: The following prints the rank of the top node of the face lattice of the 2-simplex (triangle):
 +    :: <code perl> > print simplex(2)->​HASSE_DIAGRAM->​rank();​
 + 3
 +</​code>​
 +
 +
 +----
 +
 +==== Visualization ====
 + These methods are for visualization.
 +----
 +{{anchor:​visual:​}}
 +  ?  **''​VISUAL()''​**
 +  :: Visualize the Lattice.
 +    ? Options:
 +    : 
 +    :: ''​[[..:​common#​Int |Int]]''​ ''​seed'':​ random seed value for the node placement
 +    : option list ''​[[..:​graph#​Visual_Lattice_decorations |Visual::​Lattice::​decorations]]''​
 +    ? Returns:
 +    :''​[[..:​graph:​Visual_Lattice |Visual::​Lattice]]''​
 +    ? Example:
 +    :: The following visualizes the face lattice of the 2-simplex (triangle) with default settings:
 +    :: <code perl> > simplex(2)->​HASSE_DIAGRAM->​VISUAL;​
 +</​code>​
 +    ::  The following shows some modified visualization style of the same lattice:
 +    :: <code perl> > simplex(2)->​HASSE_DIAGRAM->​VISUAL(NodeColor=>"​green",​EdgeThickness=>​2,​EdgeColor=>"​purple"​);​
 +</​code>​
 +
 +
 +----
 +{{anchor:​visual_dual:​}}
 +  ?  **''​VISUAL_DUAL()''​**
 +  :: Visualize the dual Lattice. This only produces meaningful results for lattice where the codimension one nodes generate the lattice under intersection.
 +    ? Options:
 +    : 
 +    :: ''​[[..:​common#​Int |Int]]''​ ''​seed'':​ random seed value for the node placement
 +    : option list ''​[[..:​graph#​Visual_Lattice_decorations |Visual::​Lattice::​decorations]]''​
 +    ? Returns:
 +    :''​[[..:​graph:​Visual_Lattice |Visual::​Lattice]]''​
 +    ? Example:
 +    :: The following visualizes the dual face lattice of the 2-simplex (triangle) with default settings:
 +    :: <code perl> > simplex(2)->​HASSE_DIAGRAM->​VISUAL_DUAL;​
 +</​code>​
 +    ::  The following shows some modified visualization style of the same lattice:
 +    :: <code perl> > simplex(2)->​HASSE_DIAGRAM->​VISUAL_DUAL(NodeColor=>"​green",​EdgeThickness=>​2,​EdgeColor=>"​purple"​);​
 +</​code>​
 +
 +
 +----