Skip to content

Commit

Permalink
move one more
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncolburne committed Jan 6, 2025
1 parent 808d4cf commit 6e3a56c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 0 additions & 24 deletions conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,27 +358,3 @@ func hintBitUnpack(parameters ParameterSet, y []byte) [][]bool {

return h
}

func vectorMaxAbsCoefficient(parameters ParameterSet, v [][]int32, lowBitsOnly bool) int32 {
max := int32(0)
for _, row := range v {
for _, value := range row {
var x int32
if lowBitsOnly {
x = lowBits(parameters, value)
} else {
x = value
}

if x < 0 {
x *= -1
}

if max < x {
max = x
}
}
}

return max
}
24 changes: 24 additions & 0 deletions reduction.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,27 @@ func onesInH(h [][]bool) int32 {

return count
}

func vectorMaxAbsCoefficient(parameters ParameterSet, v [][]int32, lowBitsOnly bool) int32 {
max := int32(0)
for _, row := range v {
for _, value := range row {
var x int32
if lowBitsOnly {
x = lowBits(parameters, value)
} else {
x = value
}

if x < 0 {
x *= -1
}

if max < x {
max = x
}
}
}

return max
}

0 comments on commit 6e3a56c

Please sign in to comment.