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

Method CopyFrom

tensor/table/splits.go:295–311  ·  view source on GitHub ↗

CopyFrom copies from other Splits -- we get our own unique copy of everything

(osp *Splits)

Source from the content-addressed store, hash-verified

293
294// CopyFrom copies from other Splits -- we get our own unique copy of everything
295func (spl *Splits) CopyFrom(osp *Splits) {
296 spl.Splits = make([]*IndexView, len(osp.Splits))
297 spl.Values = make([][]string, len(osp.Values))
298 for si := range osp.Splits {
299 spl.Splits[si] = osp.Splits[si].Clone()
300 spl.Values[si] = slices.Clone(osp.Values[si])
301 }
302 spl.Levels = slices.Clone(osp.Levels)
303
304 nag := len(osp.Aggs)
305 if nag > 0 {
306 spl.Aggs = make([]*SplitAgg, nag)
307 for ai := range osp.Aggs {
308 spl.Aggs[ai] = osp.Aggs[ai].Clone()
309 }
310 }
311}
312
313// AddAgg adds a new set of aggregation results for the Splits
314func (spl *Splits) AddAgg(name string, colIndex int) *SplitAgg {

Callers 1

CloneMethod · 0.95

Calls 1

CloneMethod · 0.65

Tested by

no test coverage detected