mirror of
https://github.com/tuneinsight/lattigo.git
synced 2025-09-13 03:27:14 +00:00
47 lines
1.2 KiB
Go
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())
|
|
}
|
|
}
|