util

package
v0.0.0-...-198821d Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(e error)

func Exchange2Nodes

func Exchange2Nodes(data []int, i, j int)

func GenerateRandomPermutation

func GenerateRandomPermutation(n int) []int
	 Copyright (C) 2004  Thomas Stuetzle
      FUNCTION:       generate a random permutation of the integers 0 .. n-1
      INPUT:          length of the array
      OUTPUT:         pointer to the random permutation
      (SIDE)EFFECTS:  the array holding the random permutation is allocated in this
                      function. Don't forget to free again the memory!
      COMMENTS:       only needed by the local search procedures

func PrintErrorAndExit

func PrintErrorAndExit(err error)

prints error and exits on abnormal conditions

func SaveTourLengthImage

func SaveTourLengthImage(fname string, data1, data2 []TourLengthData)

func SaveVisitedImage

func SaveVisitedImage(fname string, data []CityData)

func WriteFile

func WriteFile(fname, data string)

Types

type CityData

type CityData struct {
	Idx  int
	X, Y float64
}

type ResultData

type ResultData struct {
	//	ProblemName string
	//   Tries int
	Results []*TestData
}

func (*ResultData) SaveDataToFile

func (p *ResultData) SaveDataToFile(fname string)

type TestData

type TestData struct {
	Name string
	Args string
	Data []float64
}

func (*TestData) Max

func (p *TestData) Max() float64

func (*TestData) Mean

func (p *TestData) Mean() float64

func (*TestData) Min

func (p *TestData) Min() float64

func (*TestData) Std

func (p *TestData) Std() float64

type TourLengthData

type TourLengthData struct {
	Iteration int
	Data      int
}

Jump to

Keyboard shortcuts

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