In my code, I've used many NTL vector and matrix as class members. Most of the variables can initialize as a zero-length vector or matrix. But the last one (randE), it somehow defaults to a vector with size=4444736032 and fixed.
class MyClass
{
public:
shared_ptr<OtherClass> ptr;
Mat<ZZ_p> A;
Mat<ZZ_p> B;
Mat<ZZ_p> C;
Vec<ZZ_p> D;
Vec<ZZ_p> randA;
Vec<ZZ_p> randB;
Vec<ZZ_p> randC;
ZZ_p randD;
Mat<ZZ_p> E;
Vec<ZZ_p> randE;
MyClass(
const shared_ptr<OtherClass> &ptr;
const Mat<ZZ_p> &A,
const Mat<ZZ_p> &B,
const Mat<ZZ_p> &C)
{
this->ptr = ptr;
this->A = A;
this->B = B;
this->C = C;
}
}
I've tried to add initialization inside the constructor, it'll throw an error, due to the vector is fixed, it cannot change its length.
// Error: SetLength: can't change this vector's length
this->randE = Vec<ZZ_p>();