Skip to content
Snippets Groups Projects
Commit ad94adc5 authored by Andrew E. Torda's avatar Andrew E. Torda
Browse files

Unused variables found by golangci-lint.

parent 20d8b583
No related branches found
No related tags found
No related merge requests found
......@@ -10,15 +10,12 @@ import (
"os"
)
const ndimDflt = 2
type mcPrm struct {
iniTmp, fnlTmp float32 // Initial and final temperatures
xIni []float32 // initial x slice
xDlta float32 // change x by up to +- xDlta in trial moves
nStep uint32 // number of steps
nRun uint32 // number of separate runs
nOutput uint32 // write at least this many lines of output
fOutName string // where we write output to
fPltName string // where we plot to (function values)
xPltName string // where we plot x trajectories to
......
......@@ -60,7 +60,7 @@ func isNotSane (mcPrm *mcPrm) error {
func setupRun(mcPrm *mcPrm, cprm *cprm) error {
const finalTempErr = "Final temp %g higher than initial temp %g"
var err error
if mcPrm.dummy == true {
if mcPrm.dummy {
return nil
}
cprm.rand = rand.New(rand.NewSource(getSeed()))
......@@ -118,14 +118,14 @@ func setupRun(mcPrm *mcPrm, cprm *cprm) error {
// newx gets a candidate x slice. We have n dimensions, so a candidate
// move is a slice of length n.
func nnewx(xold []float32, xT []float32, rand *rand.Rand, xDlta float32) {
/*
func newx(xold []float32, xT []float32, rand *rand.Rand, xDlta float32) {
for i, x := range xold {
t := 2.*rand.Float32() - 1
t *= xDlta
xT[i] = x + t
}
}
} */
// newx will move just one coordinate at a time
func newx(xold []float32, xT []float32, rand *rand.Rand, xDlta float32) {
var iDim int
......@@ -228,7 +228,7 @@ func doRun(mcPrm *mcPrm) error {
accept = true
}
}
if accept == true {
if accept {
nAcc++
runAcc = runMult*runAcc + (1.0 - runMult)
copy(x, xT)
......
......@@ -23,7 +23,7 @@ import (
)
// maketicks gives reasonable default tick locations
func maketicks(axisDscrpt axticks.AxisDscrpt, prcsn int) []chart.Tick {
func maketicks(axisDscrpt axticks.AxisDscrpt) []chart.Tick {
xmin, xmax, delta, prcsn := axisDscrpt.Xmin, axisDscrpt.Xmax, axisDscrpt.Delta, axisDscrpt.Prcsn
rnge := axisDscrpt.Xmax - axisDscrpt.Xmin
ntick := int(math.Round((rnge / delta) + 1))
......@@ -41,7 +41,7 @@ func maketicks(axisDscrpt axticks.AxisDscrpt, prcsn int) []chart.Tick {
return t
}
// maketicks this version works, but usually leaves you wanting one tick more.
func alt_maketicks(axisDscrpt axticks.AxisDscrpt, prcsn int) []chart.Tick {
/*func alt_maketicks(axisDscrpt axticks.AxisDscrpt, prcsn int) []chart.Tick {
xmin, xmax, delta, prcsn := axisDscrpt.Xmin, axisDscrpt.Xmax, axisDscrpt.Delta, axisDscrpt.Prcsn
var t []chart.Tick
const fstr = "%.*f"
......@@ -50,11 +50,11 @@ func alt_maketicks(axisDscrpt axticks.AxisDscrpt, prcsn int) []chart.Tick {
fmt.Println (axisDscrpt)
}
for ; xv <= xmax; xv, xl = xv+delta, fmt.Sprintf("%.*f", prcsn, xv) {
t = append(t, chart.Tick {xv, xl})
t = append(t, chart.Tick {Value: xv, Label: xl})
}
return t
}
}*/
// range2 just lets us append methods to a range/continuousrange structure
type range2 struct {
......@@ -73,7 +73,7 @@ func (rng *range2) GetTicks(r chart.Renderer, cs chart.Style, vf chart.ValueForm
} else {
rng.Min = a.Xmin
rng.Max = a.Xmax
return maketicks(a, a.Prcsn)
return maketicks(a)
}
}
......
......@@ -15,7 +15,6 @@ import (
"strings"
)
var i int = 6
var cmdDflt = []struct {
key string
v string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment