cost

package
v0.0.0-...-3948e75 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Add

type Add struct{}

func (Add) Code

func (Add) Code() string

type ConstMul

type ConstMul uint

func (ConstMul) Code

func (c ConstMul) Code() string

type Count

type Count struct {
	N  int
	Op Operation
}

func (Count) String

func (c Count) String() string

func (Count) Weight

func (c Count) Weight(m Model) float64

type Counts

type Counts []Count

func Operations

func Operations(f *efd.Formula) (Counts, error)

Operations counts operation types used in the given formula.

func (Counts) Sort

func (c Counts) Sort(m Model)

Sort by weight of the operation according to the model.

func (Counts) String

func (c Counts) String() string

func (Counts) Summary

func (c Counts) Summary() string

Summary returns a concise string representation of the operation counts, discarding negligible operations.

func (Counts) Weight

func (c Counts) Weight(m Model) float64

type Inv

type Inv struct{}

func (Inv) Code

func (Inv) Code() string

type Model

type Model interface {
	Weight(Operation) float64
}

type Mul

type Mul struct{}

func (Mul) Code

func (Mul) Code() string

type Operation

type Operation interface {
	Code() string
}

type ParamMul

type ParamMul string

func (ParamMul) Code

func (p ParamMul) Code() string

type Pow

type Pow uint

func (Pow) Code

func (p Pow) Code() string

func (Pow) IsSquare

func (p Pow) IsSquare() bool

type Weights

type Weights struct {
	I      float64
	M      float64
	S      float64
	Pow    float64
	ParamM float64
	Add    float64
	ConstM float64
}

func (Weights) Weight

func (w Weights) Weight(op Operation) float64

Jump to

Keyboard shortcuts

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