accumulator

package
v0.0.0-...-cbe141c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Negative register
	Negative = 0
	// Positive register
	Positive = 1
)
View Source
const Separator = "/"

Separator is used to separate the categories

Variables

This section is empty.

Functions

This section is empty.

Types

type AccValues

type AccValues [2]float64

AccValues contains accumulator values

type Accumulator

type Accumulator map[string]*AccValues

Accumulator accumulates element values by name

func NewAccumulator

func NewAccumulator() Accumulator

NewAccumulator returns new accumulator

func (Accumulator) Add

func (acc Accumulator) Add(name string, val float64)

Add adds name/value to the accumulator

type TreeNode

type TreeNode struct {
	Name     string
	Sum      float64
	Children map[string]*TreeNode
}

TreeNode contains data for a single balance tree node

func NewTreeNode

func NewTreeNode(name string, sum float64) *TreeNode

NewTreeNode creates new tree node

func (*TreeNode) Add

func (tn *TreeNode) Add(child *TreeNode) *TreeNode

Add appends child node to the current tree node

func (*TreeNode) AddDeep

func (tn *TreeNode) AddDeep(el shared.Element)

AddDeep adds recursive child nodes to the current node given an element

func (*TreeNode) Keys

func (tn *TreeNode) Keys() []string

Keys returns array of children keys

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL