Example #1
0
        /// <summary>
        /// Loads a new matrix from a CSV file.
        /// For the file format <see cref="MatrixIO"/>.
        /// </summary>
        /// <exception cref="IOException"/>
        public TSimple loadCSV(string fileName)
        {
            TSimple ret = createMatrix(1, 1);
            var     m   = (TMatrix)MatrixIO.loadCSV(fileName);

            ret.setMatrix(m);
            return(ret);
        }
Example #2
0
        public static void csv()
        {
            DMatrixRMaj A = new DMatrixRMaj(2, 3, true, new double[] { 1, 2, 3, 4, 5, 6 });

            try
            {
                MatrixIO.saveCSV(A, "matrix_file.csv");
                DMatrixRMaj B = (DMatrixRMaj)MatrixIO.loadCSV("matrix_file.csv");
                B.print();
            }
            catch (IOException e)
            {
                throw new InvalidOperationException(e.Message, e);
            }
        }