Documentation ¶
Index ¶
- func EuclidianDistance(pnt1, pnt2 Point) float64
- func RedMeanDistance(pnt1, pnt2 *Point) float64
- type Bounds
- type Point
- type PointSet
- func (ps *PointSet) BranchByMedian(axis int) (PointSet, PointSet, Point)
- func (ps *PointSet) ChunkPoints(n int) [][]Point
- func (ps *PointSet) ChunkPointsMiniBatch(n, batchSize int) [][]Point
- func (ps *PointSet) Contains(point Point) (bool, int)
- func (ps *PointSet) Kardinality() int
- func (ps *PointSet) LowerAndUpperBounds() []Bounds
- func (ps *PointSet) Mean() Point
- func (ps *PointSet) Remove(index int)
- func (ps *PointSet) SortByAxis(axis int)
- type Vec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EuclidianDistance ¶
EuclidianDistance returns the euclidian distance of two points
func RedMeanDistance ¶
RedMeanDistance returns the red mean distance of two color points, thus only works with the first 3 dimensions of the points
Types ¶
type Point ¶
Point is a collection of coordinates, with an identifier
type PointSet ¶
type PointSet struct {
Points []Point
}
PointSet implements a slice of points
func (*PointSet) BranchByMedian ¶
BranchByMedian splits a PointSet in a left and a right PointSet, and also returns the Point that splits the two. This is done by sorting on one axis (see (*PointSet).SortByAxis())
func (*PointSet) ChunkPoints ¶
ChunkPoints splits the given PointSet in n chunks. The last chunk might be smaller if chunkSize is not a factor of len(PointSet.Points)
func (*PointSet) ChunkPointsMiniBatch ¶ added in v0.8.0
ChunkPointsMiniBatch splits the given PointSet in n chunks. "MiniBatch" refers to the fact that not all points will be used in the returned slice. This function shuffles the PointSet!
func (*PointSet) Contains ¶
Contains determines wheter or not, and where, the given Point resides in the PointSet
func (*PointSet) Kardinality ¶
Kardinality returns the kardinality doesn't it
func (*PointSet) LowerAndUpperBounds ¶
LowerAndUpperBounds returns Bounds for each dimension of the space wherein the Points of PointSet live. Returned value is a collection of lower and upper bounds, one Bounds for each dimension!
func (*PointSet) Remove ¶
Remove removes the element at index from the PointSet, if a valid index is supplied
func (*PointSet) SortByAxis ¶
SortByAxis sorts all Points in the PointSet in ascending order of certain provided axis numbers coordinate.