fbuf

package
v0.0.0-...-9c88ebf Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package fbuf provides a set of helpers around buffers of []float64.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(c int, buf []float64) []float64

Empty returns a zero length buffer with at least capacity c. If the provided buffer has capacity, it will be used otherwise a new one is created.

func ReduceCapacity

func ReduceCapacity(c int, buf []float64) []float64

ReduceCapacity sets the capacity to a lower value. This can be useful when splitting a buffer to prevent use of the first part of the buffer from overflowing into the second part.

func Slice

func Slice(c int, buf []float64) []float64

Slice returns a buffer with length c. If the provided buffer has capacity, it will be used otherwise a new one is created.

func Split

func Split(c int, buf []float64) ([]float64, []float64)

Split a buffer returns two buffers from one. The frist buffer will have at least capacity c. The second buffer will have the remainder. If the provided buffer does not have a capacity a new buffer is created.

func Zeros

func Zeros(c int, buf []float64) []float64

Zeros returns a buffer with length c with all values set to 0. If the provided buffer has capacity, it will be used otherwise a new one is created.

Types

This section is empty.

Jump to

Keyboard shortcuts

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