vec

package
v0.0.0-...-e16fa26 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[E constraintsExt.OrderedNumber](z, x Vector[E], m *Mask)

func Add

func Add[E constraintsExt.Number](z, x, y Vector[E], m *Mask)

func All

func All[X Bool](x X) bool

func And

func And[E constraints.Integer](z, x, y Vector[E], m *Mask)

func AndNot

func AndNot[E constraints.Integer](z, x, y Vector[E], m *Mask)

func Any

func Any[X Bool](x X) bool

func Broadcast

func Broadcast[E any](x E) *broadcast[E]

Broadcast returns a value that repeats for all lanes of any vector it is combined with.

func Convert

func Convert[To, From constraintsExt.ConvertableNumber, Z Vector[To], X Vector[From]](z Z, x X)

Convert returns a vector with all elements converted to another numeric type. Complex numbers cannot be converted to other types.

func ConvertComplex

func ConvertComplex[To, From constraints.Complex, Z Vector[To], X Vector[From]](z Z, x X)

ConvertComplex returns a vector with all elements converted to another complex numeric type.

func Copy

func Copy[E any, Z, X Vector[E]](z Z, x X, m *Mask)

func Count

func Count[X Bool](x X) int

func Div

func Div[E constraintsExt.Number](z, x, y Vector[E], m *Mask)

func Equal

func Equal[E comparable, Z Bool, XY Vector[E]](z Z, x, y XY)

func Greater

func Greater[E constraints.Ordered, Z Bool, XY Vector[E]](z Z, x, y XY)

func GreaterOrEqual

func GreaterOrEqual[E constraints.Ordered, Z Bool, XY Vector[E]](z Z, x, y XY)

func IsInf

func IsInf[E constraints.Float, Z Bool, X Vector[E]](z Z, x X, sign int)

func IsNaN

func IsNaN[E constraints.Float, Z Bool, X Vector[E]](z Z, x X)

func IsSet

func IsSet[X Bool](x X, lane int) bool

func LeadingZeros

func LeadingZeros[E constraints.Unsigned, Z Vector[int], X Vector[E]](z Z, x X, m *Mask)

func Less

func Less[E constraints.Ordered, Z Bool, XY Vector[E]](z Z, x, y XY)

func LessOrEqual

func LessOrEqual[E constraints.Ordered, Z Bool, XY Vector[E]](z Z, x, y XY)

func Max

func Max[E constraints.Ordered, XYZ Vector[E]](z, x, y XYZ, m *Mask)

func Min

func Min[E constraints.Ordered, XYZ Vector[E]](z, x, y XYZ, m *Mask)

func Mul

func Mul[E constraintsExt.Number](z, x, y Vector[E], m *Mask)

func Neg

func Neg[E constraintsExt.Number](z, x Vector[E], m *Mask)

func None

func None[X Bool](x X) bool

func Not

func Not[E constraints.Integer](z, x Vector[E], m *Mask)

func NotEqual

func NotEqual[E comparable, Z Bool, XY Vector[E]](z Z, x, y XY)

func OnesCount

func OnesCount[E constraints.Unsigned, Z Vector[int], X Vector[E]](z Z, x X, m *Mask)

func Or

func Or[E constraints.Integer](z, x, y Vector[E], m *Mask)

func Round

func Round[E constraints.Float, XZ Vector[E]](z, x XZ, m *Mask)

func RoundToEven

func RoundToEven[E constraints.Float, XZ Vector[E]](z, x XZ, m *Mask)

func ScalableVectorLen

func ScalableVectorLen[E any]() int

ScalableVectorLen returns the vector length that NewVector will use to create a vector of elements of type E.

func Set

func Set[Z Bool](z Z, lane int, value bool)

func SetAll

func SetAll[Z Bool](z Z)

func SetFirst

func SetFirst[Z Bool](z Z)

func SetLast

func SetLast[Z Bool](z Z)

func SetNone

func SetNone[Z Bool](z Z)

func Sub

func Sub[E constraintsExt.Number](z, x, y Vector[E], m *Mask)

func TrailingZeros

func TrailingZeros[E constraints.Unsigned, Z Vector[int], X Vector[E]](z Z, x X, m *Mask)

func Xor

func Xor[E constraints.Integer](z, x, y Vector[E], m *Mask)

Types

type Bool

type Bool interface {
	FixedBool | ScalableBool
	// contains filtered or unexported methods
}

type Bool1

type Bool1 struct {
	// contains filtered or unexported fields
}

type Bool16

type Bool16 struct {
	// contains filtered or unexported fields
}

type Bool2

type Bool2 struct {
	// contains filtered or unexported fields
}

type Bool32

type Bool32 struct {
	// contains filtered or unexported fields
}

type Bool4

type Bool4 struct {
	// contains filtered or unexported fields
}

type Bool64

type Bool64 struct {
	// contains filtered or unexported fields
}

type Bool8

type Bool8 struct {
	// contains filtered or unexported fields
}

type FixedBool

type FixedBool interface {
	*Bool1 | *Bool2 | *Bool4 | *Bool8 | *Bool16 | *Bool32 | *Bool64
}

type FixedVector

type FixedVector[E any] interface {
	*Vec1[E] | *Vec2[E] | *Vec4[E] | *Vec8[E] | *Vec16[E] | *Vec32[E] | *Vec64[E] | *broadcast[E]
}

FixedVector is a type constraint that matches any fixed-length vector or scalar.

type Mask

type Mask struct {
	// contains filtered or unexported fields
}

func Blending

func Blending[B Bool](mask B) *Mask

func Zeroing

func Zeroing[B Bool](mask B) *Mask

type ScalableBool

type ScalableBool interface {
}

func NewBoolFor

func NewBoolFor[SizeFor any]() ScalableBool

NewBoolFor returns a ScalableBool sized to the number of elements in a ScalableVector of type SizeFor.

type ScalableVector

type ScalableVector[E any] interface{}

func NewVector

func NewVector[E any]() ScalableVector[E]

NewVector returns a vector of the best length for the element type. The length is chosen to make best use of the CPU's vector instructions.

func NewVectorFor

func NewVectorFor[E any, SizeFor any]() ScalableVector[E]

NewVectorFor returns a ScalableVector sized to match the length of another vector with elements of type SizeFor. NewVectorFor should be used when you require vectors with the same number of elements but different types.

type Vec1

type Vec1[E any] [1]E

Vec1 is a vector with 1 element.

type Vec16

type Vec16[E any] [16]E

Vec16 is a vector with 16 elements.

type Vec2

type Vec2[E any] [2]E

Vec2 is a vector with 2 elements.

type Vec32

type Vec32[E any] [32]E

Vec32 is a vector with 32 elements.

type Vec4

type Vec4[E any] [4]E

Vec4 is a vector with 4 elements.

type Vec64

type Vec64[E any] [64]E

Vec64 is a vector with 64 elements.

type Vec8

type Vec8[E any] [8]E

Vec8 is a vector with 8 elements.

type Vector

type Vector[E any] interface {
	FixedVector[E] | ScalableVector[E]
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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