Use malloc

Use posix_memalign instead of std::vector<std::vector<float>> to store P and Q