The traditional way to import matrix data from file is to 1. define a matrix and then 2. scanf the file by specifying the number of rows and cols, e.g.
Code: Select all
mat = new Matrix(nrow, ncol)
mat.scanf(fileobj, nrow, nrow)
Code: Select all
mat = new Matrix(nrow, ncol)
mat.scanf(fileobj, nrow, nrow)