Skip to content

Commit

Permalink
Merge pull request #438 from tuneinsight/dev_427
Browse files Browse the repository at this point in the history
fixes #437
  • Loading branch information
Pro7ech authored Jan 26, 2024
2 parents f569cba + c02f669 commit 0feb4f2
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions he/hefloat/bootstrapping/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,32 @@ func NewEvaluator(btpParams Parameters, evk *EvaluationKeys) (eval *Evaluator, e
// Evaluator can be used concurrently.
func (eval Evaluator) ShallowCopy() *Evaluator {
heEvaluator := eval.Evaluator.ShallowCopy()
params := eval.BootstrappingParameters

paramsN1 := eval.ResidualParameters
paramsN2 := eval.BootstrappingParameters

var DomainSwitcher ckks.DomainSwitcher
if paramsN1.RingType() == ring.ConjugateInvariant {
var err error
if DomainSwitcher, err = ckks.NewDomainSwitcher(paramsN2.Parameters, eval.EvkCmplxToReal, eval.EvkRealToCmplx); err != nil {
panic(fmt.Errorf("cannot NewBootstrapper: ckks.NewDomainSwitcher: %w", err))
}
}

return &Evaluator{
Parameters: eval.Parameters,
EvaluationKeys: eval.EvaluationKeys,
Mod1Parameters: eval.Mod1Parameters,
S2CDFTMatrix: eval.S2CDFTMatrix,
C2SDFTMatrix: eval.C2SDFTMatrix,
Evaluator: heEvaluator,
DFTEvaluator: hefloat.NewDFTEvaluator(params, heEvaluator),
Mod1Evaluator: hefloat.NewMod1Evaluator(heEvaluator, hefloat.NewPolynomialEvaluator(params, heEvaluator), eval.Mod1Parameters),
xPow2N1: eval.xPow2N1,
xPow2N2: eval.xPow2N2,
xPow2InvN2: eval.xPow2InvN2,
DomainSwitcher: DomainSwitcher,
DFTEvaluator: hefloat.NewDFTEvaluator(paramsN2, heEvaluator),
Mod1Evaluator: hefloat.NewMod1Evaluator(heEvaluator, hefloat.NewPolynomialEvaluator(paramsN2, heEvaluator), eval.Mod1Parameters),
SkDebug: eval.SkDebug,
}
}

Expand Down

0 comments on commit 0feb4f2

Please sign in to comment.