Interface Matching

Header: fiction/networks/interface_matching.hpp

struct interface_matching

Complete permutations from the left interface to the right interface.

Public Members

std::vector<uint32_t> inputs = {}

Right primary input index for each left primary input index.

std::vector<uint32_t> outputs = {}

Right primary output index for each left primary output index.

template<typename Left, typename Right>
interface_matching fiction::networks::match_interfaces(const Left &left, const Right &right)

Matches primary inputs and outputs by unique nonempty names, then by remaining declared positions.

A name matches only when it occurs once in each corresponding interface. Empty, duplicate, and unmatched names fall back to the remaining positions in declared order. Every terminal receives exactly one match.

Template Parameters:
  • Left – Network or placed object layout.

  • Right – Network or placed object layout.

Parameters:
  • left – Left interface owner.

  • right – Right interface owner.

Throws:

std::invalid_argument – If the primary input counts or primary output counts differ.

Returns:

Complete permutations from left terminal indices to right terminal indices.