}
public static IDoubleArray readDoubleMatrix(String file)
throws FileNotFoundException, IOException
{
BlockFileReader reader = new BlockFileReader(file);
reader.scan();
// find out whether the matrix is saved in sparse or dense format.
boolean sparse = isSparseFormat(reader);
double[][] block = reader.getLargestDoubleBlock();
IDoubleArray res = null;
if (sparse)
{
int nrows = 0, ncols = 0;