Documentation
¶
Index ¶
- Constants
- func BytesToInt64(b []byte) (int64, error)
- func Int64ToBytes(i int64) ([]byte, error)
- type ChildrenCountClusterPoint
- type ChildrenCountNodeSlice
- type Cluster
- type Database
- type DepthClusterPoint
- type DepthNodeSlice
- type Node
- func (this *Node) AddChild(node *Node)
- func (this *Node) AddChildren(nodes []*Node)
- func (this *Node) AddParent(node *Node)
- func (this *Node) ChildrenCountInDepth(depth int) int
- func (this *Node) ChildrenIds() []int64
- func (this *Node) Copy(children []*Node) *Node
- func (this *Node) CountChildren(depth int) int
- func (this *Node) Depth() (int, int)
- func (this *Node) GetChildren(depth int) ([]*Node, int)
- func (this *Node) HasChildren() bool
- func (this *Node) HasParent() bool
- func (this *Node) Parents() []*Node
- func (this *Node) PrintTree(depth int) string
- func (this *Node) RemoveChild(nodeId int64)
- func (this *Node) RemoveFromChildren()
- func (this *Node) RemoveParent(nodeId int64)
- func (this *Node) String() string
- type NodeChildrenDepthCount
- type NodeMeta
- type Tree
- func (this *Tree) AddNode(from int64, to int64)
- func (this *Tree) AddRoot(id int64)
- func (this *Tree) ChildrenCountInDepthCluster(depth int, k int) []*Cluster
- func (this *Tree) DepthCluster(k int) []*Cluster
- func (this *Tree) Find(nodeId int64) *Node
- func (this *Tree) Flush(filePath string) error
- func (this *Tree) Name() string
- func (this *Tree) Reload(filePath string) error
- func (this *Tree) RemoveNode(nodeId int64) bool
- func (this *Tree) RootNodes() []*Node
- func (this *Tree) TopChildrenCounts(depth int, limit int) []*Node
Constants ¶
View Source
const EXTENSION = ".bin"
Variables ¶
This section is empty.
Functions ¶
func BytesToInt64 ¶
func Int64ToBytes ¶
Types ¶
type ChildrenCountClusterPoint ¶
func (ChildrenCountClusterPoint) Coordinates ¶
func (c ChildrenCountClusterPoint) Coordinates() clusters.Coordinates
func (ChildrenCountClusterPoint) Data ¶
func (c ChildrenCountClusterPoint) Data() interface{}
func (ChildrenCountClusterPoint) Distance ¶
func (c ChildrenCountClusterPoint) Distance(p2 clusters.Coordinates) float64
Distance returns the euclidean distance between two coordinates
type ChildrenCountNodeSlice ¶
type ChildrenCountNodeSlice struct {
// contains filtered or unexported fields
}
func NewChildrenCountNodeSlice ¶
func NewChildrenCountNodeSlice(nodes []*Node, depth int) ChildrenCountNodeSlice
func (ChildrenCountNodeSlice) Len ¶
func (c ChildrenCountNodeSlice) Len() int
func (ChildrenCountNodeSlice) Less ¶
func (c ChildrenCountNodeSlice) Less(i, j int) bool
func (ChildrenCountNodeSlice) Nodes ¶
func (c ChildrenCountNodeSlice) Nodes() []*Node
func (ChildrenCountNodeSlice) Swap ¶
func (c ChildrenCountNodeSlice) Swap(i, j int)
type Cluster ¶
type Database ¶
func NewDatabase ¶
type DepthClusterPoint ¶
type DepthClusterPoint struct {
Node *Node
}
func (DepthClusterPoint) Coordinates ¶
func (c DepthClusterPoint) Coordinates() clusters.Coordinates
func (DepthClusterPoint) Data ¶
func (c DepthClusterPoint) Data() interface{}
func (DepthClusterPoint) Distance ¶
func (c DepthClusterPoint) Distance(p2 clusters.Coordinates) float64
Distance returns the euclidean distance between two coordinates
type DepthNodeSlice ¶
type DepthNodeSlice []*Node
func (DepthNodeSlice) Len ¶
func (c DepthNodeSlice) Len() int
func (DepthNodeSlice) Less ¶
func (c DepthNodeSlice) Less(i, j int) bool
func (DepthNodeSlice) Swap ¶
func (c DepthNodeSlice) Swap(i, j int)
type Node ¶
type Node struct { Id int64 `json:"i"` Children []*Node `json:"c,omitempty"` MaxDepth int32 `json:"mxd,omitempty"` MinDepth int32 `json:"mnd,omitempty"` ChildrenCount int32 `json:"n,omitempty"` Meta NodeMeta `json:"meta,omitempty"` sync.RWMutex // contains filtered or unexported fields }
func (*Node) AddChildren ¶
func (*Node) ChildrenCountInDepth ¶
func (*Node) ChildrenIds ¶
func (*Node) CountChildren ¶
func (*Node) HasChildren ¶
func (*Node) RemoveChild ¶
func (*Node) RemoveFromChildren ¶
func (this *Node) RemoveFromChildren()
func (*Node) RemoveParent ¶
type NodeChildrenDepthCount ¶
func NewNodeChildrenDepthCount ¶
func NewNodeChildrenDepthCount() *NodeChildrenDepthCount
func (*NodeChildrenDepthCount) Get ¶
func (this *NodeChildrenDepthCount) Get(depth int) int
func (*NodeChildrenDepthCount) Set ¶
func (this *NodeChildrenDepthCount) Set(depth int, count int)
type Tree ¶
func (*Tree) ChildrenCountInDepthCluster ¶
func (*Tree) DepthCluster ¶
func (*Tree) RemoveNode ¶
Click to show internal directories.
Click to hide internal directories.