model

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func L1Norm

func L1Norm(numbers []int) (l1norm int)

L1Norm returns L1 norm of numbers

func Sum

func Sum(numbers []int) (sum int)

Sum returns sum of numbers

func SumFromString

func SumFromString(stringNumbers []string) (sum int, err error)

SumFromString returns sum numbers which be converted from strings

Types

type Numbers

type Numbers []int

Numbers represents numbers

func NewNumbers

func NewNumbers(nums []int) Numbers

NewNumbers is constructor for Numbers

func (Numbers) CalcL1Norm

func (n Numbers) CalcL1Norm() int

CalcL1Norm calc L1 norm of numbers

func (Numbers) CalcSum

func (n Numbers) CalcSum() int

CalcSum calc sum of numbers

type SumHistory

type SumHistory struct {
	IsNorm  bool
	Date    time.Time
	Numbers Numbers
	Result  int
}

SumHistory represents history of sum calculation

Jump to

Keyboard shortcuts

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