Skip to content

Instantly share code, notes, and snippets.

Last active September 3, 2019 20:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Plaintext calculate_cosine_array(int n, int N, int start, int stop, CryptoContext<DCRTPoly> cc) {
vector<int64_t> *cosines = new vector<int64_t>();
for (int k = 0; k != N; k++) {
if (k < start || k >= stop) {
int cosVal = int(cos(((2 * pi * k * n) / N)) * 100); //FOR MORE ACCURATE RESULTS, INCREASE MULTIPLE OF 10
Plaintext cosineArray = cc->MakePackedPlaintext(*cosines);
return cosineArray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment