Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在用 C++ 编程。有一组很长的数字(超过 80 亿个元素)。所有数字都是实数(双精度型)。例如,我必须计算所有这些元素的平均值。如此多的数字不适合任何数组或向量。如何解决问题?可以解决吗?
我猜你的号码在文件中或通过流访问。例如,通过一次读取 1024 个元素来一点一点地或逐块地进行计算。我认为您不需要将它们全部放入堆中。