vector

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

vector/bruh.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vec added in v1.0.2

type Vec[T any] struct {
	Capacity int
	Updator  float32

	Data *[]T
	// contains filtered or unexported fields
}

func New added in v1.0.2

func New[T any](p_AdditionalCapacity int, p_Updator float32, p_Data []T) Vec[T]

func (*Vec[T]) Extend added in v1.0.2

func (me *Vec[T]) Extend(by int)
#

Extend extends the capacity of the vector.

`by` : is optional and specifies the amount by which the capacity should be increased.
If 'by' is 0, the capacity will be increased by its current value multiplied by the Updator.
No return value.

func (*Vec[T]) Format added in v1.0.2

func (me *Vec[T]) Format(f fmt.State, c rune)

func (*Vec[T]) Push added in v1.0.2

func (me *Vec[T]) Push(v T)
Push adds a new element to the vector.

The element to be added is passed as the parameter v. No return value. EX:

bruh.Push(69)
bruh.Push(MyStruct{name: "mohammed" , age: 20})

func (*Vec[T]) RemoveByIndex added in v1.0.2

func (me *Vec[T]) RemoveByIndex(index int)

func (*Vec[T]) Size added in v1.0.2

func (me *Vec[T]) Size() int

func (*Vec[T]) String added in v1.0.2

func (me *Vec[T]) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL