Documentation
¶
Index ¶
- func Abs[T constraints.Integer | constraints.Float](a []T) []T
- func AbsInPlace[T constraints.Integer | constraints.Float](a []T)
- func Add[T constraints.Integer | constraints.Float](a, b []T) []T
- func AddInPlace[T constraints.Integer | constraints.Float](a, b []T)
- func AddNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
- func AddNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
- func DivideNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
- func DivideNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
- func Dot[T constraints.Integer | constraints.Float](a, b []T) T
- func EuclidianDistance[T constraints.Integer | constraints.Float](a, b []T) float64
- func Magnitude[T constraints.Integer | constraints.Float](a []T) float64
- func Max[T constraints.Integer | constraints.Float](a []T) T
- func Mean[T constraints.Integer | constraints.Float](a []T) float64
- func Min[T constraints.Integer | constraints.Float](a []T) T
- func MultiplyNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
- func MultiplyNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
- func Normalize[T constraints.Integer | constraints.Float](a []T) []float64
- func Product[T constraints.Integer | constraints.Float](a []T) T
- func Subtract[T constraints.Integer | constraints.Float](a, b []T) []T
- func SubtractInPlace[T constraints.Integer | constraints.Float](a, b []T)
- func SubtractNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
- func SubtractNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
- func Sum[T constraints.Integer | constraints.Float](a []T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T constraints.Integer | constraints.Float](a []T) []T
Abs computes the absolute value of each element in a vector.
func AbsInPlace ¶
func AbsInPlace[T constraints.Integer | constraints.Float](a []T)
AbsInPlace computes the absolute value of each element in a vector and stores the result in the vector.
func Add ¶
func Add[T constraints.Integer | constraints.Float](a, b []T) []T
Add adds two vectors together and returns the result.
func AddInPlace ¶
func AddInPlace[T constraints.Integer | constraints.Float](a, b []T)
AddInPlace adds two vectors together and stores the result in the first vector.
func AddNumber ¶
func AddNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
AddNumber adds a number to each element of a vector and returns the result.
func AddNumberInPlace ¶
func AddNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
AddNumberInPlace adds a number to each element of a vector and stores the result in the vector.
func DivideNumber ¶
func DivideNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
DivideNumber divides each element of a vector by a number and returns the result.
func DivideNumberInPlace ¶
func DivideNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
DivideNumberInPlace divides each element of a vector by a number and stores the result in the vector.
func Dot ¶
func Dot[T constraints.Integer | constraints.Float](a, b []T) T
Dot computes the dot product of two vectors.
func EuclidianDistance ¶
func EuclidianDistance[T constraints.Integer | constraints.Float](a, b []T) float64
EuclidianDistance computes the Euclidian distance between two vectors.
func Magnitude ¶
func Magnitude[T constraints.Integer | constraints.Float](a []T) float64
Magnitude computes the magnitude of a vector.
func Max ¶
func Max[T constraints.Integer | constraints.Float](a []T) T
Max computes the maximum element in a vector.
func Mean ¶
func Mean[T constraints.Integer | constraints.Float](a []T) float64
func Mean computes the mean of a vector.
func Min ¶
func Min[T constraints.Integer | constraints.Float](a []T) T
Min computes the minimum element in a vector.
func MultiplyNumber ¶
func MultiplyNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
MultiplyNumber multiplies each element of a vector by a number and returns the result.
func MultiplyNumberInPlace ¶
func MultiplyNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
MultiplyNumberInPlace multiplies each element of a vector by a number and stores the result in the vector.
func Normalize ¶
func Normalize[T constraints.Integer | constraints.Float](a []T) []float64
Normalize normalizes a vector to have a magnitude of 1.
func Product ¶
func Product[T constraints.Integer | constraints.Float](a []T) T
Product computes the product of all elements in a vector.
func Subtract ¶
func Subtract[T constraints.Integer | constraints.Float](a, b []T) []T
Subtract subtracts one vector from another and returns the result.
func SubtractInPlace ¶
func SubtractInPlace[T constraints.Integer | constraints.Float](a, b []T)
SubtractInPlace subtracts one vector from another and stores the result in the first vector.
func SubtractNumber ¶
func SubtractNumber[T constraints.Integer | constraints.Float](a []T, b T) []T
SubtractNumber subtracts a number from each element of a vector and returns the result.
func SubtractNumberInPlace ¶
func SubtractNumberInPlace[T constraints.Integer | constraints.Float](a []T, b T)
SubtractNumberInPlace subtracts a number from each element of a vector and stores the result in the vector.
func Sum ¶
func Sum[T constraints.Integer | constraints.Float](a []T) T
Sum computes the sum of all elements in a vector.
Types ¶
This section is empty.