Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Commit

Permalink
Add optimize: prefix to panic messages in local.go
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-ch committed Mar 20, 2015
1 parent a574ee9 commit 0fd3183
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions local.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import (
// input struct.
func Local(f Function, initX []float64, settings *Settings, method Method) (*Result, error) {
if len(initX) == 0 {
panic("local: initial X has zero length")
panic("optimize: initial X has zero length")
}

startTime := time.Now()
Expand Down Expand Up @@ -174,7 +174,7 @@ func minimize(settings *Settings, method Method, funcInfo *functionInfo, stats *
return
}
}
panic("unreachable")
panic("optimize: unreachable")
}

func copyLocation(dst, src *Location) {
Expand Down Expand Up @@ -222,7 +222,7 @@ func getStartingLocation(funcInfo *functionInfo, method Method, initX []float64,
if loc.Gradient != nil {
initG := settings.InitialGradient
if len(initG) != dim {
panic("local: initial location size mismatch")
panic("optimize: initial location size mismatch")
}
copy(loc.Gradient, initG)
}
Expand Down Expand Up @@ -428,13 +428,13 @@ func evaluate(funcInfo *functionInfo, evalType EvaluationType, xNext []float64,
if different {
// Optimizers should not request NoEvaluation at a new location.
// The intent and therefore an appropriate action are both unclear.
panic("no evaluation requested at new location")
panic("optimize: no evaluation requested at new location")
}
return
default:
panic(fmt.Sprintf("unknown evaluation type %v", evalType))
panic(fmt.Sprintf("optimize: unknown evaluation type %v", evalType))
}
panic(fmt.Sprintf("objective function does not support %v", evalType))
panic(fmt.Sprintf("optimize: objective function does not support %v", evalType))
}

// update updates the stats given the new evaluation
Expand Down

0 comments on commit 0fd3183

Please sign in to comment.