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 ¶
Types ¶
type Float ¶
Float type
type Fraction ¶
type Fraction struct {
// contains filtered or unexported fields
}
Fraction type
func NewFraction ¶
NewFraction from a numerator and denominator
func NewFractionFromMaterializedPath ¶
NewFractionFromMaterializedPath function
func (Fraction) Decimal ¶
Decimal representation of the fraction
type MPath ¶
type MPath []uint64
MPath type struct
func NewMPathFromMPath ¶
NewMPathFromMPath returns a copy of a slice
type MPathProvider ¶
type MPathProvider interface{}
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 Rat ¶
Rat is a float type
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) GetMeta ¶
GetMeta gets a meta from a meta store using the lock
func (*TreeNode) SetMPath ¶
SetMPath triggers the calculation of the rat representation and the sibling rat representation for the node
func (*TreeNode) SetMeta ¶
SetMeta sets a meta using a lock
Source Files
¶
- common-prefix.go
- encoding.go
- float.go
- fraction.go
- matrix.go
- nat.go
- path.go
- rat.go