package
0.0.0-20240212032044-9687f6313245
Repository: https://github.com/drjosh9000/exp.git
Documentation: pkg.go.dev

# Functions

Abs returns the absolute value of x (with no regard for negative overflow).
AStar implements A* search, a variant of Dijkstra's algorithm which takes an additional heuristic h into account.
ByteSet saves keystrokes (it returns SetFromSlice([]byte(s))).
Count counts the number of occurrences of e in the slice s, in O(len(s)) time.
Differences returns the differences between each consecutive pair of elements.
Dijkstra is an implementation of Dijkstra's algorithm for single-source shortest paths on a directed, non-negatively weighted graph.
ExpandRect expands the Rectangle r to include p.
FloodFill is an algorithm for finding single-source shortest paths in an unweighted directed graph.
Foldl implements a functional "reduce" operation over slices.
Foldr is the same as Foldl, but considers elements in the reverse.
Freq counts the frequency of each item in a slice.
GCD returns the greatest common divisor of a and b.
IntegerPredict predicts what would appear at slice index n if the input slice were that long.
Intersection returns the intersection of multiple sets as a new set.
L1 returns the Manhattan norm of p.
Linfty returns the L∞ norm of p.
ListFromSlice creates a circular list from a slice, and returns a slice containing all the nodes in order.
MakeSet makes a set out of a list of items.
Map calls f with each element of in, to build the output slice.
MapCount counts the number of occurrences of v in the map m, in O(len(m)) time.
MapFreq counts the frequency of each value in a map.
MapFromSlice creates a map[int]E from a slice of E.
MapKeyRange reports the minimum and maximum keys in the map m.
MapMap is like Map, but for maps.
MapMax finds the greatest value in the map m and returns the corresponding key and the value itself.
MapMin finds the least value in the map m and returns the corresponding key and the value itself.
MapOrErr calls f with each element of in, to build the output slice.
MapRange reports the minimum and maximum values in the map m, and their corresponding keys.
Max returns the greatest argument (using `>`).
Min returns the least argument (using `<`).
MustMap calls f with each element of in, to build the output slice.
MustMapMap is like MustMap, but for maps.
NewRange returns a range [from, to].
NextPermutation reorders s into the next permutation (in the lexicographic order), reporting if it was able to do so.
PartialSums returns the partial sums (out[i] = in[0] + in[1] + ..
Pow raises base to the power pow, where multiplication is given by op.
Prod computes the product of elements in any slice where the element type is numeric.
RangeAdd adds a number to a range.
RangeMul multiplies a range by a number.
RangeSubtract returns the set difference of two ranges (r - s).
Reverse reverses a slice.
RuneSet saves keystrokes (it returns SetFromSlice([]rune(s))).
SetFromSlice saves keystrokes (it returns make(Set[E]).Insert(sl...)).
SliceFromMap creates a slice of V from a map[K]V, plus an offset value such that s[k] == m[k+offset] for all k in m.
SortAsc sorts the slice in ascending order.
SortByFuncAsc stably sorts the slice using the function to provide values to compare.
SortByFuncDesc stably sorts the slice using the function to provide values to compare.
SortByMapAsc stably sorts the slice using the map to provide values to compare.
SortByMapDesc stably sorts the slice using the map to provide values to compare.
SortDesc sort the slice in descending order.
Sum sums any slice where the elements support the + operator.
Union returns the union of multiple sets as a new set.
XGCD returns the greatest common divisor of a and b, as well as the Bézout coefficients (x and y such that ax + by = GCD(a, b)).

# Variables

CGVL maps ^, >, v, and < to a single step in that direction.
Neigh4 is a slice containing a step up, right, down, and left (N, E, S, W).
Neigh8 is a slice containing a step to all 8 neighbouring cells in order from top-left to bottom-right.
NESW maps N, E, S, and W to a single step in that direction.
ULDR maps U, L, D, and R to a single step in that direction.

# Structs

AABB3 is a three-dimensional axis-aligned bounding box.
AABB4 is a four-dimensional axis-aligned bounding box.
ListNode implements a node in a doubly-linked list.
Range represents an **inclusive** range of values.
Topic is a pub-sub topic.
WeightedItem is an item together with a weight value.

# Interfaces

Addable types have any of the built-in types that support the + operator as the underlying type.
Numeric types have any of the built-in numeric types as the underlying type.
Real types have any of the built-in integer or float types (but not complex) as the underlying type.

# Type aliases

DisjointSets implements union-find algorithms for disjoint sets.
Set is a generic set type based on map.
Vec3 is a three-dimensional vector type over E.
Vec4 is a four-dimensional vector type over E.