Documentation
¶
Index ¶
- Constants
- func Comp(compedValue, compValue interface{}) int
- func IntType(value interface{}) bool
- func IntValueComp(compValue, compedValue int) int
- func TestInternal()
- func TypeForcedTransfer(value interface{}) string
- type AdjGraph
- func (graph *AdjGraph) AddEdge(nodeI, nodeJ *GraphNode, edge *GraphEdge)
- func (graph *AdjGraph) AddNode(node *GraphNode)
- func (graph *AdjGraph) Amount() (int, int)
- func (graph *AdjGraph) BfsGraph() []interface{}
- func (graph *AdjGraph) CalculateDiffValueEdge() *MySet
- func (graph *AdjGraph) CalculateDiffValueNode() *MySet
- func (graph *AdjGraph) ConnectedComponents() int
- func (graph *AdjGraph) Construct(isUnidirectional bool)
- func (graph *AdjGraph) DfsGraph() []interface{}
- func (graph *AdjGraph) EdgeValueString() string
- func (graph *AdjGraph) ExistEdge(i, j int, cEdge *GraphEdge) (int, int, int)
- func (graph *AdjGraph) ExistEdgeValue(cEdge *GraphEdge) bool
- func (graph *AdjGraph) ExistNodeValue(cNode *GraphNode) int
- func (graph *AdjGraph) FlushSelfToClearMemory()
- func (graph *AdjGraph) IsIsolatedNode(nodeValue interface{})
- func (graph *AdjGraph) NodeIToNodeIndex(i int) int
- func (graph *AdjGraph) PrintNodes(tAddress []interface{})
- func (graph *AdjGraph) StartWithIndexEdge(nodeIndex int, a interface{}) *MySet
- func (graph *AdjGraph) TestINodeIndex()
- func (graph *AdjGraph) WalkFromNodeI(i int, edgeValue interface{}) *MySet
- func (graph *AdjGraph) WalkFromNodeIOnlyEpsilon(i int) *MySet
- type AvlTree
- type BList
- type GraphEdge
- type GraphNode
- type MySet
- func (set *MySet) Construct()
- func (set *MySet) DeepExist(value interface{}) bool
- func (set *MySet) Diff(cSet *MySet) *MySet
- func (set *MySet) Equal(cSet *MySet) bool
- func (set *MySet) Erase(value interface{})
- func (set *MySet) EraseAll()
- func (set *MySet) Exist(value interface{}) bool
- func (set *MySet) Insert(value interface{})
- func (set *MySet) KleeneClosure(n int) *MySet
- func (set *MySet) Len() int
- func (set *MySet) PositiveClosure(n int) *MySet
- func (set *MySet) Power(n int) *MySet
- func (set *MySet) Product(cSet *MySet) *MySet
- func (set *MySet) Slice() []interface{}
- func (set *MySet) SliceBatchInsert(slice []interface{})
- func (set *MySet) SortSetToSlice() []interface{}
- func (set *MySet) String() string
- func (set *MySet) Union(cSet *MySet) *MySet
- func (set *MySet) Unite(cSet *MySet) *MySet
Constants ¶
View Source
const ( EQ = 10000 GT = 10001 LT = 10002 QS = 10003 INF = math.MaxInt )
View Source
const ( Less = 1 // is considered to be ascending Equal = 0 // is considered to be equal Larger = -1 // is considered to be descending Inc = true Reduce = false )
View Source
const ( DefaultIsBiDirectional = true Epsilon = "epsilon" EdgeEpsilon = "epsilon" EdgeBlank = "epsilon" )
Variables ¶
This section is empty.
Functions ¶
func IntValueComp ¶
func TestInternal ¶
func TestInternal()
func TypeForcedTransfer ¶
func TypeForcedTransfer(value interface{}) string
Types ¶
type AdjGraph ¶
type AdjGraph struct {
Nodes []*GraphNode
Adjacent map[GraphNode][]*GraphNode
Edges []*GraphEdge
IsUnidirectional bool
// contains filtered or unexported fields
}
AdjGraph 如何记录一个点到另一个点的边value edge(i--k-->j) Nodes nodeIndex from [0,N-1] Edges edgeIndex from [0,M-1]
func (*AdjGraph) CalculateDiffValueEdge ¶
CalculateDiffValueEdge 不带空边
func (*AdjGraph) CalculateDiffValueNode ¶
func (*AdjGraph) ConnectedComponents ¶
ConnectedComponents calculate graph Connectivity if 1 is connected else not
func (*AdjGraph) DfsGraph ¶
func (graph *AdjGraph) DfsGraph() []interface{}
DfsGraph NonRecursion dfs
func (*AdjGraph) EdgeValueString ¶
func (*AdjGraph) ExistEdgeValue ¶
func (*AdjGraph) ExistNodeValue ¶
ExistNodeValue 存在相同值的节点
func (*AdjGraph) FlushSelfToClearMemory ¶
func (graph *AdjGraph) FlushSelfToClearMemory()
func (*AdjGraph) IsIsolatedNode ¶
func (graph *AdjGraph) IsIsolatedNode(nodeValue interface{})
IsIsolatedNode ensure graph isolatedNode the graph that one node owns only one different value else meaningless
func (*AdjGraph) NodeIToNodeIndex ¶
NodeIToNodeIndex nodeIndex=graph.Nodes[nodeIndex].i 求nodeIndex 通过node.i 求出 nodeIndex
func (*AdjGraph) PrintNodes ¶
func (graph *AdjGraph) PrintNodes(tAddress []interface{})
func (*AdjGraph) StartWithIndexEdge ¶
func (*AdjGraph) TestINodeIndex ¶
func (graph *AdjGraph) TestINodeIndex()
func (*AdjGraph) WalkFromNodeI ¶
func (*AdjGraph) WalkFromNodeIOnlyEpsilon ¶
type AvlTree ¶
type AvlTree struct {
NodeAmount int // Tree Total Node Counts, NodeAmount
AvlRoot *avlNode // Root of Tree, AvlRoot
}
type BList ¶
type BList struct {
// contains filtered or unexported fields
}
func (*BList) ForwardTraversal ¶
func (list *BList) ForwardTraversal()
func (*BList) OppositeTraversal ¶
func (list *BList) OppositeTraversal()
type GraphEdge ¶
type GraphEdge struct {
Value interface{}
// contains filtered or unexported fields
}
GraphEdge Value&&i&&j&&k
type GraphNode ¶
type GraphNode struct {
Value interface{}
// contains filtered or unexported fields
}
GraphNode equal Value&&i
type MySet ¶
type MySet struct {
ImmutableMap map[interface{}]bool
}
func SliceToSet ¶
func SliceToSet(dataSlice []interface{}) *MySet
func (*MySet) KleeneClosure ¶
KleeneClosure 在PositiveClosure加一个空边即可
func (*MySet) PositiveClosure ¶
PositiveClosure 因为没有边界所以需要约束N
func (*MySet) SliceBatchInsert ¶
func (set *MySet) SliceBatchInsert(slice []interface{})
func (*MySet) SortSetToSlice ¶
func (set *MySet) SortSetToSlice() []interface{}
Click to show internal directories.
Click to hide internal directories.