Last active
September 3, 2019 20:05
-
-
Save pathaine/1dd9e60e06b9c9311ac24de2bd18ae42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plaintext calculate_sine_array(int m, int N, int start, int stop, CryptoContext<DCRTPoly> cc) { | |
vector<int64_t> *sines = new vector<int64_t>(); | |
for (int k = 0; k != N; k++) { | |
if (k < start || k >= stop) { | |
sines->push_back(0); | |
continue; | |
} | |
int sinVal = int(sin(((2 * pi * k * m) / N)) * 100); //FOR MORE ACCURATE RESULTS, INCREASE MULTIPLE OF 10 | |
sines->push_back(sinVal); | |
} | |
Plaintext sineArray = cc->MakePackedPlaintext(*sine); | |
return sineArray; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment