dyadic: Create a complete dyadic tree structure

dyadicR Documentation

Create a complete dyadic tree structure

Description

Create a complete dyadic tree structure

Create a complete dyadic tree structure

Usage

dyadic.from.leaf_list(leaf_list, method)

dyadic.from.window.size(m, s, method)

dyadic.from.height(m, H = NULL, method)

Arguments

leaf_list

A list of leaves

method

A numeric value. If method == 1, start from the leaves and group nodes of a same height 2 by 2 as long as possible. If method==2, start from the root and divide nodes in 2 nodes of equal size as long as possible

m

An integer value, the number of elements in the structure

s

An integer value, the number of elements in each leaf

H

An integer value, the desired maximal height of the tree

Details

dyadic.from.window.size

Dyadic tree structure from window size: the number of elements in each leaf is set to s

dyadic.from.height

Dyadic tree structure from height: the total height of tree is set to H

dyadic.from.max.size

Dyadic tree structure from maximum achievable height: the total height of tree is set to the maximum possible height, ie floor(2 + log2(m - 1))

Value

A list of lists containing the dyadic structure

A list with two elements:

leaf_list

A list of leaves

C

A list of lists containing the dyadic structure

Examples

m <- 6
dd <- dyadic.from.window.size(m, s = 2, method = 2)
str(dd)

dd <- dyadic.from.height(m, H = 3, method = 2)
str(dd)

dd <- dyadic.from.height(m, method=2)
str(dd)

leaf_list <- dd$leaf_list

pneuvial/sanssouci documentation built on Feb. 12, 2024, 4:18 a.m.