Documentation ¶
Overview ¶
Package mtree provides advanced tools for encoding tree paths in a material format
Index ¶
Constants ¶
const PRECISION = 100
Variables ¶
This section is empty.
Functions ¶
func CommonPrefix ¶
func ToPathUint ¶
Types ¶
type Fraction ¶
type Fraction struct {
// contains filtered or unexported fields
}
Fraction type
func NewFraction ¶
NewFraction from a numerator and denominator
func NewFractionFromMaterializedPath ¶
NewFractionFromMaterializedPath function
type MPath ¶
type MPath []uint64
MPath type struct
func NewMPathFromMPath ¶
NewMPathFromMPath returns a copy of a slice
func (MPath) CommonRoot ¶
type MPathProvider ¶
type MPathProvider interface{}
type Matrix ¶
func MoveSubtree ¶
type Nat ¶
Nat is an unsigned integer x of the form
x = x[n-1]*_B^(n-1) + x[n-2]*_B^(n-2) + ... + x[1]*_B + x[0]
with 0 <= x[i] < _B and 0 <= i < n is stored in a slice of length n, with the digits x[i] as the slice elements.
A number is normalized if the slice contains no leading 0 digits. During arithmetic operations, denormalized values may occur but are always normalized before returning the final result. The normalized representation of 0 is the empty or nil slice (length = 0).
type TreeNode ¶
type TreeNode struct { *tree.Node MPath MPath //rat *Rat //srat *Rat Level int // contains filtered or unexported fields }
TreeNode definition
func NewTreeNode ¶
func NewTreeNode() *TreeNode
NewTreeNode wraps a node with its rational equivalent of the mpath
func (*TreeNode) SetMPath ¶
SetMPath triggers the calculation of the rat representation and the sibling rat representation for the node