Optimize memory usage: change type of container of theta and chi samples (std::vector to array).