Hi everyone,
im trying to use the EvalSum()
operation on a vector with 4000+ values. Since this operation is based on several vector rotations, I have created rotation keys for all indices accordingly. The problem, however, is that the operation EvalRotateKeyGen()
consumes so much memory that the program is killed with exit code 137.
What i want to achieve is going from this vector:
vector<double> v1 = {51.2271, 6.61748e-13, 3.24305e-13, -1.57976e-13, -5.11591e-13, 9.34338e-13, 5.28346e-13, -9.16319e-14, ...}; // 4000+ values
to this vector:
vector<double> v2 = {51.2271, 51.2271, 51.2271, 51.2271, 51.2271, 51.2271, 51.2271, ...};
I’m able to achieve that for vector with size 128. But with size 256 EvalRotateKeyGen()
for an index list with 256 indices it rans out of memory. My pseudo code looks like this so far:
vector<double> mask(values.size(), 0);
mask[0] = 1;
auto ct = cc->EvalMult(cc->MakeCKKSPackedPlaintext(mask, 1, 0, nullptr, slots), v1);
auto ct2 = cc->EvalSum(ct, slots); // v2
This works for a value vector size of 128. Everything above is killed with code 137.
Is there a more efficient method to get from v1
to v2
??
Thanks in advance! =)