native,cgo: replace string literal in Dlasrt with string const

This commit is contained in:
Vladimir Chalupecky
2016-11-30 12:01:45 +01:00
parent 2fbe0d0651
commit fd815ff6d3
3 changed files with 4 additions and 2 deletions

View File

@@ -37,6 +37,7 @@ const (
badShifts = "lapack: bad shifts" badShifts = "lapack: bad shifts"
badSide = "lapack: bad side" badSide = "lapack: bad side"
badSlice = "lapack: bad input slice length" badSlice = "lapack: bad input slice length"
badSort = "lapack: bad Sort"
badStore = "lapack: bad store" badStore = "lapack: bad store"
badTau = "lapack: tau has insufficient length" badTau = "lapack: tau has insufficient length"
badTauQ = "lapack: tauQ has insufficient length" badTauQ = "lapack: tauQ has insufficient length"
@@ -462,7 +463,7 @@ func (impl Implementation) Dlasrt(s lapack.Sort, n int, d []float64) {
checkVector(n, d, 1) checkVector(n, d, 1)
switch s { switch s {
default: default:
panic("lapack: bad sort") panic(badSort)
case lapack.SortIncreasing, lapack.SortDecreasing: case lapack.SortIncreasing, lapack.SortDecreasing:
} }
lapacke.Dlasrt(byte(s), n, d[:n]) lapacke.Dlasrt(byte(s), n, d[:n])

View File

@@ -20,7 +20,7 @@ func (impl Implementation) Dlasrt(s lapack.Sort, n int, d []float64) {
d = d[:n] d = d[:n]
switch s { switch s {
default: default:
panic("lapack: bad sort") panic(badSort)
case lapack.SortIncreasing: case lapack.SortIncreasing:
sort.Float64s(d) sort.Float64s(d)
case lapack.SortDecreasing: case lapack.SortDecreasing:

View File

@@ -41,6 +41,7 @@ const (
badShifts = "lapack: bad shifts" badShifts = "lapack: bad shifts"
badSide = "lapack: bad side" badSide = "lapack: bad side"
badSlice = "lapack: bad input slice length" badSlice = "lapack: bad input slice length"
badSort = "lapack: bad Sort"
badStore = "lapack: bad store" badStore = "lapack: bad store"
badTau = "lapack: tau has insufficient length" badTau = "lapack: tau has insufficient length"
badTauQ = "lapack: tauQ has insufficient length" badTauQ = "lapack: tauQ has insufficient length"