在Java中管理一个大矩阵的正确方法 [英] The right way to manage a big matrix in Java

查看:235
本文介绍了在Java中管理一个大矩阵的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用一个大矩阵(不稀疏),它包含了大约10 ^ 10的双倍。
当然,我不能把它保存在内存中,我只需要1行。

我想把它分成文件,每个文件1行(它需要大量的文件),每次需要连续读取文件。你知道更有效的方法吗?解决方案

为什么你想把它存储在不同的文件?无法使用单个文件?



您可以使用 RandomAccessFile 类来执行该文件的读取。


I'm working with a big matrix (not sparse), it contains about 10^10 double. Of course I cannot keep it in memory, and I need just 1 row at time.

I thought to split it in files, every file 1 row (it requires a lot of files) and just read a file every time I need a row. do you know any more efficient way?

解决方案

Why do you want to store it in different files? Can't u use a single file?

You could use functions inside RandomAccessFile class to perform the reading from that File.

这篇关于在Java中管理一个大矩阵的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆