Skip to content

Commit

Permalink
fixed the input ranges for function-evaluation.cpp (openfheorg#335)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
  • Loading branch information
yspolyakov and Yuriy Polyakov authored Mar 20, 2023
1 parent e524543 commit 83b3fd7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pke/examples/function-evaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void EvalLogisticExample() {
usint scalingModSize = 78;
usint firstModSize = 89;
#else
usint scalingModSize = 59;
usint scalingModSize = 50;
usint firstModSize = 60;
#endif
parameters.SetScalingModSize(scalingModSize);
Expand Down Expand Up @@ -93,8 +93,8 @@ void EvalLogisticExample() {
Plaintext plaintext = cc->MakeCKKSPackedPlaintext(input);
auto ciphertext = cc->Encrypt(keyPair.publicKey, plaintext);

double lowerBound = -4;
double upperBound = 4;
double lowerBound = -5;
double upperBound = 5;
auto result = cc->EvalLogistic(ciphertext, lowerBound, upperBound, polyDegree);

Plaintext plaintextDec;
Expand Down Expand Up @@ -124,7 +124,7 @@ void EvalFunctionExample() {
usint scalingModSize = 78;
usint firstModSize = 89;
#else
usint scalingModSize = 59;
usint scalingModSize = 50;
usint firstModSize = 60;
#endif
parameters.SetScalingModSize(scalingModSize);
Expand Down Expand Up @@ -154,8 +154,8 @@ void EvalFunctionExample() {
Plaintext plaintext = cc->MakeCKKSPackedPlaintext(input);
auto ciphertext = cc->Encrypt(keyPair.publicKey, plaintext);

double lowerBound = 1;
double upperBound = 9;
double lowerBound = 0;
double upperBound = 10;

// We can input any lambda function, which inputs a double and returns a double.
auto result = cc->EvalChebyshevFunction([](double x) -> double { return std::sqrt(x); }, ciphertext, lowerBound,
Expand Down

0 comments on commit 83b3fd7

Please # to comment.