int ndlqr_GetIndexFromLeaf(const OrderedBinaryTree *tree, int leaf, int level)
Get the knot point index given the leaf index at a given level.
Definition: binary_tree.c:65
int level
level in the tree
Definition: binary_tree.h:35
int ndlqr_FreeTree(OrderedBinaryTree *tree)
Frees the data in tree.
Definition: binary_tree.c:59
BinaryNode * right_child
right child
Definition: binary_tree.h:42
UnitRange left_inds
range of knot point indices of all left children
Definition: binary_tree.h:37
BinaryNode * root
root of the tree. Corresponds to the "middle" knot point.
Definition: binary_tree.h:65
The binary tree for the rsLQR solver.
Definition: binary_tree.h:64
BinaryNode * node_list
a list of all the nodes, ordered by their knot point index
Definition: binary_tree.h:66
int num_elements
length of the OrderedBinaryTree::node_list
Definition: binary_tree.h:67
UnitRange right_inds
range of knot point indices of all right children
Definition: binary_tree.h:38
BinaryNode * left_child
left child
Definition: binary_tree.h:41
int ndlqr_GetIndexAtLevel(const OrderedBinaryTree *tree, int index, int level)
Get the index in level that corresponds to index.
Definition: binary_tree.c:89
int depth
total depth of the tree
Definition: binary_tree.h:68
OrderedBinaryTree ndlqr_BuildTree(int N)
Construct a new binary tree for a horizon of length N.
Definition: binary_tree.c:39
int levelidx
leaf index at the current level
Definition: binary_tree.h:36
int idx
knot point index
Definition: binary_tree.h:34
int ndlqr_GetIndexLevel(const OrderedBinaryTree *tree, int index)
Get the level for a given knot point index.
Definition: binary_tree.c:71
Represents a range of consecutive integers.
Definition: binary_tree.h:23
Definition: binary_tree.h:33
BinaryNode * parent
parent node
Definition: binary_tree.h:40