package nodeset
Import Path
github.com/freeeve/gochickpeas/nodeset (on go.dev )
Dependency Relation
imports 3 packages , and imported by 4 packages
Package-Level Type Names (only one)
/* sort by: alphabet | popularity */
type Set (struct)
Set is a set of node ids.
Methods (total 17 )
(*Set) And (other *Set ) *Set
And returns the intersection of s and other; neither operand is mutated.
(*Set) AndNot (other *Set ) *Set
AndNot returns the difference s - other; neither operand is mutated.
(*Set) AsRange () (lo, hi uint32 , ok bool )
AsRange reports the set as a contiguous half-open [lo, hi) range, iff it
is non-empty and gap-free (a set of n ids spanning [min, max] is gap-free
exactly when max-min+1 == n, so this is O(1)). Callers must keep a correct
fallback (Iter) for when ok is false.
(*Set) Bitmap () *roaring .Bitmap
Bitmap exposes the underlying roaring bitmap for serialization and
interop. Callers must not mutate it.
(*Set) Clone () *Set
Clone returns an independent copy.
(*Set) Contains (id uint32 ) bool
Contains reports whether id is in the set.
(*Set) Equals (other *Set ) bool
Equals reports element-for-element equality.
(*Set) Insert (id uint32 ) bool
Insert adds id, reporting whether it was newly added.
(*Set) IsEmpty () bool
IsEmpty reports whether the set holds no ids.
(*Set) Iter () iter .Seq [uint32 ]
Iter iterates the set's ids in ascending order. The accessor is a
thin inlinable closure constructor over iterYield, so a direct
`for range` over it devirtualizes at the call site and the loop body
compiles as straight code rather than a heap-allocated yield closure.
(*Set) IterChunks (buf []uint32 , yield func([]uint32 ) bool )
IterChunks walks the set in ascending order one buf-sized chunk at a
time, reusing buf; yield returning false stops the walk. The chunk
form lets batch consumers sweep columnar predicates over many ids per
dispatch instead of paying a closure per id.
(*Set) Len () int
Len is the number of ids in the set (cardinality).
(*Set) Max () (id uint32 , ok bool )
Max is the largest id; ok is false for an empty set.
(*Set) Min () (id uint32 , ok bool )
Min is the smallest id; ok is false for an empty set.
(*Set) Or (other *Set ) *Set
Or returns the union of s and other; neither operand is mutated.
(*Set) Remove (id uint32 ) bool
Remove deletes id, reporting whether it had been present.
(*Set) ToSlice () []uint32
ToSlice returns the ids in ascending order.
As Outputs Of (at least 33 )
func FromBitmap (bm *roaring .Bitmap ) *Set
func New () *Set
func Of (ids ...uint32 ) *Set
func (*Set).And (other *Set ) *Set
func (*Set).AndNot (other *Set ) *Set
func (*Set).Clone () *Set
func (*Set).Or (other *Set ) *Set
func github.com/freeeve/gochickpeas.(*FullTextField ).Query (query string ) *Set
func github.com/freeeve/gochickpeas.(*GeoIndex ).WithinBBox (minLat, minLon, maxLat, maxLon float64 ) *Set
func github.com/freeeve/gochickpeas.(*GeoIndex ).WithinRadius (lat, lon, km float64 ) *Set
func github.com/freeeve/gochickpeas.(*Snapshot ).BFS (start *Set , dir chickpeas .Direction , m chickpeas .RelMatch , nodeFilter chickpeas .NodeFilter , relFilter chickpeas .RelFilter , maxDepth int ) (nodes, rels *Set )
func github.com/freeeve/gochickpeas.(*Snapshot ).BidirectionalBFS (source, target *Set , dir chickpeas .Direction , m chickpeas .RelMatch , nodeFilter chickpeas .NodeFilter , relFilter chickpeas .RelFilter , maxDepth int ) (nodes, rels *Set )
func github.com/freeeve/gochickpeas.(*Snapshot ).CommonNeighbors (a, b chickpeas .NodeID , dir chickpeas .Direction , m chickpeas .RelMatch ) *Set
func github.com/freeeve/gochickpeas.(*Snapshot ).FullTextSearch (label, key, query string ) *Set
func github.com/freeeve/gochickpeas.(*Snapshot ).GeoWithinBBox (label, latKey, lonKey string , minLat, minLon, maxLat, maxLon float64 ) *Set
func github.com/freeeve/gochickpeas.(*Snapshot ).GeoWithinRadius (label, latKey, lonKey string , lat, lon, km float64 ) *Set
func github.com/freeeve/gochickpeas.(*Snapshot ).Neighborhood (seed chickpeas .NodeID , dir chickpeas .Direction , m chickpeas .RelMatch , loHops, hiHops uint32 ) *Set
func github.com/freeeve/gochickpeas.(*Snapshot ).NodesWithLabel (label string ) (*Set , bool )
func github.com/freeeve/gochickpeas.(*Snapshot ).NodesWithProperty (label, key string , value any ) (*Set , bool )
func github.com/freeeve/gochickpeas.(*Snapshot ).NodesWithValue (label, key string , v chickpeas .Value ) (*Set , bool )
func github.com/freeeve/gochickpeas.(*Snapshot ).RelsWithType (relType string ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.Graph .FullTextSearch (label, field, query string ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.Graph .GeoWithinBBox (label, latField, lonField string , minLat, minLon, maxLat, maxLon float64 ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.Graph .GeoWithinRadius (label, latField, lonField string , lat, lon, km float64 ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.Graph .NodesWithLabel (label string ) *Set
func github.com/freeeve/gochickpeas/gql/internal/graph.Graph .NodesWithProperty (label, key string , v value .Value ) *Set
func github.com/freeeve/gochickpeas/gql/internal/graph.Graph .SubstringCandidates (label, field, needle string ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.(*SnapshotGraph ).FullTextSearch (label, field, query string ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.(*SnapshotGraph ).GeoWithinBBox (label, latField, lonField string , minLat, minLon, maxLat, maxLon float64 ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.(*SnapshotGraph ).GeoWithinRadius (label, latField, lonField string , lat, lon, km float64 ) (*Set , bool )
func github.com/freeeve/gochickpeas/gql/internal/graph.(*SnapshotGraph ).NodesWithLabel (label string ) *Set
func github.com/freeeve/gochickpeas/gql/internal/graph.(*SnapshotGraph ).NodesWithProperty (label, key string , v value .Value ) *Set
func github.com/freeeve/gochickpeas/gql/internal/graph.(*SnapshotGraph ).SubstringCandidates (label, field, needle string ) (*Set , bool )
As Inputs Of (at least 9 )
func ParFold [T](s *Set , identity func() T, fold func(acc T, id uint32 ) T, reduce func(a, b T) T) T
func (*Set).And (other *Set ) *Set
func (*Set).AndNot (other *Set ) *Set
func (*Set).Equals (other *Set ) bool
func (*Set).Or (other *Set ) *Set
func github.com/freeeve/gochickpeas.(*Snapshot ).BFS (start *Set , dir chickpeas .Direction , m chickpeas .RelMatch , nodeFilter chickpeas .NodeFilter , relFilter chickpeas .RelFilter , maxDepth int ) (nodes, rels *Set )
func github.com/freeeve/gochickpeas.(*Snapshot ).BidirectionalBFS (source, target *Set , dir chickpeas .Direction , m chickpeas .RelMatch , nodeFilter chickpeas .NodeFilter , relFilter chickpeas .RelFilter , maxDepth int ) (nodes, rels *Set )
func github.com/freeeve/gochickpeas.(*Snapshot ).CommonNeighborCounts (sources []chickpeas .NodeID , dir chickpeas .Direction , m chickpeas .RelMatch , targets *Set ) []chickpeas .CommonNeighborCount
func github.com/freeeve/gochickpeas.(*Snapshot ).NeighborsInSet (node chickpeas .NodeID , dir chickpeas .Direction , set *Set , relTypes ...string ) iter .Seq [chickpeas .NodeID ]
Package-Level Functions (total 4)
func ParFold [T](s *Set , identity func() T, fold func(acc T, id uint32 ) T, reduce func(a, b T) T) T
Type Parameters:
T: any
ParFold folds the set's ids in parallel, then merges the per-chunk
results: identity seeds each chunk's accumulator, fold folds one id into
an accumulator, and reduce merges two accumulators (merged in ascending
chunk order, so the result is deterministic for any associative reduce).
The parallelism is an implementation detail -- the signature is pure std,
so callers depend on neither a parallelism package nor the storage layout.
Uses the contiguous-range fast path (AsRange) when the ids are gap-free,
otherwise a collected scan. For a sequential fold use Iter.
A package-level generic function rather than a method: Go methods cannot
have type parameters.
The pages are generated with Golds v0.8.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .