Files
lattigo/examples/example_test.go
Jean-Philippe Bossuat 848871111a updated examples
2023-11-14 16:26:39 +01:00

47 lines
1.2 KiB
Go

package examples
import (
"testing"
"github.com/tuneinsight/lattigo/v4/he/hefloat"
"github.com/tuneinsight/lattigo/v4/he/heint"
)
func TestExampleParams(t *testing.T) {
for _, pl := range HEIntParams {
p, err := heint.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("HEIntParams: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
for _, pl := range HEIntScaleInvariantParams {
p, err := heint.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("HEIntScaleInvariantParams: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
for _, pl := range HEFloatComplexParams {
p, err := hefloat.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("HEFloatComplex: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
for _, pl := range HEFloatRealParams {
p, err := hefloat.NewParametersFromLiteral(pl)
if err != nil {
t.Fatal(err)
}
p.RingQ()
t.Logf("HEFloatReal: LogN: %d - LogQP: %12.7f - LogSlots: %d", p.LogN(), p.LogQP(), p.LogMaxSlots())
}
}