MCPcopy Create free account
hub / github.com/cogentcore/core / Floats

Method Floats

tensor/string.go:144–149  ·  view source on GitHub ↗

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.

(flt *[]float64)

Source from the content-addressed store, hash-verified

142// This can be used for all of the gonum/floats methods
143// for basic math, gonum/stats, etc.
144func (tsr *String) Floats(flt *[]float64) {
145 *flt = slicesx.SetLength(*flt, len(tsr.Values))
146 for i, v := range tsr.Values {
147 (*flt)[i] = StringToFloat64(v)
148 }
149}
150
151// SetFloats sets tensor values from a []float64 slice (copies values).
152func (tsr *String) SetFloats(flt []float64) {

Callers

nothing calls this directly

Calls 2

SetLengthFunction · 0.92
StringToFloat64Function · 0.85

Tested by

no test coverage detected