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

Method SetTensorFloat1D

tensor/table/table.go:668–683  ·  view source on GitHub ↗

SetTensorFloat1D sets the tensor cell's float cell value at given 1D index within cell, at given column (by name), row index for columns that have n-dimensional tensors. Returns true if set.

(column string, row int, idx int, val float64)

Source from the content-addressed store, hash-verified

666// at given column (by name), row index for columns that have n-dimensional tensors.
667// Returns true if set.
668func (dt *Table) SetTensorFloat1D(column string, row int, idx int, val float64) bool {
669 if !dt.IsValidRow(row) {
670 return false
671 }
672 ct := dt.ColumnByName(column)
673 if ct == nil {
674 return false
675 }
676 _, sz := ct.RowCellSize()
677 if idx >= sz || idx < 0 {
678 return false
679 }
680 off := row*sz + idx
681 ct.SetFloat1D(off, val)
682 return true
683}
684
685//////////////////////////////////////////////////////////////////////////////////////
686// Copy Cell

Callers

nothing calls this directly

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 4

IsValidRowMethod · 0.95
ColumnByNameMethod · 0.95
RowCellSizeMethod · 0.65
SetFloat1DMethod · 0.65

Tested by

no test coverage detected