arrays

package
v0.0.0-...-e1d4e1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2020 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistributedTriangleVectors

func DistributedTriangleVectors(objectives, populationSize int) [][]float64

DistributedTriangleVectors creates a n*m matrix where n = objectives and m = population size. The algorithm creates new vertices in the n dimensional space until the row number is bigger than m. With this approach an even distribution is not always possible, but a good distribution can be reached.

func EqualInterval

func EqualInterval(length int, min, max float64) (interval [][]float64)

func EuclideanDistance

func EuclideanDistance(a, b []float64) float64

func IdentityMatrix

func IdentityMatrix(n int) [][]float64

func Includes

func Includes(arr []int, val int) bool

func IncreasingIntsN

func IncreasingIntsN(n int) []int

func Middle

func Middle(a, b []float64) []float64

func MiddleVector

func MiddleVector(a, b []float64) []float64

func Min

func Min(floats ...float64) (min float64)

func NearestNeighbour

func NearestNeighbour(arr []Vector, i, T int) []int

NearestNeighbour calculates the closest T vectors for vector i in the set arr. NOTE the implementation makes the assumption that the vector i is it's own closest neighbour. The MOEA/D framework also makes this assumption

func Normalise

func Normalise(a []float64) []float64

func Remove

func Remove(arr []int, i int) []int

func Sum

func Sum(arr []float64) float64

func SumInt

func SumInt(arr []int) int

func Zeros2DFloat64

func Zeros2DFloat64(outerLength, innerLength int) [][]float64

Zeros2DFloat64 creates a new 2D array with dimension defined by outerlength and innerlength. All values are set to 0

Types

type Vector

type Vector struct {
	Size int
	// contains filtered or unexported fields
}

func UniformDistributedVectors

func UniformDistributedVectors(m, H int) []Vector

UniformDistributedVectors generates a set of uniformly distributed vectors

func (*Vector) Dist

func (v *Vector) Dist(u Vector) float64

func (*Vector) Fill

func (v *Vector) Fill(n float64)

func (*Vector) Get

func (v *Vector) Get(i int) float64

func (*Vector) Length

func (v *Vector) Length() float64

func (*Vector) Mult

func (v *Vector) Mult(n float64)

func (*Vector) Set

func (v *Vector) Set(i int, val float64)

func (Vector) Sum

func (v Vector) Sum() float64

func (*Vector) Zeros

func (v *Vector) Zeros()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL