Index library#

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

Types#

Type

Alias - value

Description

IndexT

int

Index type

OrT

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

Orientations type

IndOrT

tuple (IndexT, OrT)

Oriented vertex type

EIndOrT

tuple (IndOrT, IndOrT)

Edges type

IndOrIndT

tuple (IndOrT, IndexT)

Adjacent vertex with edge index type

EIndOrIndT

tuple (EIndOrT, IndexT)

Edges with edge index type

IndexT#

Index type

OrT#

Orientations type

Value:

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

IndOrT#

Oriented vertex type

Value:

tuple (IndexT, OrT)

EIndOrT#

Edges type.

Value:

tuple (IndOrT, IndOrT)

IndOrIndT#

Adjacent vertex with edge index type.

Value:

tuple (IndOrT, IndexT)

EIndOrIndT#

Edges with edge index type.

Value:

tuple (EIndOrT, IndexT)

Constants#

  • For OrT type:

FORWARD_INT

Forward orientation value.

REVERSE_INT

Reverse orientation value.

ORIENT_REV

OrT reverse list.

FWDOR_REVOR

OrT relative orientation.

IND

The index for IndOrT's index value.

OR

The index for IndOrT's orientation value.

PRED_IND

The index for predecessors of forwards in adjancies table

SUCC_IND

The index for successors of forwards in adjancies table

ADJ_INDOR

The index for IndOrT value in IndOrIndT.

ADJ_IND

The index for IndexT value in IndOrIndT.

E_IND

The index of edge's index in the edge.

  • Other:

MULT_IID

Index multiplier.

  • All the constants

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))

IND = 0#

The index for IndOrT’s index value.

OR = 1#

The index for IndOrT’s orientation value.

PRED_IND = 0#

The index for predecessors of forwards in adjancies table

SUCC_IND = 1#

The index for successors of forwards in adjancies table

ADJ_INDOR = 0#

The index for IndOrT value in IndOrIndT.

ADJ_IND = 1#

The index for IndexT value in IndOrIndT.

E_IND = 2#

The index of edge’s index in the edge.

For both EIndOrIndT and EIndIndT it corresponds to IndexT value.

MULT_IID = 2#

Index multiplier.

Functions#

is_forward(vertex)

Return True if the vertex is considered as forward.

is_reverse(vertex)

Return True if the vertex is considered as reverse.

rev_vertex(vertex)

Return the reverse vertex.

rev_edge(first_vertex, second_vertex)

Return the reverse edge.

is_canonical(first_vertex, second_vertex)

Xor boolean function between edge and its reverse.

eindor_orientation(first_vertex, second_vertex)

Return the edge orientation.

  • All the functions:

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

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