vectors

package
v0.0.0-...-0a688d3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 3 Imported by: 10

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Space

type Space int

Space is the space in which a vector lives. Either Column or Row space.

const (
	// RowSpace is a space Row Vector
	RowSpace Space = iota
	// ColSpace is a space Column Vector
	ColSpace
)

type Vector

type Vector interface {
	// Returns the index of vect. If vect is not in gcv it returns -1.
	IndexOf(val gcv.Value) int

	// Returns the Value at index
	Get(index int) gcv.Value

	// Set the Value val at index
	Set(index int, val gcv.Value)

	// Return norm of vector
	Norm() gcv.Value

	// return the normalized unit vector of Vector. will return error if norm is equal to 0.
	Unit() (Vector, error)

	// Returns a new Copy of vector
	Copy() Vector

	// Returns Space of vector. Either Column or Row vector
	Space() Space

	// Returns the core value type of the vector
	Type() gcv.Type

	// Returns the len of the gcv
	Len() int

	// Transpose of vector. i.e changes a row into a column vector and vice versa
	Trans()

	// Conjugate of a vector
	Conj()

	// Conjugate Transpose of vector. i.e changes a row into a column vector and vice versa
	ConjTrans()

	// Append a value to vector
	Append(val gcv.Value)

	// Returns the elements in the vector
	Elements() gcv.Values
}

Vector is the main vector interface for real vectors

func MakeConjTransVector

func MakeConjTransVector(v Vector) Vector

MakeConjTransVector returns a new conjugate transpose vector of vector

func MakeConjVector

func MakeConjVector(v Vector) Vector

MakeConjVector returns a new conjugate vector of vector

func MakeTransVector

func MakeTransVector(v Vector) Vector

MakeTransVector returns a new transpose vector of vector

func MakeVector

func MakeVector(space Space, elements ...interface{}) Vector

MakeVector returns Vector, takes in a slice of interfaces. in an interface is not a supported type, that interface will be forced to the zero Value

func MakeVectorAlt

func MakeVectorAlt(space Space, elements gcv.Values) Vector

MakeVectorAlt returns Vector, requires a framework gcv type

func NewVector

func NewVector(space Space, length int) Vector

NewVector returns zero vector of size length

type Vectors

type Vectors interface {
	// Returns the index of vect. If vect is not in Values it returns -1.
	IndexOf(vect Vector) int

	// Set the Vector vect at index. If vect is not in the space of other vectors
	// Trans() method will be called on it.
	Set(index int, vect Vector)

	// Set value j of vector i in vectors to val
	SetValue(i int, j int, val gcv.Value)

	// Append Vector vect to Vectors
	Append(vect Vector)

	// Returns the Vector at index
	Get(index int) Vector

	// Returns the Raw Vector slice. Used mainly for use with range
	Vectors() []Vector

	// Returns a subset of Vectors from start to finish
	Subset(start, finish int) Vectors

	// Returns a copy of Vectors.
	Copy() Vectors

	// Returns the length of Vectors slice. this is the same as the number of vectors in Vectors
	Len() int

	// Returns the length of the individual vectors in Vectors
	InnerLen() int

	// Returns the space that Vectors is in
	Space() Space

	// Returns the highest ranking vector type
	Type() gcv.Type
}

Vectors returns the set of vectors in a particular vector space

func MakeVectors

func MakeVectors(space Space, vects ...Vector) Vectors

MakeVectors will return a Vectors type. All vectors will be in vector space, space. If inputed vector is not in that vector space, Trans() will be called on it

func MakeVectorsAlt

func MakeVectorsAlt(space Space, vects []Vector) Vectors

MakeVectorsAlt returns a Vectors type, but requires a framework []Vector slice

func NewVectors

func NewVectors(space Space, numVectors, lenVectors int) Vectors

NewVectors will return the Zero Vectors. or numVectors of zero vectors of length lenVectors

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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