vlib

package module
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: GPL-2.0 Imports: 24 Imported by: 25

README

vlib

Vector Library

Documentation

Overview

Package vlib gonum.go friendly C and R vectors Based on gonum/examples - This example shows how simple user types can be constructed to implement basic vector functionality within the mat package.

Helps interface plotter XYers with vlib library routines

Package vlib provides some trivial functions for vector of int,float64,complex128 and bits. Each corresponding vector is extended from the standard array of data types. Hence it can be type-casted anytime and interface with other libraries

Package vlib provides some trivial functions for vector of int,float64,complex128 and bits. Each corresponding vector is extended from the standard array of data types. Hence it can be type-casted anytime and interface with other libraries

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(array interface{}, elem interface{}) (found bool, index int)

func Conv

func Conv(input, filt []float64, trunc bool) []float64

func Conv2

func Conv2(X mat.Matrix, filt []float64, trunc bool) *mat.Dense

Conv2 Implements 2D convolution Vertical then Horizontal

func Db

func Db(linearValue float64) float64

func Dot

func Dot(input1 VectorF, input2 VectorF) float64

func DotC

func DotC(input1 VectorC, input2 VectorC) complex128

func Dotu

func Dotu(input1 VectorC, input2 VectorC) complex128

Dotu implements the cblas128 based operation

func DumpMap2CSV

func DumpMap2CSV(fname string, arg interface{})

func DumpMap2CSV2

func DumpMap2CSV2(fname string, arg interface{})

DumpMap2CSV2 dumps all the fields including numbers and strings to CSV

func ElemAddCmplx

func ElemAddCmplx(in1, in2 []complex128) []complex128

func Energy

func Energy(v VectorF) float64

Energy returns the sum of square of the elements in the vector

func EnergyC

func EnergyC(v VectorC) float64

EnergyC returns the sum of square of the elements sum(|x[i]|^2)) in the vector

func ExampleUserVectors

func ExampleUserVectors()

ExampleUserVectors

func GenType

func GenType(keyname string, val interface{}) map[string]interface{}

func GetEJtheta

func GetEJtheta(degree float64) complex128

func GetSize

func GetSize(v VectorIface) int64

func GoDotC

func GoDotC(input1 VectorC, input2 VectorC, splitN int) complex128

func InvDb

func InvDb(dBValue float64) float64

func IsTypeNumeric

func IsTypeNumeric(t reflect.Type) bool

func IsTypeString

func IsTypeString(t reflect.Type) bool

func LoadMapStructure

func LoadMapStructure(fname string, data interface{})

func LoadStructure

func LoadStructure(fname string, data interface{})

func MatchDim

func MatchDim(v, m Matrixer) bool

func Max

func Max(v VectorF) float64

func Mean

func Mean(v VectorF) float64

func MeanAndVariance

func MeanAndVariance(v VectorF) (mean, variance float64)

func MeanAndVarianceC

func MeanAndVarianceC(v VectorC) (mean complex128, variance float64)

MeanAndVarianceC finds the mean and variance of the vector <b>v</b>

vlib.MeanAndVariance(v)

func MeanC

func MeanC(v VectorC) complex128

MeanC returns the mean of the vector v

func Min

func Min(v VectorF) float64

func ModInt

func ModInt(number, N int) int

func Norm2

func Norm2(v VectorF) float64

returns 2nd Norm of the vector \Sqrt(sum(|x[i]|^2))

func Norm2C

func Norm2C(v VectorC) float64

Norm2C returns 2nd Norm of the vector sqrt(sum(|x[i]|^2))

func NormC

func NormC(v VectorF) float64

NormC returns Norm (sum(|x[i]-mean|^2))*(1/N) of the vector

func RMS

func RMS(v VectorF) float64

RMS returns the root-mean-square of the vector

func Radian

func Radian(degree float64) float64

func RandChars

func RandChars(size int) []uint8

func RandI

func RandI(size int, maxvalue int) []int

func RandNC

func RandNC(variance float64) complex128

Generates Normal (Gaussian) distributed complex number

func RandNF

func RandNF(variance float64) float64

RandNF generates random float values with distribution N(0,var) - Guassian/Normal

func RandUC

func RandUC(variance float64) complex128

RandUC generates Uniformly distributed complex number, Both real and imaginary part are uniformly distributed

func RelativeGeo

func RelativeGeo(src, dest Location3D) (distance3d, thetaH, thetaV float64)

func Resizer

func Resizer(v Matrixer, rows, cols int)

func SaveMapStructure

func SaveMapStructure(data interface{}, fname string, formated ...bool)

func SaveMapStructure2

func SaveMapStructure2(data interface{}, fname, keyname, valname string, formated ...bool)

func SaveStructure

func SaveStructure(data interface{}, fname string, formated ...bool)

func Sinc

func Sinc(x float64) float64

func Sorted

func Sorted(data VectorF) (values VectorF, indx VectorI)

func Struct2Header

func Struct2Header(a interface{}) ([]string, error)

Internal utility to convert a struct into array of strings

func Struct2Strings

func Struct2Strings(a interface{}) ([]string, error)

Internal utility to convert a struct into array of strings

func StructNum2Strings

func StructNum2Strings(a interface{}) ([]string, error)

Internal utility to convert a struct into array of strings

func Sum

func Sum(v VectorF) float64

func SumC

func SumC(v VectorC) complex128

func SumDb

func SumDb(dBVals ...float64) float64

/ SumDb sums the Db values in linear scale and returns back in DB

func ToDegree

func ToDegree(radian float64) float64

func ToMap

func ToMap(in interface{}) (map[string]interface{}, error)

func ToRadian

func ToRadian(degree float64) float64

func Variance

func Variance(v VectorF) float64

Variance returns Norm of the vector

func VarianceC

func VarianceC(v VectorC) float64

VarianceC calculates the Euclidean Norm i.e (sum(|x[i]-mean|^2))*(1/N-1) of the vector

func WrapAngle

func WrapAngle(degree0to360 float64) (degreePlusMinus180 float64)

Types

type C

type C []float64

C is a user-defined C vector.

func (C) At

func (v C) At(i, _ int) float64

func (C) Dims

func (v C) Dims() (r, c int)

Dims, At and T minimally satisfy the mat.Matrix interface.

func (C) RawVector

func (v C) RawVector() blas64.Vector

RawVector allows fast path computation with the vector.

func (C) T

func (v C) T() mat.Matrix

type CirBuffer

type CirBuffer struct {
	Maxlen int
	// contains filtered or unexported fields
}

func NewCirBuffer

func NewCirBuffer(n int) *CirBuffer

func (*CirBuffer) Pop

func (p *CirBuffer) Pop() (value int)

func (*CirBuffer) Push

func (p *CirBuffer) Push(n int)

type Complex

type Complex complex128

Complex type for overriding JSON and other parsing

func (Complex) MarshalJSON

func (c Complex) MarshalJSON() ([]byte, error)

func (Complex) String

func (c Complex) String() string

func (*Complex) UnmarshalJSON

func (c *Complex) UnmarshalJSON(data []byte) error

type GComplexVector

type GComplexVector struct {
	VectorIface
	// contains filtered or unexported fields
}

func (*GComplexVector) SetSize

func (v *GComplexVector) SetSize(size int)

type GDoubleVector

type GDoubleVector struct {
	VectorIface
	// contains filtered or unexported fields
}

func (*GDoubleVector) SetSize

func (v *GDoubleVector) SetSize(size int)

func (GDoubleVector) String

func (v GDoubleVector) String() string

type GIntVector

type GIntVector struct {
	VectorIface
	// contains filtered or unexported fields
}

func (*GIntVector) SetSize

func (v *GIntVector) SetSize(size int)

func (GIntVector) String

func (v GIntVector) String() string

type Location3D

type Location3D struct {
	X, Y, Z float64
}
var Origin3D Location3D

type Complex complex128

func FromCmplx

func FromCmplx(val complex128) Location3D

func LoadLocationsFromFile

func LoadLocationsFromFile(fcsvname, separator string) []Location3D

func (Location3D) Cmplx

func (l Location3D) Cmplx() complex128

func (*Location3D) Distance2DFrom

func (l *Location3D) Distance2DFrom(src Location3D) float64

func (*Location3D) DistanceFrom

func (l *Location3D) DistanceFrom(src Location3D) float64

func (*Location3D) Float32

func (l *Location3D) Float32() []float32

func (*Location3D) Float64

func (l *Location3D) Float64() []float64

func (*Location3D) FromCmplx

func (l *Location3D) FromCmplx(val complex128)

func (*Location3D) FromSpherical

func (l *Location3D) FromSpherical(r, thetaH, thetaV float64)

FromSpherical converts the r,thetaH and thetaV (all in degree to Cartesian)

func (*Location3D) Length

func (l *Location3D) Length() float64

func (Location3D) Scale

func (l Location3D) Scale(factor float64) Location3D

func (Location3D) Scale3D

func (l Location3D) Scale3D(factor float64) Location3D

func (*Location3D) SetHeight

func (l *Location3D) SetHeight(height float64)

func (*Location3D) SetLoc

func (l *Location3D) SetLoc(loc2D complex128, height float64)

func (*Location3D) SetXY

func (l *Location3D) SetXY(x, y float64)

func (*Location3D) SetXYZ

func (l *Location3D) SetXYZ(x, y, z float64)

func (*Location3D) Shift2D

func (l *Location3D) Shift2D(deltaxy complex128)

func (Location3D) Shift3D

func (l Location3D) Shift3D(delta Location3D) Location3D

func (*Location3D) ToSpherical

func (l *Location3D) ToSpherical() (r, thetaH, thetaV float64)

func (*Location3D) XY

func (l *Location3D) XY() complex128

func (*Location3D) XZ

func (l *Location3D) XZ() complex128

type Matlab

type Matlab struct {
	Silent bool

	Keys    []string
	Encoder *json.Encoder

	Json bool
	// contains filtered or unexported fields
}

func NewMatlab

func NewMatlab(fname string) *Matlab

func (*Matlab) AddText

func (m *Matlab) AddText(pos complex128, text string) string

func (*Matlab) Close

func (m *Matlab) Close() error

func (*Matlab) Command

func (m *Matlab) Command(cmd string)

func (*Matlab) Export

func (m *Matlab) Export(varname string, data interface{})

func (*Matlab) ExportStruct

func (m *Matlab) ExportStruct(keyname string, val interface{})

func (*Matlab) Flush

func (m *Matlab) Flush()

func (*Matlab) Name

func (m *Matlab) Name() string

func (*Matlab) Q

func (m *Matlab) Q(cmd string)

func (*Matlab) SetDefaults

func (m *Matlab) SetDefaults()

func (*Matlab) SetFile

func (m *Matlab) SetFile(fname string)

func (*Matlab) SetWriter

func (m *Matlab) SetWriter(w io.Writer)

type Matrix

type Matrix []Vector

type MatrixC

type MatrixC []VectorC

func MulC

func MulC(input1 MatrixC, input2 MatrixC) MatrixC

MulC implements the cblas128 based operation

func NewMatrixC

func NewMatrixC(rows, cols int) MatrixC

func RandNMatrixC

func RandNMatrixC(rows, cols int, variance float64) MatrixC

func ToMatrixC

func ToMatrixC(re MatrixF) MatrixC

func ToMatrixC2

func ToMatrixC2(re, im MatrixF) MatrixC

func (*MatrixC) AppendColumn

func (m *MatrixC) AppendColumn(colvec VectorC)

func (*MatrixC) AppendNCols

func (m *MatrixC) AppendNCols(n int)

func (*MatrixC) AppendNRows

func (m *MatrixC) AppendNRows(n int)

func (MatrixC) Data

func (m MatrixC) Data() []complex128

Data returns the data in the matrix .. row and then column wise

func (MatrixC) GetCol

func (m MatrixC) GetCol(c int) VectorC

func (MatrixC) GetRow

func (m MatrixC) GetRow(row int) VectorC

func (MatrixC) IsEq

func (m MatrixC) IsEq(val MatrixC) bool

func (MatrixC) MatString

func (m MatrixC) MatString() string

func (MatrixC) Minus

func (m MatrixC) Minus(val MatrixC) MatrixC

output.Minus(exOutput)

func (MatrixC) NCols

func (m MatrixC) NCols() (cols int)

func (MatrixC) NRows

func (m MatrixC) NRows() (rows int)

func (*MatrixC) Scale

func (m *MatrixC) Scale(val float64)

func (*MatrixC) ScaleC

func (m *MatrixC) ScaleC(val complex128)

func (*MatrixC) SetCol

func (m *MatrixC) SetCol(scol int, colVector VectorC)

func (MatrixC) Size

func (m MatrixC) Size() (rows, cols int)

func (MatrixC) String

func (m MatrixC) String() string

func (*MatrixC) T

func (m *MatrixC) T() MatrixC

type MatrixF

type MatrixF []VectorF

func CreateMatrixF

func CreateMatrixF(matrix MatrixF) MatrixF

func Mul

func Mul(input1 MatrixF, input2 MatrixF) MatrixF

Mul implements the cblas128 based operation

func NewDiagMatF

func NewDiagMatF(input VectorF) MatrixF

func NewEyeF

func NewEyeF(rows int) MatrixF

func NewMatrixF

func NewMatrixF(rows, cols int) MatrixF

func NewOnesMatF

func NewOnesMatF(rows, cols int) MatrixF

func RandNMatrix

func RandNMatrix(rows, cols int, variance float64) MatrixF

func RandUMatrix

func RandUMatrix(rows, cols int) MatrixF

func ReShape

func ReShape(v VectorF, rows, cols int) MatrixF

func (*MatrixF) AppendColumn

func (m *MatrixF) AppendColumn(colvec VectorF) *MatrixF

func (*MatrixF) AppendNCols

func (m *MatrixF) AppendNCols(n int)

func (*MatrixF) AppendNRows

func (m *MatrixF) AppendNRows(n int)

func (*MatrixF) AppendRow

func (m *MatrixF) AppendRow(v VectorF)

func (MatrixF) DeleteColumn

func (m MatrixF) DeleteColumn(col int) MatrixF

func (MatrixF) Elems

func (m MatrixF) Elems() VectorF

func (MatrixF) Get

func (m MatrixF) Get(row, col int) float64

func (MatrixF) GetCol

func (m MatrixF) GetCol(col int) VectorF

func (MatrixF) GetColRange

func (m MatrixF) GetColRange(begin, end int) MatrixF

func (MatrixF) GetCols

func (m MatrixF) GetCols(col ...int) MatrixF

func (MatrixF) GetDiagF

func (m MatrixF) GetDiagF() VectorF

func (MatrixF) GetRow

func (m MatrixF) GetRow(row int) VectorF

func (MatrixF) GetSubMatF

func (m MatrixF) GetSubMatF(srow, scol, rows, cols int) MatrixF

func (MatrixF) Insert

func (m MatrixF) Insert(pos int) MatrixF

func (MatrixF) InsertColumn

func (m MatrixF) InsertColumn(pos int, val float64) MatrixF

func (MatrixF) InsertColumnVector

func (m MatrixF) InsertColumnVector(pos int, input VectorF) MatrixF

func (MatrixF) InsertOnes

func (m MatrixF) InsertOnes(pos int) MatrixF

func (MatrixF) IsEq

func (m MatrixF) IsEq(val MatrixF) bool

func (MatrixF) Len

func (m MatrixF) Len() int

func (MatrixF) Minus

func (m MatrixF) Minus(val MatrixF) MatrixF

output.Minus(exOutput)

func (MatrixF) NCols

func (m MatrixF) NCols() (cols int)

func (MatrixF) NRows

func (m MatrixF) NRows() (rows int)

func (*MatrixF) SetCol

func (m *MatrixF) SetCol(scol int, colVector VectorF)

func (*MatrixF) SetRow

func (m *MatrixF) SetRow(srow int, rowVector VectorF)

func (*MatrixF) SetSubMatF

func (m *MatrixF) SetSubMatF(srow, scol int, input MatrixF)

func (MatrixF) Size

func (m MatrixF) Size() (rows, cols int)

func (MatrixF) String

func (m MatrixF) String() string

func (MatrixF) T

func (m MatrixF) T() MatrixF

/ Transposes the matrix

func (MatrixF) XY

func (m MatrixF) XY(i int) (x, y float64)

func (MatrixF) XYZ

func (m MatrixF) XYZ(i int) (x, y, z float64)

type Matrixer

type Matrixer interface {
	NRows() int
	NCols() int
	Size() (int, int)
	AppendNRows(int)
	AppendNCols(int)
}

func Resize

func Resize(v Matrixer, rows, cols int) Matrixer

/ Resizes the input matrix by either padding zeros or trucating rows/cols as per need

type Obj

type Obj struct {
	ObjectID interface{}
	Object   interface{}
	// contains filtered or unexported fields
}

func SaveMapStructure(data interface{}, fname, keyname, valname string, formated ...bool) { }

func (Obj) MarshalJSON

func (o Obj) MarshalJSON() ([]byte, error)

func (*Obj) UnmarshalJSON

func (o *Obj) UnmarshalJSON(bfr []byte) error

type Point

type Point struct {
	X float64
	Y float64
}

type PointA

type PointA []Point

func FromVecCabs

func FromVecCabs(f VectorC) PointA

func FromVecCreal

func FromVecCreal(f VectorC) PointA

func FromVecF

func FromVecF(f VectorF) PointA

func (PointA) String

func (p PointA) String() string

type R

type R []float64

R is a user-defined R vector.

func (R) At

func (v R) At(_, j int) float64

func (R) Dims

func (v R) Dims() (r, c int)

Dims, At and T minimally satisfy the mat.Matrix interface.

func (R) RawVector

func (v R) RawVector() blas64.Vector

RawVector allows fast path computation with the vector.

func (R) T

func (v R) T() mat.Matrix

type Table

type Table []VectorF

type VSliceF

type VSliceF struct {
	sort.Float64Slice
	// contains filtered or unexported fields
}

func NewVSliceF

func NewVSliceF(n ...float64) *VSliceF

func (VSliceF) SIndex

func (v VSliceF) SIndex() []int

func (*VSliceF) Swap

func (s *VSliceF) Swap(i, j int)

type Vector

type Vector []int

func ElemMult

func ElemMult(in1, in2 Vector) Vector

ElemMult does element-wise multiplication of vectors in1 and in2

Matlab:

y=in1.*in2

func New

func New(size int) Vector

func NewOnes

func NewOnes(size int) (v Vector)

func (*Vector) Ones

func (v *Vector) Ones()

func (*Vector) Resize

func (v *Vector) Resize(size int)

func (Vector) ScaleInt

func (v Vector) ScaleInt(factor int) Vector

func (Vector) Scaleloat64

func (v Vector) Scaleloat64(factor float64) VectorF

func (Vector) Size

func (v Vector) Size() int

type Vector2D

type Vector2D struct {
	X, Y VectorF
}

Vector2D is a XYer interface based on two VectorF

func (Vector2D) Len

func (v Vector2D) Len() int

Len returns the length of the XY

func (Vector2D) XY

func (v Vector2D) XY(i int) (X, Y float64)

XY returns X and Y value of the sample i

type VectorB

type VectorB []uint8

func ElemAddB

func ElemAddB(in1, in2 VectorB) VectorB

Does elementwise XOR addition between vectors

func ElemMultB

func ElemMultB(in1, in2 VectorB) VectorB

Does elementwise Multiplication (AND operator) addition between vectors

func NewOnesB

func NewOnesB(size int) (v VectorB)

func NewVectorB

func NewVectorB(size int) VectorB

func RandB

func RandB(N int) VectorB

RandB generates a vector of N random bits

func RandReadableChars

func RandReadableChars(N int) VectorB

RandReadableChars returns N printable random characters char=32 to 126

func RandString

func RandString(N int) VectorB

RandString returns N numbers or alphabets

func ToVectorB

func ToVectorB(str string) VectorB

func (VectorB) At

func (v VectorB) At(indx VectorI) VectorB

func (VectorB) Clone

func (v VectorB) Clone() VectorB

func (VectorB) ErrorCount

func (v VectorB) ErrorCount(compare VectorB) int

func (VectorB) Get

func (v VectorB) Get(indx int) uint8

func (VectorB) Len

func (v VectorB) Len() int

func (*VectorB) Resize

func (v *VectorB) Resize(size int)

func (VectorB) Scale

func (v VectorB) Scale(n int) VectorI

func (VectorB) Scale2n

func (v VectorB) Scale2n(n uint) VectorB

func (VectorB) Size

func (v VectorB) Size() int

type VectorBool

type VectorBool []bool

type VectorC

type VectorC []complex128

func AddC

func AddC(A, B VectorC) VectorC

AddC returns the sum of two vectors A and B

func Conj

func Conj(in1 VectorC) VectorC

func ElemMultC

func ElemMultC(in1, in2 VectorC) VectorC

//// Methods over the Complex Vector

func Location3DtoVecC

func Location3DtoVecC(locs []Location3D) VectorC

func NewOnesC

func NewOnesC(size int) (v VectorC)

func NewVectorC

func NewVectorC(size int) VectorC

func ParseCVec

func ParseCVec(str string) VectorC

func RandBPSK

func RandBPSK(samples int, variance float64) VectorC

RandBPSK Generates a VectorC from BPSK symbols

func RandNCVec

func RandNCVec(samples int, variance float64) VectorC

Generates a complex vector with values Normally distributed

func RandPI2BPSK

func RandPI2BPSK(samples int, variance float64) VectorC

RandBPSK Generates a VectorC from BPSK symbols

func RandQPSK

func RandQPSK(samples int, variance float64) VectorC

RandBPSK Generates a VectorC from BPSK symbols

func RandUCVec

func RandUCVec(samples int, variance float64) VectorC

Generates a complex vector with values uniformly distributed

func SubC

func SubC(A, B VectorC) VectorC

AddC returns the Difference (A-B) of two vectors A,B

func ToVectorC

func ToVectorC(input VectorF) VectorC

func ToVectorC2

func ToVectorC2(re, im VectorF) VectorC

func (VectorC) Abs

func (v VectorC) Abs() VectorF

func (VectorC) AddC

func (v VectorC) AddC(arg complex128) VectorC

func (VectorC) AddVector

func (v VectorC) AddVector(input VectorC) VectorC

func (*VectorC) AppendAtEnd

func (v *VectorC) AppendAtEnd(val ...complex128)

func (VectorC) Delete

func (v VectorC) Delete(pos int) VectorC

func (*VectorC) Fill

func (v *VectorC) Fill(val complex128)

Fill sets all the elements of the vector to `val`

func (VectorC) Imag

func (v VectorC) Imag() VectorF

func (VectorC) Insert

func (v VectorC) Insert(pos int, val complex128) VectorC

func (VectorC) IsEq

func (v VectorC) IsEq(vals VectorC) bool

func (VectorC) MarshalJSON

func (c VectorC) MarshalJSON() ([]byte, error)

func (VectorC) MatString

func (v VectorC) MatString() string

func (VectorC) Normalize

func (v VectorC) Normalize() (result VectorC, mean complex128, factor float64)

Normalizes with 0 mean, and unit variance

func (*VectorC) Ones

func (v *VectorC) Ones()

Ones sets all the elements of the vector to One

func (*VectorC) OnesF

func (v *VectorC) OnesF()

func (*VectorC) PlusEqual

func (v *VectorC) PlusEqual(input VectorC)

func (VectorC) Real

func (v VectorC) Real() VectorF

func (*VectorC) Resize

func (v *VectorC) Resize(size int)

func (VectorC) Scale

func (v VectorC) Scale(factor float64) VectorC

func (VectorC) ScaleAndShift

func (v VectorC) ScaleAndShift(shift, scale complex128) VectorC

ScaleAndShift returns scale*x+shift for the vector x

func (VectorC) ScaleC

func (v VectorC) ScaleC(factor complex128) VectorC

func (*VectorC) SetVectorF

func (v *VectorC) SetVectorF(input VectorF)

func (*VectorC) Shift

func (v *VectorC) Shift(input VectorC)

func (VectorC) ShiftAndScale

func (v VectorC) ShiftAndScale(shift, scale complex128) VectorC

func (VectorC) ShiftLeft

func (v VectorC) ShiftLeft(val complex128) VectorC

Input element is pushed to end of the vector and first element is removed

func (VectorC) Size

func (v VectorC) Size() int

func (VectorC) String

func (v VectorC) String() string

func (VectorC) ToUnitEnergy

func (v VectorC) ToUnitEnergy() (result VectorC, factor float64)

func (*VectorC) UnmarshalJSON

func (c *VectorC) UnmarshalJSON(databyte []byte) error

func (*VectorC) Zeros

func (v *VectorC) Zeros()

Zeros sets all the elements of the vector to zero

type VectorF

type VectorF []float64

func Add

func Add(A, B VectorF) VectorF

func ElemDivF

func ElemDivF(in1, in2 VectorF) VectorF

func ElemMultF

func ElemMultF(in1, in2 VectorF) VectorF

func Flip

func Flip(input VectorF) VectorF

func InvDbF

func InvDbF(in1 VectorF) VectorF

func IterateF

func IterateF(input VectorF, myfunc func(float64) float64) VectorF

func Log

func Log(vec VectorF) (result VectorF)

func NewOnesF

func NewOnesF(size int) (v VectorF)

func NewSegmentF

func NewSegmentF(begin, step float64, size int) VectorF

NewSegmentI generates a sequence of int values starting from BEGIN of

length SIZE, e.g NewSegmentF(0,0.5,4) = [0,0.5,1,1.5]

func NewVectorF

func NewVectorF(size int) VectorF

func RandBitsF

func RandBitsF(size int) VectorF

func RandNFVec

func RandNFVec(samples int, variance float64) VectorF

func RandUFVec

func RandUFVec(size int) VectorF

Generates Uniformly distributed Float Vector of size size Values between 0 to 1 uses rand.Float64()

func SincF

func SincF(x VectorF) VectorF

func Sub

func Sub(A, B VectorF) VectorF

func ToVectorF

func ToVectorF(str string) VectorF

func (VectorF) Add

func (v VectorF) Add(offset float64) VectorF

func (VectorF) AddVector

func (v VectorF) AddVector(input VectorF) VectorF

func (*VectorF) AppendAtEnd

func (v *VectorF) AppendAtEnd(val ...float64)

func (VectorF) At

func (v VectorF) At(indx VectorI) VectorF

func (VectorF) Clone

func (v VectorF) Clone() VectorF

func (VectorF) Contains

func (v VectorF) Contains(x float64) bool

func (VectorF) Delete

func (v VectorF) Delete(pos int) VectorF

func (*VectorF) Fill

func (v *VectorF) Fill(val float64)

func (VectorF) Find

func (v VectorF) Find(x float64) VectorI

func (VectorF) FindGreater

func (v VectorF) FindGreater(x float64) VectorI

func (VectorF) FindLess

func (v VectorF) FindLess(x float64) VectorI

func (VectorF) FindSorted

func (v VectorF) FindSorted(x float64) int

Assumes descending ordered vector

func (VectorF) Flip

func (v VectorF) Flip() VectorF

func (VectorF) Get

func (v VectorF) Get(indx int) float64

func (VectorF) Insert

func (v VectorF) Insert(pos int, val float64) VectorF

func (VectorF) IsEq

func (v VectorF) IsEq(vals VectorF) bool

func (VectorF) Len

func (v VectorF) Len() int

func (VectorF) Less

func (v VectorF) Less(i, j int) bool

func (VectorF) MatString

func (v VectorF) MatString() string

func (VectorF) Min

func (v VectorF) Min() float64

func (VectorF) Normalize

func (v VectorF) Normalize() (result VectorF, mean, factor float64)

Normalizes with 0 mean, and unit variance

func (*VectorF) Ones

func (v *VectorF) Ones()

func (*VectorF) OnesF

func (v *VectorF) OnesF()

func (*VectorF) PlusEqual

func (v *VectorF) PlusEqual(input VectorF)

func (*VectorF) Resize

func (v *VectorF) Resize(size int)

func (VectorF) Scale

func (v VectorF) Scale(factor float64) VectorF

func (VectorF) ScaleAndShift

func (v VectorF) ScaleAndShift(shift, scale float64) VectorF

func (*VectorF) SetSubVec

func (v *VectorF) SetSubVec(pos int, vals VectorF)

func (VectorF) ShiftAndScale

func (v VectorF) ShiftAndScale(shift, scale float64) VectorF

func (VectorF) Size

func (v VectorF) Size() int

func (VectorF) Sorted

func (v VectorF) Sorted() (sorted VectorF)

Sorts the vector in Ascending order by default

func (VectorF) Sorted2

func (v VectorF) Sorted2() (sorted VectorF, indx VectorI)

Sorts the vector in Ascending order by default

func (VectorF) String

func (v VectorF) String() string

func (VectorF) Sub

func (v VectorF) Sub(offset float64) VectorF

func (VectorF) SubV

func (v VectorF) SubV(rhs VectorF) VectorF

func (*VectorF) Swap

func (v *VectorF) Swap(i, j int)

func (VectorF) ToCSV

func (v VectorF) ToCSV() []string

func (VectorF) ToCSVStr

func (v VectorF) ToCSVStr() string

func (VectorF) Value

func (v VectorF) Value(i int) float64

Value supports Valuer interface for the gonum/Plot tools

func (VectorF) XY

func (v VectorF) XY(i int) (float64, float64)

XY to support plotters

func (*VectorF) Zeros

func (v *VectorF) Zeros()

type VectorI

type VectorI []int

func GetIntKeys

func GetIntKeys(data interface{}) VectorI

func NewSegmentI

func NewSegmentI(begin, size int) VectorI

NewSegmentI generates a sequence of int values starting from BEGIN of

length SIZE, e.g NewSegmentI(5,3) = [5,6,7]

func NewVectorI

func NewVectorI(size int) VectorI

func Randsrc

func Randsrc(size int, maxvalue int) VectorI

func ToVectorI

func ToVectorI(str string) VectorI

func (VectorI) Add

func (v VectorI) Add(offset int) VectorI

func (*VectorI) AppendAtEnd

func (v *VectorI) AppendAtEnd(val ...int)

func (VectorI) At

func (v VectorI) At(indx ...int) VectorI

func (VectorI) AtVec

func (v VectorI) AtVec(i, j int) float64

func (VectorI) Contains

func (v VectorI) Contains(x int) bool

func (*VectorI) Decode

func (c *VectorI) Decode(databyte []byte) error

func (VectorI) Delete

func (v VectorI) Delete(pos int) VectorI

func (VectorI) Find

func (v VectorI) Find(x int) int

func (VectorI) Flip

func (v VectorI) Flip() VectorI

func (VectorI) Get

func (v VectorI) Get(indx int) int

func (*VectorI) MarshalJSON

func (c *VectorI) MarshalJSON() ([]byte, error)

func (*VectorI) Resize

func (v *VectorI) Resize(size int)

func (VectorI) Scale

func (v VectorI) Scale(offset int) VectorI

func (*VectorI) SetSubVec

func (v *VectorI) SetSubVec(pos int, vals VectorI)

func (VectorI) Size

func (v VectorI) Size() int

func (VectorI) Sub

func (v VectorI) Sub(offset int) VectorI

func (VectorI) ToCSV

func (v VectorI) ToCSV() []string

func (VectorI) ToCSVStr

func (v VectorI) ToCSVStr() string

func (VectorI) ToVectorF

func (v VectorI) ToVectorF() VectorF

func (*VectorI) UnmarshalJSON

func (c *VectorI) UnmarshalJSON(databyte []byte) error

type VectorIface

type VectorIface interface {
}

type VectorPos3D

type VectorPos3D []Location3D

Array of Location3D, supports plotter XYer, XYZer

func FromVectorC

func FromVectorC(loc2d VectorC, height float64) VectorPos3D

func (VectorPos3D) Len

func (v VectorPos3D) Len() int

func (VectorPos3D) X

func (v VectorPos3D) X() VectorF

func (VectorPos3D) XY

func (v VectorPos3D) XY(i int) (x, y float64)

func (VectorPos3D) Y

func (v VectorPos3D) Y() VectorF

func (VectorPos3D) Z

func (v VectorPos3D) Z() VectorF

Jump to

Keyboard shortcuts

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