Views

Views are wrappers around network types that add or change certain functionality. For more information, please refer to the mockturtle documentation.

Edge Color View

Header: fiction/networks/views/edge_color_view.hpp

template<typename Ntk>
class out_of_place_edge_color_view : public mockturtle::out_of_place_color_view<Ntk>

A view that extends mockturtle::out_of_place_color_view such that it can color edges, i.e., tuples of nodes as well.

Template Parameters:

Ntk – mockturtle network type.

Public Functions

inline explicit out_of_place_edge_color_view(const Ntk &ntk)

Standard constructor.

Parameters:

ntk – Network to color.

inline void clear_colors() const

Remove all assigned colors.

inline uint32_t edge_color(const edge &e) const

Returns the assigned color of a given edge.

Parameters:

e – Edge whose color is desired.

Returns:

Color of edge e.

inline void paint_edge(const edge &e) const

Paint a given edge with the current color.

Parameters:

e – Edge to paint.

inline void paint_edge(const edge &e, uint32_t clr) const

Paint a given edge with the given color.

Parameters:
  • e – Edge to paint.

  • clr – Color to paint e with.

inline void paint_edge(const edge &e, const edge &other) const

Paint a given edge with the color of another given edge.

Parameters:
  • e – Edge to paint.

  • other – Edge whose color is to be used to paint e.

template<typename Pred>
inline bool eval_edge_color(const edge &e, Pred &&pred) const

Evaluates a predicate on a given edge’s color.

Template Parameters:

Pred – Predicate type.

Parameters:
  • e – Edge whose color is used as a parameter for pred.

  • pred – Predicate to evaluate on e’s color.

Returns:

Return value of pred(color(e)).

template<typename Pred>
inline bool eval_edge_color(const edge &a, const edge &b, Pred &&pred) const

Evaluates a predicate on two given edges’ colors.

Template Parameters:

Pred – Predicate type.

Parameters:
  • a – Edge whose color is used as the first parameter for pred.

  • b – Edge whose color is used as the second parameter for pred.

  • pred – Predicate to evaluate on a’s and b’s colors.

Returns:

Return value of pred(color(a), color(b)).