Skip to content

Commit

Permalink
fix: Lowercase twist
Browse files Browse the repository at this point in the history
  • Loading branch information
sp301415 committed Dec 12, 2023
1 parent 83a153d commit 3841ca2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions math/poly/asm_fft_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func invFFTInPlace(coeffs, wNjInv []complex128) {

func untwistInPlaceAVX2(coeffs, w2NjInv []complex128)

// unTwistInPlace untwists the coefficients after inverse FFT.
// untwistInPlace untwists the coefficients after inverse FFT.
// Equivalent to coeffs * w2NjInv.
func unTwistInPlace(coeffs, w2NjInv []complex128) {
func untwistInPlace(coeffs, w2NjInv []complex128) {
if cpu.X86.HasAVX2 && cpu.X86.HasFMA {
untwistInPlaceAVX2(coeffs, w2NjInv)
return
Expand All @@ -81,8 +81,8 @@ func unTwistInPlace(coeffs, w2NjInv []complex128) {

func untwistAndScaleInPlaceAVX2(coeffs, w2NjInv []complex128, maxT float64)

// unTwistAndScaleInPlace untwists the coefficients and scales it with maxT.
func unTwistAndScaleInPlace(coeffs, w2NjInv []complex128, maxT float64) {
// untwistAndScaleInPlace untwists the coefficients and scales it with maxT.
func untwistAndScaleInPlace(coeffs, w2NjInv []complex128, maxT float64) {
if cpu.X86.HasAVX2 && cpu.X86.HasFMA {
untwistAndScaleInPlaceAVX2(coeffs, w2NjInv, maxT)
return
Expand Down
24 changes: 12 additions & 12 deletions math/poly/fourier_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (f *FourierEvaluator[T]) ToStandardPolyAssign(fp FourierPoly, pOut Poly[T])

f.buffer.fpInv.CopyFrom(fp)
invFFTInPlace(f.buffer.fpInv.Coeffs, f.wNjInv)
unTwistInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv)
untwistInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv)

Check failure on line 104 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistInPlace

Check failure on line 104 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistInPlace

Check failure on line 104 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistInPlace

Check failure on line 104 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] = T(int64(real(f.buffer.fpInv.Coeffs[j])))
Expand All @@ -117,7 +117,7 @@ func (f *FourierEvaluator[T]) ToStandardPolyAssignUnsafe(fp FourierPoly, pOut Po
N := f.degree

invFFTInPlace(fp.Coeffs, f.wNjInv)
unTwistInPlace(fp.Coeffs, f.w2NjInv)
untwistInPlace(fp.Coeffs, f.w2NjInv)

Check failure on line 120 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistInPlace

Check failure on line 120 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistInPlace

Check failure on line 120 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistInPlace

Check failure on line 120 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] = T(int64(real(fp.Coeffs[j])))
Expand All @@ -131,7 +131,7 @@ func (f *FourierEvaluator[T]) ToStandardPolyAddAssign(fp FourierPoly, pOut Poly[

f.buffer.fpInv.CopyFrom(fp)
invFFTInPlace(f.buffer.fpInv.Coeffs, f.wNjInv)
unTwistInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv)
untwistInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv)

Check failure on line 134 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistInPlace

Check failure on line 134 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistInPlace

Check failure on line 134 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistInPlace

Check failure on line 134 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] += T(int64(real(f.buffer.fpInv.Coeffs[j])))
Expand All @@ -147,7 +147,7 @@ func (f *FourierEvaluator[T]) ToStandardPolyAddAssignUnsafe(fp FourierPoly, pOut
N := f.degree

invFFTInPlace(fp.Coeffs, f.wNjInv)
unTwistInPlace(fp.Coeffs, f.w2NjInv)
untwistInPlace(fp.Coeffs, f.w2NjInv)

Check failure on line 150 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistInPlace

Check failure on line 150 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistInPlace

Check failure on line 150 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistInPlace

Check failure on line 150 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] += T(int64(real(fp.Coeffs[j])))
Expand All @@ -161,7 +161,7 @@ func (f *FourierEvaluator[T]) ToStandardPolySubAssign(fp FourierPoly, pOut Poly[

f.buffer.fpInv.CopyFrom(fp)
invFFTInPlace(f.buffer.fpInv.Coeffs, f.wNjInv)
unTwistInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv)
untwistInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv)

Check failure on line 164 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistInPlace

Check failure on line 164 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistInPlace

Check failure on line 164 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistInPlace

Check failure on line 164 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] -= T(int64(real(f.buffer.fpInv.Coeffs[j])))
Expand All @@ -177,7 +177,7 @@ func (f *FourierEvaluator[T]) ToStandardPolySubAssignUnsafe(fp FourierPoly, pOut
N := f.degree

invFFTInPlace(fp.Coeffs, f.wNjInv)
unTwistInPlace(fp.Coeffs, f.w2NjInv)
untwistInPlace(fp.Coeffs, f.w2NjInv)

Check failure on line 180 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistInPlace

Check failure on line 180 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistInPlace

Check failure on line 180 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistInPlace

Check failure on line 180 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] -= T(int64(real(fp.Coeffs[j])))
Expand All @@ -200,7 +200,7 @@ func (f *FourierEvaluator[T]) ToScaledStandardPolyAssign(fp FourierPoly, pOut Po

f.buffer.fpInv.CopyFrom(fp)
invFFTInPlace(f.buffer.fpInv.Coeffs, f.wNjInv)
unTwistAndScaleInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv, f.maxT)
untwistAndScaleInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv, f.maxT)

Check failure on line 203 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistAndScaleInPlace

Check failure on line 203 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistAndScaleInPlace

Check failure on line 203 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistAndScaleInPlace

Check failure on line 203 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistAndScaleInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] = T(int64(real(f.buffer.fpInv.Coeffs[j])))
Expand All @@ -217,7 +217,7 @@ func (f *FourierEvaluator[T]) ToScaledStandardPolyAssignUnsafe(fp FourierPoly, p
N := f.degree

invFFTInPlace(fp.Coeffs, f.wNjInv)
unTwistAndScaleInPlace(fp.Coeffs, f.w2NjInv, f.maxT)
untwistAndScaleInPlace(fp.Coeffs, f.w2NjInv, f.maxT)

Check failure on line 220 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistAndScaleInPlace

Check failure on line 220 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistAndScaleInPlace

Check failure on line 220 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistAndScaleInPlace

Check failure on line 220 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistAndScaleInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] = T(int64(real(fp.Coeffs[j])))
Expand All @@ -232,7 +232,7 @@ func (f *FourierEvaluator[T]) ToScaledStandardPolyAddAssign(fp FourierPoly, pOut

f.buffer.fpInv.CopyFrom(fp)
invFFTInPlace(f.buffer.fpInv.Coeffs, f.wNjInv)
unTwistAndScaleInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv, f.maxT)
untwistAndScaleInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv, f.maxT)

Check failure on line 235 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistAndScaleInPlace

Check failure on line 235 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistAndScaleInPlace

Check failure on line 235 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistAndScaleInPlace

Check failure on line 235 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistAndScaleInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] += T(int64(real(f.buffer.fpInv.Coeffs[j])))
Expand All @@ -249,7 +249,7 @@ func (f *FourierEvaluator[T]) ToScaledStandardPolyAddAssignUnsafe(fp FourierPoly
N := f.degree

invFFTInPlace(fp.Coeffs, f.wNjInv)
unTwistAndScaleInPlace(fp.Coeffs, f.w2NjInv, f.maxT)
untwistAndScaleInPlace(fp.Coeffs, f.w2NjInv, f.maxT)

Check failure on line 252 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.18 Tests

undefined: untwistAndScaleInPlace

Check failure on line 252 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.19 Tests

undefined: untwistAndScaleInPlace

Check failure on line 252 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.20 Tests

undefined: untwistAndScaleInPlace

Check failure on line 252 in math/poly/fourier_transform.go

View workflow job for this annotation

GitHub Actions / Run Go 1.21 Tests

undefined: untwistAndScaleInPlace

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] += T(int64(real(fp.Coeffs[j])))
Expand All @@ -264,7 +264,7 @@ func (f *FourierEvaluator[T]) ToScaledStandardPolySubAssign(fp FourierPoly, pOut

f.buffer.fpInv.CopyFrom(fp)
invFFTInPlace(f.buffer.fpInv.Coeffs, f.wNjInv)
unTwistAndScaleInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv, f.maxT)
untwistAndScaleInPlace(f.buffer.fpInv.Coeffs, f.w2NjInv, f.maxT)

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] -= T(int64(real(f.buffer.fpInv.Coeffs[j])))
Expand All @@ -281,7 +281,7 @@ func (f *FourierEvaluator[T]) ToScaledStandardPolySubAssignUnsafe(fp FourierPoly
N := f.degree

invFFTInPlace(fp.Coeffs, f.wNjInv)
unTwistAndScaleInPlace(fp.Coeffs, f.w2NjInv, f.maxT)
untwistAndScaleInPlace(fp.Coeffs, f.w2NjInv, f.maxT)

for j := 0; j < N/2; j++ {
pOut.Coeffs[j] -= T(int64(real(fp.Coeffs[j])))
Expand Down

0 comments on commit 3841ca2

Please sign in to comment.