Index library#

To use one of the described component here, you have to import them from revsymg.index_lib.

Types#

Vertices#

IndexT#

Indices type.

OrT#

Orientations type.

Value:

binaries set \(\mathbb{B} = \{0 ; 1\}\)

IndOrT#

Vertices type.

Alias for:

tuple (IndexT, OrT)

Edges#

EIndOrT#

Edges type with no edge index.

alias for: tuple (IndOrT, IndOrT)

EIndOrIndT#

Edges with edge index type.

alias for: tuple (IndOrT, IndOrT, IndexT)

IndOrIndT#

Adjacent vertex with edge index type.

alias for: tuple (IndOrT, IndexT)

EIndT#

Edges of indices type.

alias for: tuple (IndexT, IndexT)

EIndIndT#

Edges of indices with edge index type.

alias for: tuple (IndexT, IndexT, IndexT)

IndIndT#

Adjacent index vertex with edge index type.

alias for: tuple (IndexT, IndexT)

Constants#

For OrT type#

FORWARD_INT = 0#

Forward orientation value.

Type:

OrT

REVERSE_INT = 1#

Reverse orientation value.

Type:

OrT

ORIENT_REV = (1, 0)#

OrT reverse list.

Type:

tuple (OrT, OrT)

FWDOR_REVOR = ((0, 1), (1, 0))#

OrT relative orientation.

Type:

tuple ((OrT, OrT), (OrT, OrT))

Oriented vertex#

IND = 0#

The index for IndOrT’s index value.

OR = 1#

The index for IndOrT’s orientation value.

Edge types#

PRED_IND = 0#

The index of the predecessor.

For EIndOrT, EIndOrIndT, EIndT and EIndIndT types.

SUCC_IND = 1#

The index of the successor.

For EIndOrT, EIndOrIndT, EIndT and EIndIndT types.

E_IND = 2#

The index of edge’s index in the edge.

For both EIndOrIndT and EIndIndT it corresponds to IndexT value.

For adjacency types#

ADJ_NEIGH = 0#

The index of the neighbour in the adjacency object.

It corresponds to the IndOrT value in IndOrIndT and to the first IndexT value in IndIndT.

ADJ_IND = 1#

The index of the edge index in the adjacency object.

It corresponds to the IndexT value in IndOrIndT and to the second IndexT value in IndIndT.

Other#

MULT_IID = 2#

Index multiplier.

Functions#

For IndOrT type#

is_forward(vertex)#

Return True if the vertex is considered as forward.

Parameters:

vertex (IndOrT) – A vertex

Returns:

True if vertex’s orientation is forward

Return type:

bool

is_reverse(vertex)#

Return True if the vertex is considered as reverse.

Parameters:

vertex (IndOrT) – Oriented vertex

Returns:

True is vertex is in reverse orientation

Return type:

bool

rev_vertex(vertex)#

Return the reverse vertex.

Parameters:

vertex (IndOrT) – Oriented vertex

Returns:

The reversed of vertex

Return type:

IndOrT

For EIndOrT type#

rev_edge(first_vertex, second_vertex)#

Return the reverse edge.

Parameters:
  • first_vertex (IndOrT) – First oriented vertex in the edge

  • second_vertex (IndOrT) – Second oriented vertex in the edge

Returns:

The reversed of edge

Return type:

EIndOrT

is_canonical(first_vertex, second_vertex)#

Xor boolean function between edge and its reverse.

Parameters:
  • first_vertex (IndOrT) – First oriented vertex in the edge

  • second_vertex (IndOrT) – Second oriented vertex in the edge

Returns:

True if \(\texttt{is_canonical}(\overline{edge})\) is False, else False

Return type:

bool

Notes

\(\texttt{is_canonical}\) is defined such as \(\texttt{is_canonical}(edge) \veebar \texttt{is_canonical}(\overline{edge})\)

eindor_orientation(first_vertex, second_vertex)#

Return the edge orientation.

Parameters:
  • first_vertex (IndOrT) – First oriented vertex in the edge

  • second_vertex (IndOrT) – Second oriented vertex in the edge

Returns:

Edge orientation

Return type:

OrT

Notes

This is pure definition. Note that in case of self loop, return value is FORWARD_INT