mathlib

package module
v0.0.0-...-d6e8a04 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: MIT Imports: 5 Imported by: 0

README

mathlib is a golang math lib

mathlib provides the following packages

  • Stats - For statistics computations
  • Vector - For vector operations
  • Matrix - For matrix operations
  • Plot - Package to plot

NB this lib is under dev

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadCSV

func ReadCSV(filename string) ([][]string, error)

ReadCSV reads all the data from csv file

func ReadCSVAsFloat

func ReadCSVAsFloat(filename string) ([][]float64, error)

ReadCSVAsFloat returns the values of csv as floats TODO runtime for very large csv file ???

Types

type Set

type Set map[interface{}]bool

Set represents a set data type

func NewSet

func NewSet(values ...interface{}) Set

NewSet create a new set from values

Example
package main

import (
	"fmt"

	"github.com/Duncodes/mathlib"
)

func main() {
	set := mathlib.NewSet(1, 2, 3, 3, 4)

	fmt.Println(set)

}
Output:

func (Set) Add

func (s Set) Add(i interface{})

Adds an elemets to the set

func (Set) Cardinality

func (s Set) Cardinality() int

func (Set) Contains

func (s Set) Contains(i interface{}) bool

Contains returns true if an element is contained in set

func (Set) Difference

func (s Set) Difference(set Set) Set

Difference returns a set of elements that are in the object set and not in provided set

func (Set) Intersection

func (s Set) Intersection(set Set) Set

Intersection return a set of those elemets that are in both sets

func (Set) IsSubsetOf

func (s Set) IsSubsetOf(set Set) bool

IsSubsetOf returns true if set contains another set

func (Set) Len

func (s Set) Len() int

Len returns length of the set

func (Set) Remove

func (s Set) Remove(i interface{})

func (Set) String

func (s Set) String() string

String returns a set as a string

func (Set) Union

func (s Set) Union(set Set) Set

Union joins two sets together

Directories

Path Synopsis
Package matrix provide function and methods for matrix operations Matrix operations are done on float arrays
Package matrix provide function and methods for matrix operations Matrix operations are done on float arrays
Package plot provides methods to plot chats and graphs
Package plot provides methods to plot chats and graphs
Package stats provided functions and methods to compute stat
Package stats provided functions and methods to compute stat

Jump to

Keyboard shortcuts

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