Skip to content

CaptainDyce/vectopsf64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vectopsf64

Vector ([]float64) library - immediate operations on float64 arrays

Quick Example

package main

import (
	"fmt"
	v "github.com/CaptainDyce/vectopsf64"
	"math"
)

func main() {
	// defining an identity vector 0..100, dividing each entry by 2*pi, apply math.Sin and reverse the vector
	v1 := v.OnIdent(100).Divl(2 * math.Pi).ApplyOp(math.Sin).Rev()
	fmt.Println(v1)
	// print the sum of the section [50..70[
	fmt.Println(v1.Slice(50, 70).Sum())

	a := make([]float64, 100)
	v2 := v.On(a).Ident().Divl(2 * math.Pi).ApplyOp(math.Sin).Rev()
	fmt.Println(v2)
	// print the sum of the section [50..70[
	fmt.Println(v2.Slice(50, 70).Sum())
}

About

Vector (float64) library - immediate operations on vectors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages