get_component_depth: get_component_depth

Description Usage Arguments Value Examples

Description

Returns the depth of a component in a composite algorithm.

Definition
The depth of a component is equal to:


Formula

depth(x)=\begin{cases} 1, & \text{if}\ |N^{-}(x)| = 0 \\ 2, & \text{if}\ \forall y \in N^{-}(x), y = composite(x) \\ max(depth(N^{-}(x)))+1, & \text{otherwise} \end{cases}

Note
In the haricot package, when we plot a composite algorithm, we plot the input bits and output bits as vertices. This representation is interesting because it shows the bit-level interfaces between components. But the depth concept does not consider input bits and output bits, and only consider components as single units (the algorithm and its surrounding bits). The reason for this is to account for the algorithmic complexity or size, rather than the detailed bit mechanics.

Usage

1
get_component_depth(composite, component, ...)

Arguments

composite

The composite within which we want to measure the depth of a component (R6 class algo_composite).

component

The component algorithm that must be part of the composite and whose depth we would like to know (R6 class algo_base | character vector of the component ID).

Value

The depth of the component (integer).

Examples

1

daviddoret/haricot documentation built on May 21, 2019, 1:42 a.m.