COMPUTE TREE

Computes the binary search tree associated to the polytopic partition

Contents

Method of pwag object.

Description

This method computes the binary search tree corresponding to the polytopic partition. The binary search tree can be used to evaluate the pwag function in a more efficient way and it is necessary for the circuit implementation. Each node of the tree corresponds to an edge, each leaf to a region. The binary search tree is saved as a property (tree) of the pwag object, for this reason the pwag object must be returned as output. tree is a structure with the following fields:

The structure nodes has the following fields:

Syntax

object = computeTree(object)

Computes the bynary search tree with the default settings (see below).

object = computeTree(object,mode)

Computes the binary search tree by defining a mode which can be either 'regions' (default) or 'functions'. In the first case the domain is splitted based on the polytopes, in the second case the domain is splitted based on the affine functions to be evaluated. This means that if there are only two regions on a side of an edge and in these two regions the affine functions to be computed are the same, the two regions are considered as only one region.

object = computeTree(object,balance)

Computes the binary search tree by specifying a value which determines the balance of the tree itself. balance is a number between 0 and 1 which indicates if you prefer to have a more balanced tree (balance -> 1) but with a greater number of nodes or a less balanced tree (balance -> 0) with less nodes. Default value 0.5.

object = computeTree(object,mode,balance)

Computes the binary search tree by specifying both mode and balance.

Acknowledgements

Contributors:

Copyright is with: