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

Method InsertRows

tensor/table/indexview.go:449–457  ·  view source on GitHub ↗

InsertRows adds n rows to end of underlying Table, and to the indexes starting at given index in this view

(at, n int)

Source from the content-addressed store, hash-verified

447// InsertRows adds n rows to end of underlying Table, and to the indexes starting at
448// given index in this view
449func (ix *IndexView) InsertRows(at, n int) {
450 stidx := ix.Table.Rows
451 ix.Table.SetNumRows(stidx + n)
452 nw := make([]int, n, n+len(ix.Indexes)-at)
453 for i := 0; i < n; i++ {
454 nw[i] = stidx + i
455 }
456 ix.Indexes = append(ix.Indexes[:at], append(nw, ix.Indexes[at:]...)...)
457}
458
459// DeleteRows deletes n rows of indexes starting at given index in the list of indexes
460func (ix *IndexView) DeleteRows(at, n int) {

Callers 2

NewAtMethod · 0.80
PasteAtIndexMethod · 0.80

Calls 1

SetNumRowsMethod · 0.65

Tested by

no test coverage detected