window

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const MinSize = 1
View Source
const NumError = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type W

type W struct {
	// contains filtered or unexported fields
}
Example
package main

import (
	"fmt"

	"github.com/skhal/lab/iq/40/window"
)

func main() {
	nn := []int{1, 4, 2, 3, 1, 2}
	mm := make([]int, 0, len(nn))
	for w, _ := window.New(nn, 3); w.Slide(); {
		mm = append(mm, w.Max())
	}
	fmt.Printf("%v\n", mm)
}
Output:
[1 4 4 4 3 3]

func New

func New(nn []int, size int) (*W, error)

func (*W) Max

func (w *W) Max() int

func (*W) Slide

func (w *W) Slide() bool

Jump to

Keyboard shortcuts

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