Documentation ¶
Overview ¶
Package etensor provides a basic set of tensor data structures (n-dimensional arrays of data), based on apache/arrow/go/tensor and intercompatible with those structures.
The primary differences are:
- pure simple unidimensional Go slice used as the backing data array, auto allocated
- fully modifiable data -- arrow is designed to be read-only
- Shape struct is fully usable separate from the tensor data
- Everything exported, e.g., Offset method on Shape
- int used instead of int64 to make everything easier -- target platforms are all 64bit and have 64bit int in Go by default
Index ¶
- Variables
- func BoolToFloat64(bv bool) float64
- func ColMajorStrides(shape []int) []int
- func CopyDense(to Tensor, dm *mat.Dense)
- func CopyInts(a []int) []int
- func CopyInts64(a []int64) []int
- func CopyStrings(a []string) []string
- func EqualInts(a, b []int) bool
- func Float64ToBool(val float64) bool
- func Float64ToString(val float64) string
- func IntTo64(isl []int) []int64
- func OpenCSV(tsr Tensor, filename gi.FileName, delim rune) error
- func Prjn2DCoords(shp *Shape, oddRow bool, row, col int) (rowCoords, colCoords []int)
- func Prjn2DIdx(shp *Shape, oddRow bool, row, col int) int
- func Prjn2DSet(tsr Tensor, oddRow bool, row, col int, val float64)
- func Prjn2DShape(shp *Shape, oddRow bool) (rows, cols, rowEx, colEx int)
- func Prjn2DVal(tsr Tensor, oddRow bool, row, col int) float64
- func ReadCSV(tsr Tensor, r io.Reader, delim rune) error
- func RowMajorStrides(shape []int) []int
- func SaveCSV(tsr Tensor, filename gi.FileName, delim rune) error
- func SetFloat64SliceLen(dat *[]float64, sz int)
- func StringToFloat64(str string) float64
- func WriteCSV(tsr Tensor, w io.Writer, delim rune) error
- type AggFunc
- type Bits
- func (tsr *Bits) Agg(ini float64, fun AggFunc) float64
- func (tsr *Bits) At(i, j int) float64
- func (tsr *Bits) Clone() Tensor
- func (tsr *Bits) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Bits) CopyFrom(frm Tensor)
- func (tsr *Bits) CopyMetaData(frm Tensor)
- func (tsr *Bits) CopyShapeFrom(frm Tensor)
- func (tsr *Bits) DataType() Type
- func (tsr *Bits) Dims() (r, c int)
- func (tsr *Bits) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Bits) FloatVal(i []int) float64
- func (tsr *Bits) FloatVal1D(off int) float64
- func (tsr *Bits) FloatValRowCell(row, cell int) float64
- func (tsr *Bits) Floats(flt *[]float64)
- func (tsr *Bits) IsNull(i []int) bool
- func (tsr *Bits) IsNull1D(i int) bool
- func (tsr *Bits) Label() string
- func (tsr *Bits) MetaData(key string) (string, bool)
- func (tsr *Bits) MetaDataMap() map[string]string
- func (tsr *Bits) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Bits) Set(i []int, val bool)
- func (tsr *Bits) Set1D(i int, val bool)
- func (tsr *Bits) SetFloat(i []int, val float64)
- func (tsr *Bits) SetFloat1D(off int, val float64)
- func (tsr *Bits) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Bits) SetFloats(vals []float64)
- func (tsr *Bits) SetFunc(fun EvalFunc)
- func (tsr *Bits) SetMetaData(key, val string)
- func (tsr *Bits) SetNull(i []int, nul bool)
- func (tsr *Bits) SetNull1D(i int, nul bool)
- func (tsr *Bits) SetNumRows(rows int)
- func (tsr *Bits) SetShape(shape, strides []int, names []string)
- func (tsr *Bits) SetString(i []int, val string)
- func (tsr *Bits) SetString1D(off int, val string)
- func (tsr *Bits) SetStringRowCell(row, cell int, val string)
- func (tsr *Bits) SetZeros()
- func (tsr *Bits) ShapeObj() *Shape
- func (tsr *Bits) String() string
- func (tsr *Bits) StringVal(i []int) string
- func (tsr *Bits) StringVal1D(off int) string
- func (tsr *Bits) StringValRowCell(row, cell int) string
- func (tsr *Bits) SubSpace(offs []int) Tensor
- func (tsr *Bits) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Bits) T() mat.Matrix
- func (tsr *Bits) Value(i []int) bool
- func (tsr *Bits) Value1D(i int) bool
- type BoolType
- type EvalFunc
- type Float32
- func (tsr *Float32) AddScalar(i []int, val float32) float32
- func (tsr *Float32) Agg(ini float64, fun AggFunc) float64
- func (tsr *Float32) At(i, j int) float64
- func (tsr *Float32) Clone() Tensor
- func (tsr *Float32) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Float32) CopyFrom(frm Tensor)
- func (tsr *Float32) CopyMetaData(frm Tensor)
- func (tsr *Float32) CopyShapeFrom(frm Tensor)
- func (tsr *Float32) DataType() Type
- func (tsr *Float32) Dims() (r, c int)
- func (tsr *Float32) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Float32) FloatVal(i []int) float64
- func (tsr *Float32) FloatVal1D(off int) float64
- func (tsr *Float32) FloatValRowCell(row, cell int) float64
- func (tsr *Float32) Floats(flt *[]float64)
- func (tsr *Float32) FromArrow(arw *tensor.Float32, cpy bool)
- func (tsr *Float32) IsNull(i []int) bool
- func (tsr *Float32) IsNull1D(i int) bool
- func (tsr *Float32) Label() string
- func (tsr *Float32) MetaData(key string) (string, bool)
- func (tsr *Float32) MetaDataMap() map[string]string
- func (tsr *Float32) MulScalar(i []int, val float32) float32
- func (tsr *Float32) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Float32) Set(i []int, val float32)
- func (tsr *Float32) Set1D(i int, val float32)
- func (tsr *Float32) SetFloat(i []int, val float64)
- func (tsr *Float32) SetFloat1D(off int, val float64)
- func (tsr *Float32) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Float32) SetFloats(vals []float64)
- func (tsr *Float32) SetFunc(fun EvalFunc)
- func (tsr *Float32) SetMetaData(key, val string)
- func (tsr *Float32) SetNull(i []int, nul bool)
- func (tsr *Float32) SetNull1D(i int, nul bool)
- func (tsr *Float32) SetNumRows(rows int)
- func (tsr *Float32) SetShape(shape, strides []int, names []string)
- func (tsr *Float32) SetString(i []int, val string)
- func (tsr *Float32) SetString1D(off int, val string)
- func (tsr *Float32) SetStringRowCell(row, cell int, val string)
- func (tsr *Float32) SetZeros()
- func (tsr *Float32) ShapeObj() *Shape
- func (tsr *Float32) String() string
- func (tsr *Float32) StringVal(i []int) string
- func (tsr *Float32) StringVal1D(off int) string
- func (tsr *Float32) StringValRowCell(row, cell int) string
- func (tsr *Float32) SubSpace(offs []int) Tensor
- func (tsr *Float32) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Float32) Symmetric() (r int)
- func (tsr *Float32) SymmetricDim() int
- func (tsr *Float32) T() mat.Matrix
- func (tsr *Float32) ToArrow() *tensor.Float32
- func (tsr *Float32) Value(i []int) float32
- func (tsr *Float32) Value1D(i int) float32
- type Float64
- func (tsr *Float64) AddScalar(i []int, val float64) float64
- func (tsr *Float64) Agg(ini float64, fun AggFunc) float64
- func (tsr *Float64) At(i, j int) float64
- func (tsr *Float64) Clone() Tensor
- func (tsr *Float64) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Float64) CopyFrom(frm Tensor)
- func (tsr *Float64) CopyMetaData(frm Tensor)
- func (tsr *Float64) CopyShapeFrom(frm Tensor)
- func (tsr *Float64) DataType() Type
- func (tsr *Float64) Dims() (r, c int)
- func (tsr *Float64) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Float64) FloatVal(i []int) float64
- func (tsr *Float64) FloatVal1D(off int) float64
- func (tsr *Float64) FloatValRowCell(row, cell int) float64
- func (tsr *Float64) Floats(flt *[]float64)
- func (tsr *Float64) FromArrow(arw *tensor.Float64, cpy bool)
- func (tsr *Float64) IsNull(i []int) bool
- func (tsr *Float64) IsNull1D(i int) bool
- func (tsr *Float64) Label() string
- func (tsr *Float64) MetaData(key string) (string, bool)
- func (tsr *Float64) MetaDataMap() map[string]string
- func (tsr *Float64) MulScalar(i []int, val float64) float64
- func (tsr *Float64) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Float64) Set(i []int, val float64)
- func (tsr *Float64) Set1D(i int, val float64)
- func (tsr *Float64) SetFloat(i []int, val float64)
- func (tsr *Float64) SetFloat1D(off int, val float64)
- func (tsr *Float64) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Float64) SetFloats(vals []float64)
- func (tsr *Float64) SetFunc(fun EvalFunc)
- func (tsr *Float64) SetMetaData(key, val string)
- func (tsr *Float64) SetNull(i []int, nul bool)
- func (tsr *Float64) SetNull1D(i int, nul bool)
- func (tsr *Float64) SetNumRows(rows int)
- func (tsr *Float64) SetShape(shape, strides []int, names []string)
- func (tsr *Float64) SetString(i []int, val string)
- func (tsr *Float64) SetString1D(off int, val string)
- func (tsr *Float64) SetStringRowCell(row, cell int, val string)
- func (tsr *Float64) SetZeros()
- func (tsr *Float64) ShapeObj() *Shape
- func (tsr *Float64) String() string
- func (tsr *Float64) StringVal(i []int) string
- func (tsr *Float64) StringVal1D(off int) string
- func (tsr *Float64) StringValRowCell(row, cell int) string
- func (tsr *Float64) SubSpace(offs []int) Tensor
- func (tsr *Float64) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Float64) Symmetric() (r int)
- func (tsr *Float64) SymmetricDim() int
- func (tsr *Float64) T() mat.Matrix
- func (tsr *Float64) ToArrow() *tensor.Float64
- func (tsr *Float64) Value(i []int) float64
- func (tsr *Float64) Value1D(i int) float64
- type Int
- func (tsr *Int) AddScalar(i []int, val int) int
- func (tsr *Int) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int) At(i, j int) float64
- func (tsr *Int) Clone() Tensor
- func (tsr *Int) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int) CopyFrom(frm Tensor)
- func (tsr *Int) CopyMetaData(frm Tensor)
- func (tsr *Int) CopyShapeFrom(frm Tensor)
- func (tsr *Int) DataType() Type
- func (tsr *Int) Dims() (r, c int)
- func (tsr *Int) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int) FloatVal(i []int) float64
- func (tsr *Int) FloatVal1D(off int) float64
- func (tsr *Int) FloatValRowCell(row, cell int) float64
- func (tsr *Int) Floats(flt *[]float64)
- func (tsr *Int) FromArrow(arw *tensor.Int64, cpy bool)
- func (tsr *Int) IsNull(i []int) bool
- func (tsr *Int) IsNull1D(i int) bool
- func (tsr *Int) Label() string
- func (tsr *Int) MetaData(key string) (string, bool)
- func (tsr *Int) MetaDataMap() map[string]string
- func (tsr *Int) MulScalar(i []int, val int) int
- func (tsr *Int) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int) Set(i []int, val int)
- func (tsr *Int) Set1D(i int, val int)
- func (tsr *Int) SetFloat(i []int, val float64)
- func (tsr *Int) SetFloat1D(off int, val float64)
- func (tsr *Int) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Int) SetFloats(vals []float64)
- func (tsr *Int) SetFunc(fun EvalFunc)
- func (tsr *Int) SetMetaData(key, val string)
- func (tsr *Int) SetNull(i []int, nul bool)
- func (tsr *Int) SetNull1D(i int, nul bool)
- func (tsr *Int) SetNumRows(rows int)
- func (tsr *Int) SetShape(shape, strides []int, names []string)
- func (tsr *Int) SetString(i []int, val string)
- func (tsr *Int) SetString1D(off int, val string)
- func (tsr *Int) SetStringRowCell(row, cell int, val string)
- func (tsr *Int) SetZeros()
- func (tsr *Int) ShapeObj() *Shape
- func (tsr *Int) String() string
- func (tsr *Int) StringVal(i []int) string
- func (tsr *Int) StringVal1D(off int) string
- func (tsr *Int) StringValRowCell(row, cell int) string
- func (tsr *Int) SubSpace(offs []int) Tensor
- func (tsr *Int) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Int) Symmetric() (r int)
- func (tsr *Int) SymmetricDim() (r int)
- func (tsr *Int) T() mat.Matrix
- func (tsr *Int) ToArrow() *tensor.Int64
- func (tsr *Int) Value(i []int) int
- func (tsr *Int) Value1D(i int) int
- type Int16
- func (tsr *Int16) AddScalar(i []int, val int16) int16
- func (tsr *Int16) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int16) At(i, j int) float64
- func (tsr *Int16) Clone() Tensor
- func (tsr *Int16) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int16) CopyFrom(frm Tensor)
- func (tsr *Int16) CopyMetaData(frm Tensor)
- func (tsr *Int16) CopyShapeFrom(frm Tensor)
- func (tsr *Int16) DataType() Type
- func (tsr *Int16) Dims() (r, c int)
- func (tsr *Int16) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int16) FloatVal(i []int) float64
- func (tsr *Int16) FloatVal1D(off int) float64
- func (tsr *Int16) FloatValRowCell(row, cell int) float64
- func (tsr *Int16) Floats(flt *[]float64)
- func (tsr *Int16) FromArrow(arw *tensor.Int16, cpy bool)
- func (tsr *Int16) IsNull(i []int) bool
- func (tsr *Int16) IsNull1D(i int) bool
- func (tsr *Int16) Label() string
- func (tsr *Int16) MetaData(key string) (string, bool)
- func (tsr *Int16) MetaDataMap() map[string]string
- func (tsr *Int16) MulScalar(i []int, val int16) int16
- func (tsr *Int16) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int16) Set(i []int, val int16)
- func (tsr *Int16) Set1D(i int, val int16)
- func (tsr *Int16) SetFloat(i []int, val float64)
- func (tsr *Int16) SetFloat1D(off int, val float64)
- func (tsr *Int16) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Int16) SetFloats(vals []float64)
- func (tsr *Int16) SetFunc(fun EvalFunc)
- func (tsr *Int16) SetMetaData(key, val string)
- func (tsr *Int16) SetNull(i []int, nul bool)
- func (tsr *Int16) SetNull1D(i int, nul bool)
- func (tsr *Int16) SetNumRows(rows int)
- func (tsr *Int16) SetShape(shape, strides []int, names []string)
- func (tsr *Int16) SetString(i []int, val string)
- func (tsr *Int16) SetString1D(off int, val string)
- func (tsr *Int16) SetStringRowCell(row, cell int, val string)
- func (tsr *Int16) SetZeros()
- func (tsr *Int16) ShapeObj() *Shape
- func (tsr *Int16) String() string
- func (tsr *Int16) StringVal(i []int) string
- func (tsr *Int16) StringVal1D(off int) string
- func (tsr *Int16) StringValRowCell(row, cell int) string
- func (tsr *Int16) SubSpace(offs []int) Tensor
- func (tsr *Int16) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Int16) Symmetric() (r int)
- func (tsr *Int16) SymmetricDim() int
- func (tsr *Int16) T() mat.Matrix
- func (tsr *Int16) ToArrow() *tensor.Int16
- func (tsr *Int16) Value(i []int) int16
- func (tsr *Int16) Value1D(i int) int16
- type Int32
- func (tsr *Int32) AddScalar(i []int, val int32) int32
- func (tsr *Int32) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int32) At(i, j int) float64
- func (tsr *Int32) Clone() Tensor
- func (tsr *Int32) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int32) CopyFrom(frm Tensor)
- func (tsr *Int32) CopyMetaData(frm Tensor)
- func (tsr *Int32) CopyShapeFrom(frm Tensor)
- func (tsr *Int32) DataType() Type
- func (tsr *Int32) Dims() (r, c int)
- func (tsr *Int32) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int32) FloatVal(i []int) float64
- func (tsr *Int32) FloatVal1D(off int) float64
- func (tsr *Int32) FloatValRowCell(row, cell int) float64
- func (tsr *Int32) Floats(flt *[]float64)
- func (tsr *Int32) FromArrow(arw *tensor.Int32, cpy bool)
- func (tsr *Int32) IsNull(i []int) bool
- func (tsr *Int32) IsNull1D(i int) bool
- func (tsr *Int32) Label() string
- func (tsr *Int32) MetaData(key string) (string, bool)
- func (tsr *Int32) MetaDataMap() map[string]string
- func (tsr *Int32) MulScalar(i []int, val int32) int32
- func (tsr *Int32) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int32) Set(i []int, val int32)
- func (tsr *Int32) Set1D(i int, val int32)
- func (tsr *Int32) SetFloat(i []int, val float64)
- func (tsr *Int32) SetFloat1D(off int, val float64)
- func (tsr *Int32) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Int32) SetFloats(vals []float64)
- func (tsr *Int32) SetFunc(fun EvalFunc)
- func (tsr *Int32) SetMetaData(key, val string)
- func (tsr *Int32) SetNull(i []int, nul bool)
- func (tsr *Int32) SetNull1D(i int, nul bool)
- func (tsr *Int32) SetNumRows(rows int)
- func (tsr *Int32) SetShape(shape, strides []int, names []string)
- func (tsr *Int32) SetString(i []int, val string)
- func (tsr *Int32) SetString1D(off int, val string)
- func (tsr *Int32) SetStringRowCell(row, cell int, val string)
- func (tsr *Int32) SetZeros()
- func (tsr *Int32) ShapeObj() *Shape
- func (tsr *Int32) String() string
- func (tsr *Int32) StringVal(i []int) string
- func (tsr *Int32) StringVal1D(off int) string
- func (tsr *Int32) StringValRowCell(row, cell int) string
- func (tsr *Int32) SubSpace(offs []int) Tensor
- func (tsr *Int32) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Int32) Symmetric() (r int)
- func (tsr *Int32) SymmetricDim() int
- func (tsr *Int32) T() mat.Matrix
- func (tsr *Int32) ToArrow() *tensor.Int32
- func (tsr *Int32) Value(i []int) int32
- func (tsr *Int32) Value1D(i int) int32
- type Int64
- func (tsr *Int64) AddScalar(i []int, val int64) int64
- func (tsr *Int64) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int64) At(i, j int) float64
- func (tsr *Int64) Clone() Tensor
- func (tsr *Int64) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int64) CopyFrom(frm Tensor)
- func (tsr *Int64) CopyMetaData(frm Tensor)
- func (tsr *Int64) CopyShapeFrom(frm Tensor)
- func (tsr *Int64) DataType() Type
- func (tsr *Int64) Dims() (r, c int)
- func (tsr *Int64) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int64) FloatVal(i []int) float64
- func (tsr *Int64) FloatVal1D(off int) float64
- func (tsr *Int64) FloatValRowCell(row, cell int) float64
- func (tsr *Int64) Floats(flt *[]float64)
- func (tsr *Int64) FromArrow(arw *tensor.Int64, cpy bool)
- func (tsr *Int64) IsNull(i []int) bool
- func (tsr *Int64) IsNull1D(i int) bool
- func (tsr *Int64) Label() string
- func (tsr *Int64) MetaData(key string) (string, bool)
- func (tsr *Int64) MetaDataMap() map[string]string
- func (tsr *Int64) MulScalar(i []int, val int64) int64
- func (tsr *Int64) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int64) Set(i []int, val int64)
- func (tsr *Int64) Set1D(i int, val int64)
- func (tsr *Int64) SetFloat(i []int, val float64)
- func (tsr *Int64) SetFloat1D(off int, val float64)
- func (tsr *Int64) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Int64) SetFloats(vals []float64)
- func (tsr *Int64) SetFunc(fun EvalFunc)
- func (tsr *Int64) SetMetaData(key, val string)
- func (tsr *Int64) SetNull(i []int, nul bool)
- func (tsr *Int64) SetNull1D(i int, nul bool)
- func (tsr *Int64) SetNumRows(rows int)
- func (tsr *Int64) SetShape(shape, strides []int, names []string)
- func (tsr *Int64) SetString(i []int, val string)
- func (tsr *Int64) SetString1D(off int, val string)
- func (tsr *Int64) SetStringRowCell(row, cell int, val string)
- func (tsr *Int64) SetZeros()
- func (tsr *Int64) ShapeObj() *Shape
- func (tsr *Int64) String() string
- func (tsr *Int64) StringVal(i []int) string
- func (tsr *Int64) StringVal1D(off int) string
- func (tsr *Int64) StringValRowCell(row, cell int) string
- func (tsr *Int64) SubSpace(offs []int) Tensor
- func (tsr *Int64) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Int64) Symmetric() (r int)
- func (tsr *Int64) SymmetricDim() int
- func (tsr *Int64) T() mat.Matrix
- func (tsr *Int64) ToArrow() *tensor.Int64
- func (tsr *Int64) Value(i []int) int64
- func (tsr *Int64) Value1D(i int) int64
- type Int8
- func (tsr *Int8) AddScalar(i []int, val int8) int8
- func (tsr *Int8) Agg(ini float64, fun AggFunc) float64
- func (tsr *Int8) At(i, j int) float64
- func (tsr *Int8) Clone() Tensor
- func (tsr *Int8) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Int8) CopyFrom(frm Tensor)
- func (tsr *Int8) CopyMetaData(frm Tensor)
- func (tsr *Int8) CopyShapeFrom(frm Tensor)
- func (tsr *Int8) DataType() Type
- func (tsr *Int8) Dims() (r, c int)
- func (tsr *Int8) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Int8) FloatVal(i []int) float64
- func (tsr *Int8) FloatVal1D(off int) float64
- func (tsr *Int8) FloatValRowCell(row, cell int) float64
- func (tsr *Int8) Floats(flt *[]float64)
- func (tsr *Int8) FromArrow(arw *tensor.Int8, cpy bool)
- func (tsr *Int8) IsNull(i []int) bool
- func (tsr *Int8) IsNull1D(i int) bool
- func (tsr *Int8) Label() string
- func (tsr *Int8) MetaData(key string) (string, bool)
- func (tsr *Int8) MetaDataMap() map[string]string
- func (tsr *Int8) MulScalar(i []int, val int8) int8
- func (tsr *Int8) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Int8) Set(i []int, val int8)
- func (tsr *Int8) Set1D(i int, val int8)
- func (tsr *Int8) SetFloat(i []int, val float64)
- func (tsr *Int8) SetFloat1D(off int, val float64)
- func (tsr *Int8) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Int8) SetFloats(vals []float64)
- func (tsr *Int8) SetFunc(fun EvalFunc)
- func (tsr *Int8) SetMetaData(key, val string)
- func (tsr *Int8) SetNull(i []int, nul bool)
- func (tsr *Int8) SetNull1D(i int, nul bool)
- func (tsr *Int8) SetNumRows(rows int)
- func (tsr *Int8) SetShape(shape, strides []int, names []string)
- func (tsr *Int8) SetString(i []int, val string)
- func (tsr *Int8) SetString1D(off int, val string)
- func (tsr *Int8) SetStringRowCell(row, cell int, val string)
- func (tsr *Int8) SetZeros()
- func (tsr *Int8) ShapeObj() *Shape
- func (tsr *Int8) String() string
- func (tsr *Int8) StringVal(i []int) string
- func (tsr *Int8) StringVal1D(off int) string
- func (tsr *Int8) StringValRowCell(row, cell int) string
- func (tsr *Int8) SubSpace(offs []int) Tensor
- func (tsr *Int8) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Int8) Symmetric() (r int)
- func (tsr *Int8) SymmetricDim() int
- func (tsr *Int8) T() mat.Matrix
- func (tsr *Int8) ToArrow() *tensor.Int8
- func (tsr *Int8) Value(i []int) int8
- func (tsr *Int8) Value1D(i int) int8
- type Shape
- func (sh *Shape) CopyShape(cp *Shape)
- func (sh *Shape) Dim(i int) int
- func (sh *Shape) DimName(i int) string
- func (sh *Shape) DimNames() []string
- func (sh *Shape) IdxIsValid(idx []int) bool
- func (sh *Shape) Index(offset int) []int
- func (sh *Shape) IsColMajor() bool
- func (sh *Shape) IsContiguous() bool
- func (sh *Shape) IsEqual(oth *Shape) bool
- func (sh *Shape) IsRowMajor() bool
- func (sh *Shape) Len() int
- func (sh *Shape) NumDims() int
- func (sh *Shape) Offset(index []int) int
- func (sh *Shape) RowCellSize() (rows, cells int)
- func (sh *Shape) SetShape(shape, strides []int, names []string)
- func (sh *Shape) SetShape64(shape, strides []int64, names []string)
- func (sh *Shape) Shape64() []int64
- func (sh *Shape) Shapes() []int
- func (sh *Shape) Strides() []int
- func (sh *Shape) Strides64() []int64
- func (sh *Shape) String() string
- type String
- func (tsr *String) Agg(ini float64, fun AggFunc) float64
- func (tsr *String) At(i, j int) float64
- func (tsr *String) Clone() Tensor
- func (tsr *String) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *String) CopyFrom(frm Tensor)
- func (tsr *String) CopyMetaData(frm Tensor)
- func (tsr *String) CopyShapeFrom(frm Tensor)
- func (tsr *String) DataType() Type
- func (tsr *String) Dims() (r, c int)
- func (tsr *String) Eval(res *[]float64, fun EvalFunc)
- func (tsr *String) FloatVal(i []int) float64
- func (tsr *String) FloatVal1D(off int) float64
- func (tsr *String) FloatValRowCell(row, cell int) float64
- func (tsr *String) Floats(flt *[]float64)
- func (tsr *String) IsNull(i []int) bool
- func (tsr *String) IsNull1D(i int) bool
- func (tsr *String) Label() string
- func (tsr *String) MetaData(key string) (string, bool)
- func (tsr *String) MetaDataMap() map[string]string
- func (tsr *String) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *String) Set(i []int, val string)
- func (tsr *String) Set1D(i int, val string)
- func (tsr *String) SetFloat(i []int, val float64)
- func (tsr *String) SetFloat1D(off int, val float64)
- func (tsr *String) SetFloatRowCell(row, cell int, val float64)
- func (tsr *String) SetFloats(vals []float64)
- func (tsr *String) SetFunc(fun EvalFunc)
- func (tsr *String) SetMetaData(key, val string)
- func (tsr *String) SetNull(i []int, nul bool)
- func (tsr *String) SetNull1D(i int, nul bool)
- func (tsr *String) SetNumRows(rows int)
- func (tsr *String) SetShape(shape, strides []int, names []string)
- func (tsr *String) SetString(i []int, val string)
- func (tsr *String) SetString1D(off int, val string)
- func (tsr *String) SetStringRowCell(row, cell int, val string)
- func (tsr *String) SetZeros()
- func (tsr *String) ShapeObj() *Shape
- func (tsr *String) String() string
- func (tsr *String) StringVal(i []int) string
- func (tsr *String) StringVal1D(off int) string
- func (tsr *String) StringValRowCell(row, cell int) string
- func (tsr *String) SubSpace(offs []int) Tensor
- func (tsr *String) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *String) T() mat.Matrix
- func (tsr *String) Value(i []int) string
- func (tsr *String) Value1D(i int) string
- type Tensor
- type Type
- type Uint16
- func (tsr *Uint16) AddScalar(i []int, val uint16) uint16
- func (tsr *Uint16) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint16) At(i, j int) float64
- func (tsr *Uint16) Clone() Tensor
- func (tsr *Uint16) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint16) CopyFrom(frm Tensor)
- func (tsr *Uint16) CopyMetaData(frm Tensor)
- func (tsr *Uint16) CopyShapeFrom(frm Tensor)
- func (tsr *Uint16) DataType() Type
- func (tsr *Uint16) Dims() (r, c int)
- func (tsr *Uint16) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint16) FloatVal(i []int) float64
- func (tsr *Uint16) FloatVal1D(off int) float64
- func (tsr *Uint16) FloatValRowCell(row, cell int) float64
- func (tsr *Uint16) Floats(flt *[]float64)
- func (tsr *Uint16) FromArrow(arw *tensor.Uint16, cpy bool)
- func (tsr *Uint16) IsNull(i []int) bool
- func (tsr *Uint16) IsNull1D(i int) bool
- func (tsr *Uint16) Label() string
- func (tsr *Uint16) MetaData(key string) (string, bool)
- func (tsr *Uint16) MetaDataMap() map[string]string
- func (tsr *Uint16) MulScalar(i []int, val uint16) uint16
- func (tsr *Uint16) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint16) Set(i []int, val uint16)
- func (tsr *Uint16) Set1D(i int, val uint16)
- func (tsr *Uint16) SetFloat(i []int, val float64)
- func (tsr *Uint16) SetFloat1D(off int, val float64)
- func (tsr *Uint16) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Uint16) SetFloats(vals []float64)
- func (tsr *Uint16) SetFunc(fun EvalFunc)
- func (tsr *Uint16) SetMetaData(key, val string)
- func (tsr *Uint16) SetNull(i []int, nul bool)
- func (tsr *Uint16) SetNull1D(i int, nul bool)
- func (tsr *Uint16) SetNumRows(rows int)
- func (tsr *Uint16) SetShape(shape, strides []int, names []string)
- func (tsr *Uint16) SetString(i []int, val string)
- func (tsr *Uint16) SetString1D(off int, val string)
- func (tsr *Uint16) SetStringRowCell(row, cell int, val string)
- func (tsr *Uint16) SetZeros()
- func (tsr *Uint16) ShapeObj() *Shape
- func (tsr *Uint16) String() string
- func (tsr *Uint16) StringVal(i []int) string
- func (tsr *Uint16) StringVal1D(off int) string
- func (tsr *Uint16) StringValRowCell(row, cell int) string
- func (tsr *Uint16) SubSpace(offs []int) Tensor
- func (tsr *Uint16) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Uint16) Symmetric() (r int)
- func (tsr *Uint16) SymmetricDim() int
- func (tsr *Uint16) T() mat.Matrix
- func (tsr *Uint16) ToArrow() *tensor.Uint16
- func (tsr *Uint16) Value(i []int) uint16
- func (tsr *Uint16) Value1D(i int) uint16
- type Uint32
- func (tsr *Uint32) AddScalar(i []int, val uint32) uint32
- func (tsr *Uint32) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint32) At(i, j int) float64
- func (tsr *Uint32) Clone() Tensor
- func (tsr *Uint32) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint32) CopyFrom(frm Tensor)
- func (tsr *Uint32) CopyMetaData(frm Tensor)
- func (tsr *Uint32) CopyShapeFrom(frm Tensor)
- func (tsr *Uint32) DataType() Type
- func (tsr *Uint32) Dims() (r, c int)
- func (tsr *Uint32) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint32) FloatVal(i []int) float64
- func (tsr *Uint32) FloatVal1D(off int) float64
- func (tsr *Uint32) FloatValRowCell(row, cell int) float64
- func (tsr *Uint32) Floats(flt *[]float64)
- func (tsr *Uint32) FromArrow(arw *tensor.Uint32, cpy bool)
- func (tsr *Uint32) IsNull(i []int) bool
- func (tsr *Uint32) IsNull1D(i int) bool
- func (tsr *Uint32) Label() string
- func (tsr *Uint32) MetaData(key string) (string, bool)
- func (tsr *Uint32) MetaDataMap() map[string]string
- func (tsr *Uint32) MulScalar(i []int, val uint32) uint32
- func (tsr *Uint32) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint32) Set(i []int, val uint32)
- func (tsr *Uint32) Set1D(i int, val uint32)
- func (tsr *Uint32) SetFloat(i []int, val float64)
- func (tsr *Uint32) SetFloat1D(off int, val float64)
- func (tsr *Uint32) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Uint32) SetFloats(vals []float64)
- func (tsr *Uint32) SetFunc(fun EvalFunc)
- func (tsr *Uint32) SetMetaData(key, val string)
- func (tsr *Uint32) SetNull(i []int, nul bool)
- func (tsr *Uint32) SetNull1D(i int, nul bool)
- func (tsr *Uint32) SetNumRows(rows int)
- func (tsr *Uint32) SetShape(shape, strides []int, names []string)
- func (tsr *Uint32) SetString(i []int, val string)
- func (tsr *Uint32) SetString1D(off int, val string)
- func (tsr *Uint32) SetStringRowCell(row, cell int, val string)
- func (tsr *Uint32) SetZeros()
- func (tsr *Uint32) ShapeObj() *Shape
- func (tsr *Uint32) String() string
- func (tsr *Uint32) StringVal(i []int) string
- func (tsr *Uint32) StringVal1D(off int) string
- func (tsr *Uint32) StringValRowCell(row, cell int) string
- func (tsr *Uint32) SubSpace(offs []int) Tensor
- func (tsr *Uint32) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Uint32) Symmetric() (r int)
- func (tsr *Uint32) SymmetricDim() int
- func (tsr *Uint32) T() mat.Matrix
- func (tsr *Uint32) ToArrow() *tensor.Uint32
- func (tsr *Uint32) Value(i []int) uint32
- func (tsr *Uint32) Value1D(i int) uint32
- type Uint64
- func (tsr *Uint64) AddScalar(i []int, val uint64) uint64
- func (tsr *Uint64) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint64) At(i, j int) float64
- func (tsr *Uint64) Clone() Tensor
- func (tsr *Uint64) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint64) CopyFrom(frm Tensor)
- func (tsr *Uint64) CopyMetaData(frm Tensor)
- func (tsr *Uint64) CopyShapeFrom(frm Tensor)
- func (tsr *Uint64) DataType() Type
- func (tsr *Uint64) Dims() (r, c int)
- func (tsr *Uint64) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint64) FloatVal(i []int) float64
- func (tsr *Uint64) FloatVal1D(off int) float64
- func (tsr *Uint64) FloatValRowCell(row, cell int) float64
- func (tsr *Uint64) Floats(flt *[]float64)
- func (tsr *Uint64) FromArrow(arw *tensor.Uint64, cpy bool)
- func (tsr *Uint64) IsNull(i []int) bool
- func (tsr *Uint64) IsNull1D(i int) bool
- func (tsr *Uint64) Label() string
- func (tsr *Uint64) MetaData(key string) (string, bool)
- func (tsr *Uint64) MetaDataMap() map[string]string
- func (tsr *Uint64) MulScalar(i []int, val uint64) uint64
- func (tsr *Uint64) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint64) Set(i []int, val uint64)
- func (tsr *Uint64) Set1D(i int, val uint64)
- func (tsr *Uint64) SetFloat(i []int, val float64)
- func (tsr *Uint64) SetFloat1D(off int, val float64)
- func (tsr *Uint64) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Uint64) SetFloats(vals []float64)
- func (tsr *Uint64) SetFunc(fun EvalFunc)
- func (tsr *Uint64) SetMetaData(key, val string)
- func (tsr *Uint64) SetNull(i []int, nul bool)
- func (tsr *Uint64) SetNull1D(i int, nul bool)
- func (tsr *Uint64) SetNumRows(rows int)
- func (tsr *Uint64) SetShape(shape, strides []int, names []string)
- func (tsr *Uint64) SetString(i []int, val string)
- func (tsr *Uint64) SetString1D(off int, val string)
- func (tsr *Uint64) SetStringRowCell(row, cell int, val string)
- func (tsr *Uint64) SetZeros()
- func (tsr *Uint64) ShapeObj() *Shape
- func (tsr *Uint64) String() string
- func (tsr *Uint64) StringVal(i []int) string
- func (tsr *Uint64) StringVal1D(off int) string
- func (tsr *Uint64) StringValRowCell(row, cell int) string
- func (tsr *Uint64) SubSpace(offs []int) Tensor
- func (tsr *Uint64) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Uint64) Symmetric() (r int)
- func (tsr *Uint64) SymmetricDim() int
- func (tsr *Uint64) T() mat.Matrix
- func (tsr *Uint64) ToArrow() *tensor.Uint64
- func (tsr *Uint64) Value(i []int) uint64
- func (tsr *Uint64) Value1D(i int) uint64
- type Uint8
- func (tsr *Uint8) AddScalar(i []int, val uint8) uint8
- func (tsr *Uint8) Agg(ini float64, fun AggFunc) float64
- func (tsr *Uint8) At(i, j int) float64
- func (tsr *Uint8) Clone() Tensor
- func (tsr *Uint8) CopyCellsFrom(frm Tensor, to, start, n int)
- func (tsr *Uint8) CopyFrom(frm Tensor)
- func (tsr *Uint8) CopyMetaData(frm Tensor)
- func (tsr *Uint8) CopyShapeFrom(frm Tensor)
- func (tsr *Uint8) DataType() Type
- func (tsr *Uint8) Dims() (r, c int)
- func (tsr *Uint8) Eval(res *[]float64, fun EvalFunc)
- func (tsr *Uint8) FloatVal(i []int) float64
- func (tsr *Uint8) FloatVal1D(off int) float64
- func (tsr *Uint8) FloatValRowCell(row, cell int) float64
- func (tsr *Uint8) Floats(flt *[]float64)
- func (tsr *Uint8) FromArrow(arw *tensor.Uint8, cpy bool)
- func (tsr *Uint8) IsNull(i []int) bool
- func (tsr *Uint8) IsNull1D(i int) bool
- func (tsr *Uint8) Label() string
- func (tsr *Uint8) MetaData(key string) (string, bool)
- func (tsr *Uint8) MetaDataMap() map[string]string
- func (tsr *Uint8) MulScalar(i []int, val uint8) uint8
- func (tsr *Uint8) Range() (min, max float64, minIdx, maxIdx int)
- func (tsr *Uint8) Set(i []int, val uint8)
- func (tsr *Uint8) Set1D(i int, val uint8)
- func (tsr *Uint8) SetFloat(i []int, val float64)
- func (tsr *Uint8) SetFloat1D(off int, val float64)
- func (tsr *Uint8) SetFloatRowCell(row, cell int, val float64)
- func (tsr *Uint8) SetFloats(vals []float64)
- func (tsr *Uint8) SetFunc(fun EvalFunc)
- func (tsr *Uint8) SetMetaData(key, val string)
- func (tsr *Uint8) SetNull(i []int, nul bool)
- func (tsr *Uint8) SetNull1D(i int, nul bool)
- func (tsr *Uint8) SetNumRows(rows int)
- func (tsr *Uint8) SetShape(shape, strides []int, names []string)
- func (tsr *Uint8) SetString(i []int, val string)
- func (tsr *Uint8) SetString1D(off int, val string)
- func (tsr *Uint8) SetStringRowCell(row, cell int, val string)
- func (tsr *Uint8) SetZeros()
- func (tsr *Uint8) ShapeObj() *Shape
- func (tsr *Uint8) String() string
- func (tsr *Uint8) StringVal(i []int) string
- func (tsr *Uint8) StringVal1D(off int) string
- func (tsr *Uint8) StringValRowCell(row, cell int) string
- func (tsr *Uint8) SubSpace(offs []int) Tensor
- func (tsr *Uint8) SubSpaceTry(offs []int) (Tensor, error)
- func (tsr *Uint8) Symmetric() (r int)
- func (tsr *Uint8) SymmetricDim() int
- func (tsr *Uint8) T() mat.Matrix
- func (tsr *Uint8) ToArrow() *tensor.Uint8
- func (tsr *Uint8) Value(i []int) uint8
- func (tsr *Uint8) Value1D(i int) uint8
Constants ¶
This section is empty.
Variables ¶
var KiT_Type = kit.Enums.AddEnum(TypeN, kit.NotBitFlag, nil)
Functions ¶
func BoolToFloat64 ¶
func ColMajorStrides ¶
ColMajorStrides returns strides for shape where the first dimension is inner-most and subsequent dimensions are progressively outer
func CopyDense ¶ added in v1.0.0
CopyDense copies a gonum mat.Dense matrix into given Tensor using standard Float64 interface
func CopyInts64 ¶
CopyInts64 makes a copy of an int64 slice to an int slice
func Float64ToBool ¶
func Float64ToString ¶
func OpenCSV ¶ added in v1.0.0
OpenCSV reads a tensor from a comma-separated-values (CSV) file (where comma = any delimiter, specified in the delim arg), using the Go standard encoding/csv reader conforming to the official CSV standard. Reads all values and assigns as many as fit.
func Prjn2DCoords ¶ added in v1.0.0
Prjn2DCoords returns the corresponding full-dimensional coordinates that go into the given row, col coords for a 2D projection of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D).
func Prjn2DIdx ¶ added in v1.0.0
Prjn2DIdx returns the flat 1D index for given row, col coords for a 2D projection of the given tensor shape, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the oddRow arg. Even multiples of inner-most dimensions are assumed to be row, then column. RowMajor and ColMajor layouts are handled appropriately.
func Prjn2DSet ¶
Prjn2DSet sets a float64 value at given row, col coords for a 2D projection of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the oddRow arg. Even multiples of inner-most dimensions are assumed to be row, then column. RowMajor and ColMajor layouts are handled appropriately.
func Prjn2DShape ¶
Prjn2DShape returns the size of a 2D projection of the given tensor Shape, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the oddRow arg. Even multiples of inner-most dimensions are assumed to be row, then column. RowMajor and ColMajor layouts are handled appropriately. rowEx returns the number of "extra" (higher dimensional) rows and colEx returns the number of extra cols
func Prjn2DVal ¶
Prjn2DVal returns the float64 value at given row, col coords for a 2D projection of the given tensor, collapsing higher dimensions down to 2D (and 1D up to 2D). For any odd number of dimensions, the remaining outer-most dimension can either be multipliexed across the row or column, given the oddRow arg. Even multiples of inner-most dimensions are assumed to be row, then column. RowMajor and ColMajor layouts are handled appropriately.
func ReadCSV ¶ added in v1.0.0
ReadCSV reads a tensor from a comma-separated-values (CSV) file (where comma = any delimiter, specified in the delim arg), using the Go standard encoding/csv reader conforming to the official CSV standard. Reads all values and assigns as many as fit.
func RowMajorStrides ¶
RowMajorStrides returns strides for shape where the first dimension is outer-most and subsequent dimensions are progressively inner
func SaveCSV ¶ added in v1.0.0
SaveCSV writes a tensor to a comma-separated-values (CSV) file (where comma = any delimiter, specified in the delim arg). Outer-most dims are rows in the file, and inner-most is column -- Reading just grabs all values and doesn't care about shape.
func SetFloat64SliceLen ¶ added in v1.0.22
SetFloat64SliceLen is a utility function to set given slice of float64 values to given length, reusing existing where possible and making a new one as needed. For use in WriteGeom routines.
func StringToFloat64 ¶
Types ¶
type AggFunc ¶
AggFunc is an aggregation function that incrementally updates agg value from each element in the tensor in turn -- returns new agg value that will be passed into next item as agg
type Bits ¶
etensor.Bits is a tensor of bits backed by a bitslice.Slice for efficient storage of binary data
func NewBits ¶
NewBits returns a new n-dimensional array of bits If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func NewBitsShape ¶
NewBitsShape returns a new n-dimensional array of bits If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Bits) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Bits) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Not supported for Bits -- do not call!
func (*Bits) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Bits) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Bits) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Bits) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Bits) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Bits) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Not supported for Bits -- do not call!
func (*Bits) Eval ¶
Eval applies given function to each element in the tensor, using float64 conversions of the values, and puts the results into given float64 slice, which is ensured to be of the proper length
func (*Bits) FloatVal1D ¶
func (*Bits) FloatValRowCell ¶ added in v1.0.0
func (*Bits) Label ¶ added in v1.0.1
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Bits) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Bits) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Bits) SetFloat1D ¶
func (*Bits) SetFloatRowCell ¶ added in v1.0.0
func (*Bits) SetFunc ¶
SetFunc applies given function to each element in the tensor, using float64 conversions of the values, and writes the results back into the same tensor values
func (*Bits) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Bits) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Bits) SetString1D ¶
func (*Bits) SetStringRowCell ¶ added in v1.0.0
func (*Bits) SetZeros ¶
func (tsr *Bits) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Bits) String ¶ added in v1.0.1
String satisfies the fmt.Stringer interface for string of tensor data
func (*Bits) StringVal1D ¶
func (*Bits) StringValRowCell ¶ added in v1.0.0
func (*Bits) SubSpaceTry ¶
SubSpaceTry is not applicable to Bits tensor
type EvalFunc ¶
EvalFunc is an evaluation function that computes a function on each element value, returning the computed value
type Float32 ¶
Float32 is an n-dim array of float32s.
func NewFloat32 ¶
NewFloat32 returns a new n-dimensional array of float32s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewFloat32Shape ¶
NewFloat32Shape returns a new n-dimensional array of float32s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Float32) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Float32) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float32) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Float32) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Float32) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Float32) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Float32) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Float32) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float32) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Float32) FloatVal1D ¶
func (*Float32) FloatValRowCell ¶ added in v1.0.0
func (*Float32) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Float32) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Float32) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Float32) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Float32) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Float32) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Float32) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Float32) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Float32) SetFloat1D ¶
func (*Float32) SetFloatRowCell ¶ added in v1.0.0
func (*Float32) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Float32) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Float32) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float32) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float32) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Float32) SetString1D ¶
func (*Float32) SetStringRowCell ¶ added in v1.0.0
func (*Float32) SetZeros ¶
func (tsr *Float32) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Float32) StringVal1D ¶
func (*Float32) StringValRowCell ¶ added in v1.0.0
func (*Float32) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Float32) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Float32) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Float32) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Float32) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Float64 ¶
Float64 is an n-dim array of float64s.
func NewFloat64 ¶
NewFloat64 returns a new n-dimensional array of float64s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewFloat64Shape ¶
NewFloat64Shape returns a new n-dimensional array of float64s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Float64) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Float64) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float64) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Float64) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Float64) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Float64) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Float64) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Float64) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Float64) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Float64) FloatVal1D ¶
func (*Float64) FloatValRowCell ¶ added in v1.0.0
func (*Float64) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Float64) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Float64) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Float64) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Float64) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Float64) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Float64) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Float64) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Float64) SetFloat1D ¶
func (*Float64) SetFloatRowCell ¶ added in v1.0.0
func (*Float64) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Float64) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Float64) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float64) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Float64) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Float64) SetString1D ¶
func (*Float64) SetStringRowCell ¶ added in v1.0.0
func (*Float64) SetZeros ¶
func (tsr *Float64) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Float64) StringVal1D ¶
func (*Float64) StringValRowCell ¶ added in v1.0.0
func (*Float64) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Float64) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Float64) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix.
func (*Float64) SymmetricDim ¶ added in v1.1.1
SymmetricDim returns the number of rows/columns in the matrix.
func (*Float64) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int ¶ added in v1.0.0
Int is an n-dim array of ints, which are assumed to be 64bit in various places so usage on non-64bit platforms is not recommended. However, convenience of avoiding the constant casting is worth it in some cases.
func NewInt ¶ added in v1.0.0
NewInt returns a new n-dimensional array of ints. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewIntShape ¶ added in v1.0.0
NewIntShape returns a new n-dimensional array of ints. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int) Agg ¶ added in v1.0.0
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int) At ¶ added in v1.0.0
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int) Clone ¶ added in v1.0.0
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int) CopyCellsFrom ¶ added in v1.0.0
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int) CopyFrom ¶ added in v1.0.0
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Int) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Int) Dims ¶ added in v1.0.0
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int) Eval ¶ added in v1.0.0
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int) FloatVal1D ¶ added in v1.0.0
func (*Int) FloatValRowCell ¶ added in v1.0.0
func (*Int) Floats ¶ added in v1.0.0
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int) FromArrow ¶ added in v1.0.0
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int) IsNull ¶ added in v1.0.0
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int) IsNull1D ¶ added in v1.0.0
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int) Label ¶ added in v1.0.0
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Int) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Int) Range ¶ added in v1.0.0
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int) SetFloat1D ¶ added in v1.0.0
func (*Int) SetFloatRowCell ¶ added in v1.0.0
func (*Int) SetFloats ¶ added in v1.0.0
SetFloats sets tensor values from a []float64 slice (copies values).
func (*Int) SetFunc ¶ added in v1.0.0
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Int) SetNull ¶ added in v1.0.0
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int) SetNull1D ¶ added in v1.0.0
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int) SetNumRows ¶ added in v1.0.0
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int) SetShape ¶ added in v1.0.0
SetShape sets the shape params, resizing backing storage appropriately
func (*Int) SetString1D ¶ added in v1.0.0
func (*Int) SetStringRowCell ¶ added in v1.0.0
func (*Int) SetZeros ¶ added in v1.0.0
func (tsr *Int) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int) String ¶ added in v1.0.0
String satisfies the fmt.Stringer interface for string of tensor data
func (*Int) StringVal1D ¶ added in v1.0.0
func (*Int) StringValRowCell ¶ added in v1.0.0
func (*Int) SubSpace ¶ added in v1.0.0
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int) SubSpaceTry ¶ added in v1.0.0
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int) T ¶ added in v1.0.0
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int16 ¶
Int16 is an n-dim array of int16s.
func NewInt16 ¶
NewInt16 returns a new n-dimensional array of int16s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt16Shape ¶
NewInt16Shape returns a new n-dimensional array of int16s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int16) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int16) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int16) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int16) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int16) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int16) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Int16) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Int16) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int16) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int16) FloatVal1D ¶
func (*Int16) FloatValRowCell ¶ added in v1.0.0
func (*Int16) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int16) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int16) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int16) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int16) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int16) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Int16) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Int16) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int16) SetFloat1D ¶
func (*Int16) SetFloatRowCell ¶ added in v1.0.0
func (*Int16) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int16) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Int16) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int16) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int16) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int16) SetString1D ¶
func (*Int16) SetStringRowCell ¶ added in v1.0.0
func (*Int16) SetZeros ¶
func (tsr *Int16) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int16) StringVal1D ¶
func (*Int16) StringValRowCell ¶ added in v1.0.0
func (*Int16) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int16) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int16) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int16) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int16) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int32 ¶
Int32 is an n-dim array of int32s.
func NewInt32 ¶
NewInt32 returns a new n-dimensional array of int32s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt32Shape ¶
NewInt32Shape returns a new n-dimensional array of int32s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int32) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int32) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int32) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int32) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int32) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int32) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Int32) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Int32) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int32) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int32) FloatVal1D ¶
func (*Int32) FloatValRowCell ¶ added in v1.0.0
func (*Int32) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int32) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int32) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int32) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int32) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int32) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Int32) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Int32) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int32) SetFloat1D ¶
func (*Int32) SetFloatRowCell ¶ added in v1.0.0
func (*Int32) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int32) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Int32) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int32) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int32) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int32) SetString1D ¶
func (*Int32) SetStringRowCell ¶ added in v1.0.0
func (*Int32) SetZeros ¶
func (tsr *Int32) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int32) StringVal1D ¶
func (*Int32) StringValRowCell ¶ added in v1.0.0
func (*Int32) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int32) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int32) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int32) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int32) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int64 ¶
Int64 is an n-dim array of int64s.
func NewInt64 ¶
NewInt64 returns a new n-dimensional array of int64s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt64Shape ¶
NewInt64Shape returns a new n-dimensional array of int64s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int64) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int64) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int64) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int64) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int64) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int64) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Int64) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Int64) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int64) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int64) FloatVal1D ¶
func (*Int64) FloatValRowCell ¶ added in v1.0.0
func (*Int64) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int64) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int64) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int64) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int64) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int64) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Int64) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Int64) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int64) SetFloat1D ¶
func (*Int64) SetFloatRowCell ¶ added in v1.0.0
func (*Int64) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int64) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Int64) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int64) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int64) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int64) SetString1D ¶
func (*Int64) SetStringRowCell ¶ added in v1.0.0
func (*Int64) SetZeros ¶
func (tsr *Int64) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int64) StringVal1D ¶
func (*Int64) StringValRowCell ¶ added in v1.0.0
func (*Int64) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int64) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int64) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int64) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int64) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Int8 ¶
Int8 is an n-dim array of int8s.
func NewInt8 ¶
NewInt8 returns a new n-dimensional array of int8s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewInt8Shape ¶
NewInt8Shape returns a new n-dimensional array of int8s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Int8) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Int8) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int8) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Int8) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Int8) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Int8) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Int8) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Int8) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Int8) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Int8) FloatVal1D ¶
func (*Int8) FloatValRowCell ¶ added in v1.0.0
func (*Int8) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Int8) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Int8) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Int8) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Int8) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Int8) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Int8) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Int8) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Int8) SetFloat1D ¶
func (*Int8) SetFloatRowCell ¶ added in v1.0.0
func (*Int8) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Int8) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Int8) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int8) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Int8) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Int8) SetString1D ¶
func (*Int8) SetStringRowCell ¶ added in v1.0.0
func (*Int8) SetZeros ¶
func (tsr *Int8) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Int8) StringVal1D ¶
func (*Int8) StringValRowCell ¶ added in v1.0.0
func (*Int8) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int8) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Int8) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int8) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Int8) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Shape ¶
Shape manages a tensor's shape information, including strides and dimension names and can compute the flat index into an underlying 1D data storage array based on an n-dimensional index (and vice-versa). This is fully compatible with (and largely taken from) apache/arrow tensors. except that we use plain int instead of int64, because on all relevant platforms int is *already* 64 and using plain int is much easier. Per C / Go / Python conventions (and unlike emergent) by default indexes are ordered from outer to inner left-to-right, so the inner-most is right-most. This is called Row-Major order, and is the default. It is also possible to use Column-Major order, which is used in R, Julia, and MATLAB, and emergent, where the inner-most index is first and outer-most last. In either case, the internal memory is always organized with the inner-most dimension contiguous in memory -- thus there is no underlying difference between the different indexing systems in terms of underlying memory -- just in the order of indexes used to access this memory.
func AddShapes ¶
AddShapes returns a new shape by adding two shapes one after the other. uses Row / Col order of the first shape for resulting shape
func NewShape ¶
NewShape returns a new shape object initialized with params. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Shape) CopyShape ¶
CopyShape copies the shape parameters from another Shape struct. copies the data so it is not accidentally subject to updates.
func (*Shape) DimNames ¶
DimNames returns slice of dimension names This is *not* a copy -- modifications will change the shape.
func (*Shape) IdxIsValid ¶ added in v1.0.0
IdxIsValid() returns true if given index is valid (within ranges for all dimensions)
func (*Shape) Index ¶
Index returns the n-dimensional index from a "flat" 1D array index. Only works for RowMajor or ColMajor organization.
func (*Shape) IsColMajor ¶
IsColMajor returns true if shape is column-major organized: first dimension is column, i.e., inner-most storage dimension. Values *along a row* are contiguous, as you increment along the major inner-most (column) dimension. Importantly: ColMajor and RowMajor both have the *same* actual memory storage arrangement, with values along a row (across columns) contiguous in memory -- the only difference is in the order of the indexes used to access this memory.
func (*Shape) IsContiguous ¶
IsContiguous returns true if shape is either row or column major
func (*Shape) IsEqual ¶
IsEqual returns true if this shape is same as other (does not compare names)
func (*Shape) IsRowMajor ¶
IsRowMajor returns true if shape is row-major organized: first dimension is the row or outer-most storage dimension. Values *along a row* are contiguous, as you increment along the minor, inner-most (column) dimension. Importantly: ColMajor and RowMajor both have the *same* actual memory storage arrangement, with values along a row (across columns) contiguous in memory -- the only difference is in the order of the indexes used to access this memory.
func (*Shape) Len ¶
Len returns the total length of elements in the tensor (i.e., the product of the shape sizes)
func (*Shape) Offset ¶
Offset returns the "flat" 1D array index into an element at the given n-dimensional index No checking is done on the length or size of the index values relative to the shape of the tensor.
func (*Shape) RowCellSize ¶
RowCellSize returns the size of the outer-most Row shape dimension, and the size of all the remaining inner dimensions (the "cell" size) -- e.g., for Tensors that are columns in a data table. Only valid for RowMajor organization.
func (*Shape) SetShape ¶
SetShape sets the shape parameters. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Shape) SetShape64 ¶
SetShape64 sets the shape parameters from int64 slices (e.g., arrow/tensor). If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func (*Shape) Shape64 ¶
Shape64 returns a slice of int64 containing the dimensions sizes. This is a copy -- modifications will not change shape.
func (*Shape) Shapes ¶
Shapes returns the slice of dimension sizes. This is *not* a copy -- modifications will change the shape.
func (*Shape) Strides ¶
Strides returns the slice of strides This is *not* a copy -- modifications will change the shape.
type String ¶
etensor.String is a tensor of strings backed by a []string slice
func NewString ¶
NewString returns a new n-dimensional array of strings If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created.
func NewStringShape ¶
NewStringShape returns a new n-dimensional array of strings from given shape
func (*String) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*String) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Not supported for String -- do not call!
func (*String) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*String) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*String) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*String) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*String) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*String) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Not supported for String -- do not call!
func (*String) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*String) FloatVal1D ¶
func (*String) FloatValRowCell ¶ added in v1.0.0
func (*String) Label ¶ added in v1.0.1
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*String) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*String) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*String) SetFloat1D ¶
func (*String) SetFloatRowCell ¶ added in v1.0.0
func (*String) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*String) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*String) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*String) SetString1D ¶
func (*String) SetStringRowCell ¶ added in v1.0.0
func (*String) SetZeros ¶
func (tsr *String) SetZeros()
SetZeros is simple convenience function initialize all values to ""
func (*String) String ¶ added in v1.0.1
String satisfies the fmt.Stringer interface for string of tensor data
func (*String) StringVal1D ¶
func (*String) StringValRowCell ¶ added in v1.0.0
func (*String) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*String) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*String) T ¶
T is the gonum/mat.Matrix transpose method. Not supported for String -- do not call!
type Tensor ¶
type Tensor interface { mat.Matrix // Len returns the number of elements in the tensor (product of shape dimensions). Len() int // DataType returns the type of data, using arrow.DataType (ID() is the arrow.Type enum value) DataType() Type // ShapeObj returns a pointer to the shape object that fully parameterizes the tensor shape ShapeObj() *Shape // Shapes returns the size in each dimension of the tensor. (Shape is the full Shape struct) Shapes() []int // Strides returns the number of elements to step in each dimension when traversing the tensor. Strides() []int // Shape64 returns the size in each dimension using int64 (arrow compatbile) Shape64() []int64 // Strides64 returns the strides in each dimension using int64 (arrow compatbile) Strides64() []int64 // NumDims returns the number of dimensions of the tensor. NumDims() int // Dim returns the size of the given dimension Dim(i int) int // DimNames returns the string slice of dimension names DimNames() []string // DimName returns the name of the i-th dimension. DimName(i int) string IsContiguous() bool // IsRowMajor returns true if shape is row-major organized: // first dimension is the row or outer-most storage dimension. // Values *along a row* are contiguous, as you increment along // the minor, inner-most (column) dimension. // Importantly: ColMajor and RowMajor both have the *same* // actual memory storage arrangement, with values along a row // (across columns) contiguous in memory -- the only difference // is in the order of the indexes used to access this memory. IsRowMajor() bool // IsColMajor returns true if shape is column-major organized: // first dimension is column, i.e., inner-most storage dimension. // Values *along a row* are contiguous, as you increment along // the major inner-most (column) dimension. // Importantly: ColMajor and RowMajor both have the *same* // actual memory storage arrangement, with values along a row // (across columns) contiguous in memory -- the only difference // is in the order of the indexes used to access this memory. IsColMajor() bool // RowCellSize returns the size of the outer-most Row shape dimension, // and the size of all the remaining inner dimensions (the "cell" size) // e.g., for Tensors that are columns in a data table. // Only valid for RowMajor organization. RowCellSize() (rows, cells int) // Offset returns the flat 1D array / slice index into an element // at the given n-dimensional index. // No checking is done on the length or size of the index values // relative to the shape of the tensor. Offset(i []int) int // IsNull returns true if the given index has been flagged as a Null // (undefined, not present) value IsNull(i []int) bool // IsNull1D returns true if the given 1-dimensional index has been flagged as a Null // (undefined, not present) value IsNull1D(i int) bool // SetNull sets whether given index has a null value or not. // All values are assumed valid (non-Null) until marked otherwise, and calling // this method creates a Null bitslice map if one has not already been set yet. SetNull(i []int, nul bool) // SetNull1D sets whether given 1-dimensional index has a null value or not. // All values are assumed valid (non-Null) until marked otherwise, and calling // this method creates a Null bitslice map if one has not already been set yet. SetNull1D(i int, nul bool) // FloatVal returns the value of given index as a float64 FloatVal(i []int) float64 // SetFloat sets the value of given index as a float64 SetFloat(i []int, val float64) // StringVal returns the value of given index as a string StringVal(i []int) string // SetString sets the value of given index as a string SetString(i []int, val string) // FloatVal1D returns the value of given 1-dimensional index (0-Len()-1) as a float64 FloatVal1D(i int) float64 // SetFloat1D sets the value of given 1-dimensional index (0-Len()-1) as a float64 SetFloat1D(i int, val float64) // FloatValRowCell returns the value at given row and cell, where row is outer-most dim, // and cell is 1D index into remaining inner dims -- for etable.Table columns FloatValRowCell(row, cell int) float64 // SetFloatRowCell sets the value at given row and cell, where row is outer-most dim, // and cell is 1D index into remaining inner dims -- for etable.Table columns SetFloatRowCell(row, cell int, val float64) // Floats sets []float64 slice of all elements in the tensor // (length is ensured to be sufficient). // This can be used for all of the gonum/floats methods // for basic math, gonum/stats, etc. Floats(flt *[]float64) // SetFloats sets tensor values from a []float64 slice (copies values). SetFloats(vals []float64) // StringVal1D returns the value of given 1-dimensional index (0-Len()-1) as a string StringVal1D(i int) string // SetString1D sets the value of given 1-dimensional index (0-Len()-1) as a string SetString1D(i int, val string) // StringValRowCell returns the value at given row and cell, where row is outer-most dim, // and cell is 1D index into remaining inner dims -- for etable.Table columns StringValRowCell(row, cell int) string // SetStringRowCell sets the value at given row and cell, where row is outer-most dim, // and cell is 1D index into remaining inner dims -- for etable.Table columns SetStringRowCell(row, cell int, val string) // SubSpace returns a new tensor with innermost subspace at given // offset(s) in outermost dimension(s) (len(offs) < NumDims). // Only valid for row or column major layouts. // The new tensor points to the values of the this tensor (i.e., modifications // will affect both), as its Values slice is a view onto the original (which // is why only inner-most contiguous supsaces are supported). // Use Clone() method to separate the two. // Null value bits are NOT shared but are copied if present. SubSpace(offs []int) Tensor // SubSpaceTry returns a new tensor with innermost subspace at given // offset(s) in outermost dimension(s) (len(offs) < NumDims). // Try version returns an error message if the offs do not fit in tensor Shape. // Only valid for row or column major layouts. // The new tensor points to the values of the this tensor (i.e., modifications // will affect both), as its Values slice is a view onto the original (which // is why only inner-most contiguous supsaces are supported). // Use Clone() method to separate the two. // Null value bits are NOT shared but are copied if present. SubSpaceTry(offs []int) (Tensor, error) // Range returns the min, max (and associated indexes, -1 = no values) for the tensor. // This is needed for display and is thus in the core api in optimized form // Other math operations can be done using gonum/floats package. Range() (min, max float64, minIdx, maxIdx int) // Agg applies given aggregation function to each element in the tensor // (automatically skips IsNull and NaN elements), using float64 conversions of the values. // init is the initial value for the agg variable. returns final aggregate value Agg(ini float64, fun AggFunc) float64 // Eval applies given function to each element in the tensor (automatically // skips IsNull and NaN elements), using float64 conversions of the values. // Puts the results into given float64 slice, which is ensured to be of the proper length. Eval(res *[]float64, fun EvalFunc) // SetFunc applies given function to each element in the tensor (automatically // skips IsNull and NaN elements), using float64 conversions of the values. // Writes the results back into the same tensor elements. SetFunc(fun EvalFunc) // SetZeros is simple convenience function initialize all values to 0 SetZeros() // Clone clones this tensor, creating a duplicate copy of itself with its // own separate memory representation of all the values, and returns // that as a Tensor (which can be converted into the known type as needed). Clone() Tensor // CopyFrom copies all avail values from other tensor into this tensor, with an // optimized implementation if the other tensor is of the same type, and // otherwise it goes through appropriate standard type. CopyFrom(from Tensor) // CopyShapeFrom copies just the shape from given source tensor // calling SetShape with the shape params from source (see for more docs). CopyShapeFrom(from Tensor) // CopyCellsFrom copies given range of values from other tensor into this tensor, // using flat 1D indexes: to = starting index in this Tensor to start copying into, // start = starting index on from Tensor to start copying from, and n = number of // values to copy. Uses an optimized implementation if the other tensor is // of the same type, and otherwise it goes through appropriate standard type. CopyCellsFrom(from Tensor, to, start, n int) // SetShape sets the shape parameters of the tensor, and resizes backing storage appropriately. // existing RowMajor or ColMajor stride preference will be used if strides is nil, and // existing names will be preserved if nil SetShape(shape, strides []int, names []string) // SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor. // Does nothing for other stride layouts SetNumRows(rows int) // SetMetaData sets a key=value meta data (stored as a map[string]string). // For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, // min, max set fixed min / max values, background=color SetMetaData(key, val string) // MetaData retrieves value of given key, bool = false if not set MetaData(key string) (string, bool) // MetaDataMap returns the underlying map used for meta data MetaDataMap() map[string]string // CopyMetaData copies meta data from given source tensor CopyMetaData(from Tensor) }
Tensor is the general interface for n-dimensional tensors.
Tensor is automatically a gonum/mat.Matrix, implementing the Dims(), At(), T(), and Symmetric() methods which automatically operate on the inner-most two dimensions, assuming default row-major layout. Error messages will be logged if applied to a Tensor with less than 2 dimensions, and care should be taken when using with > 2 dimensions (e.g., will only affect the first 2D subspace within a higher-dimensional space -- typically you'll want to call SubSpace to get a 2D subspace of the higher-dimensional Tensor (SubSpace is not part of interface as it returns the specific type, but is defined for all Tensor types).
type Type ¶
type Type int
Type is a logical type -- the subset supported by etable. This is copied directly from arrow.Type They can be expressed as either a primitive physical type (bytes or bits of some fixed size), a nested type consisting of other data types, or another data type (e.g. a timestamp encoded as an int64). Note that we need the unconventional CAPS names b/c regular CamelCase is taken by the tensor type itself.
const ( // Null type having no physical storage NULL Type = Type(arrow.NULL) // Bool is a 1 bit, LSB bit-packed ordering BOOL Type = Type(arrow.BOOL) // UINT8 is an Unsigned 8-bit little-endian integer UINT8 Type = Type(arrow.UINT8) // INT8 is a Signed 8-bit little-endian integer INT8 Type = Type(arrow.INT8) // UINT16 is an Unsigned 16-bit little-endian integer UINT16 Type = Type(arrow.UINT16) // INT16 is a Signed 16-bit little-endian integer INT16 Type = Type(arrow.INT16) // UINT32 is an Unsigned 32-bit little-endian integer UINT32 Type = Type(arrow.UINT32) // INT32 is a Signed 32-bit little-endian integer INT32 Type = Type(arrow.INT32) // UINT64 is an Unsigned 64-bit little-endian integer UINT64 Type = Type(arrow.UINT64) // INT64 is a Signed 64-bit little-endian integer INT64 Type = Type(arrow.INT64) // FLOAT16 is a 2-byte floating point value FLOAT16 Type = Type(arrow.FLOAT16) // FLOAT32 is a 4-byte floating point value FLOAT32 Type = Type(arrow.FLOAT32) // FLOAT64 is an 8-byte floating point value FLOAT64 Type = Type(arrow.FLOAT64) // STRING is a UTF8 variable-length string STRING Type = Type(arrow.STRING) // INT is a Signed 64-bit little-endian integer -- should only use on 64bit machines! INT Type = STRING + 1 TypeN = INT + 1 )
func (*Type) FromString ¶
func (Type) MarshalJSON ¶
func (*Type) UnmarshalJSON ¶
type Uint16 ¶
Uint16 is an n-dim array of uint16s.
func NewUint16 ¶
NewUint16 returns a new n-dimensional array of uint16s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint16Shape ¶
NewUint16Shape returns a new n-dimensional array of uint16s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint16) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint16) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint16) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint16) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint16) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint16) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Uint16) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Uint16) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint16) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint16) FloatVal1D ¶
func (*Uint16) FloatValRowCell ¶ added in v1.0.0
func (*Uint16) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint16) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint16) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint16) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint16) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint16) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Uint16) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Uint16) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint16) SetFloat1D ¶
func (*Uint16) SetFloatRowCell ¶ added in v1.0.0
func (*Uint16) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint16) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Uint16) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint16) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint16) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint16) SetString1D ¶
func (*Uint16) SetStringRowCell ¶ added in v1.0.0
func (*Uint16) SetZeros ¶
func (tsr *Uint16) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint16) StringVal1D ¶
func (*Uint16) StringValRowCell ¶ added in v1.0.0
func (*Uint16) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint16) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint16) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint16) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint16) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Uint32 ¶
Uint32 is an n-dim array of uint32s.
func NewUint32 ¶
NewUint32 returns a new n-dimensional array of uint32s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint32Shape ¶
NewUint32Shape returns a new n-dimensional array of uint32s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint32) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint32) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint32) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint32) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint32) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint32) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Uint32) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Uint32) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint32) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint32) FloatVal1D ¶
func (*Uint32) FloatValRowCell ¶ added in v1.0.0
func (*Uint32) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint32) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint32) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint32) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint32) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint32) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Uint32) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Uint32) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint32) SetFloat1D ¶
func (*Uint32) SetFloatRowCell ¶ added in v1.0.0
func (*Uint32) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint32) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Uint32) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint32) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint32) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint32) SetString1D ¶
func (*Uint32) SetStringRowCell ¶ added in v1.0.0
func (*Uint32) SetZeros ¶
func (tsr *Uint32) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint32) StringVal1D ¶
func (*Uint32) StringValRowCell ¶ added in v1.0.0
func (*Uint32) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint32) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint32) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint32) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint32) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Uint64 ¶
Uint64 is an n-dim array of uint64s.
func NewUint64 ¶
NewUint64 returns a new n-dimensional array of uint64s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint64Shape ¶
NewUint64Shape returns a new n-dimensional array of uint64s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint64) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint64) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint64) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint64) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint64) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint64) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Uint64) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Uint64) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint64) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint64) FloatVal1D ¶
func (*Uint64) FloatValRowCell ¶ added in v1.0.0
func (*Uint64) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint64) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint64) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint64) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint64) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint64) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Uint64) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Uint64) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint64) SetFloat1D ¶
func (*Uint64) SetFloatRowCell ¶ added in v1.0.0
func (*Uint64) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint64) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Uint64) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint64) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint64) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint64) SetString1D ¶
func (*Uint64) SetStringRowCell ¶ added in v1.0.0
func (*Uint64) SetZeros ¶
func (tsr *Uint64) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint64) StringVal1D ¶
func (*Uint64) StringValRowCell ¶ added in v1.0.0
func (*Uint64) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint64) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint64) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint64) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint64) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.
type Uint8 ¶
Uint8 is an n-dim array of uint8s.
func NewUint8 ¶
NewUint8 returns a new n-dimensional array of uint8s. If strides is nil, row-major strides will be inferred. If names is nil, a slice of empty strings will be created. Nulls are initialized to nil.
func NewUint8Shape ¶
NewUint8Shape returns a new n-dimensional array of uint8s. Using shape structure instead of separate slices, and optionally existing values if vals != nil (must be of proper length) -- we directly set our internal Values = vals, thereby sharing the same underlying data. Nulls are initialized to nil.
func (*Uint8) Agg ¶
Agg applies given aggregation function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. init is the initial value for the agg variable. returns final aggregate value
func (*Uint8) At ¶
At is the gonum/mat.Matrix interface method for returning 2D matrix element at given row, column index. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint8) Clone ¶
Clone clones this tensor, creating a duplicate copy of itself with its own separate memory representation of all the values, and returns that as a Tensor (which can be converted into the known type as needed).
func (*Uint8) CopyCellsFrom ¶
CopyCellsFrom copies given range of values from other tensor into this tensor, using flat 1D indexes: to = starting index in this Tensor to start copying into, start = starting index on from Tensor to start copying from, and n = number of values to copy. Uses an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type.
func (*Uint8) CopyFrom ¶
CopyFrom copies all avail values from other tensor into this tensor, with an optimized implementation if the other tensor is of the same type, and otherwise it goes through appropriate standard type. Copies Null state as well if present.
func (*Uint8) CopyMetaData ¶ added in v1.0.0
CopyMetaData copies meta data from given source tensor
func (*Uint8) CopyShapeFrom ¶ added in v1.0.0
CopyShapeFrom copies just the shape from given source tensor calling SetShape with the shape params from source (see for more docs).
func (*Uint8) Dims ¶
Dims is the gonum/mat.Matrix interface method for returning the dimensionality of the 2D Matrix. Assumes Row-major ordering and logs an error if NumDims < 2.
func (*Uint8) Eval ¶
Eval applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Puts the results into given float64 slice, which is ensured to be of the proper length.
func (*Uint8) FloatVal1D ¶
func (*Uint8) FloatValRowCell ¶ added in v1.0.0
func (*Uint8) Floats ¶
Floats sets []float64 slice of all elements in the tensor (length is ensured to be sufficient). This can be used for all of the gonum/floats methods for basic math, gonum/stats, etc.
func (*Uint8) FromArrow ¶
FromArrow intializes this tensor from an arrow tensor of same type cpy = true means make a copy of the arrow data, otherwise it directly refers to its values slice -- we do not Retain() on that data so it is up to the go GC and / or your own memory management policies to ensure the data remains intact!
func (*Uint8) IsNull ¶
IsNull returns true if the given index has been flagged as a Null (undefined, not present) value
func (*Uint8) IsNull1D ¶
IsNull1D returns true if the given 1-dimensional index has been flagged as a Null (undefined, not present) value
func (*Uint8) Label ¶
Label satisfies the gi.Labeler interface for a summary description of the tensor
func (*Uint8) MetaData ¶ added in v1.0.0
MetaData retrieves value of given key, bool = false if not set
func (*Uint8) MetaDataMap ¶ added in v1.0.0
MetaDataMap returns the underlying map used for meta data
func (*Uint8) Range ¶
Range returns the min, max (and associated indexes, -1 = no values) for the tensor. This is needed for display and is thus in the core api in optimized form Other math operations can be done using gonum/floats package.
func (*Uint8) SetFloat1D ¶
func (*Uint8) SetFloatRowCell ¶ added in v1.0.0
func (*Uint8) SetFunc ¶
SetFunc applies given function to each element in the tensor (automatically skips IsNull and NaN elements), using float64 conversions of the values. Writes the results back into the same tensor elements.
func (*Uint8) SetMetaData ¶ added in v1.0.0
SetMetaData sets a key=value meta data (stored as a map[string]string). For TensorGrid display: top-zero=+/-, odd-row=+/-, image=+/-, min, max set fixed min / max values, background=color
func (*Uint8) SetNull ¶
SetNull sets whether given index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint8) SetNull1D ¶
SetNull1D sets whether given 1-dimensional index has a null value or not. All values are assumed valid (non-Null) until marked otherwise, and calling this method creates a Null bitslice map if one has not already been set yet.
func (*Uint8) SetNumRows ¶
SetNumRows sets the number of rows (outer-most dimension) in a RowMajor organized tensor.
func (*Uint8) SetString1D ¶
func (*Uint8) SetStringRowCell ¶ added in v1.0.0
func (*Uint8) SetZeros ¶
func (tsr *Uint8) SetZeros()
SetZeros is simple convenience function initialize all values to 0
func (*Uint8) StringVal1D ¶
func (*Uint8) StringValRowCell ¶ added in v1.0.0
func (*Uint8) SubSpace ¶
SubSpace returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint8) SubSpaceTry ¶
SubSpaceTry returns a new tensor with innermost subspace at given offset(s) in outermost dimension(s) (len(offs) < NumDims). Try version returns an error message if the offs do not fit in tensor Shape. Only valid for row or column major layouts. The new tensor points to the values of the this tensor (i.e., modifications will affect both), as its Values slice is a view onto the original (which is why only inner-most contiguous supsaces are supported). Use Clone() method to separate the two. Null value bits are NOT shared but are copied if present.
func (*Uint8) Symmetric ¶ added in v1.0.0
Symmetric is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint8) SymmetricDim ¶ added in v1.1.1
SymmetricDim is the gonum/mat.Matrix interface method for returning the dimensionality of a symmetric 2D Matrix. Logs error if called on non-symmetric matrix.
func (*Uint8) T ¶
T is the gonum/mat.Matrix transpose method. It performs an implicit transpose by returning the receiver inside a Transpose.