Java Scanner Read loadDoubleMatrix(Scanner reader)

Here you can find the source of loadDoubleMatrix(Scanner reader)

Description

load Double Matrix

License

Open Source License

Declaration

public static double[][] loadDoubleMatrix(Scanner reader) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Scanner;

public class Main {
    public static double[][] loadDoubleMatrix(Scanner reader) {
        int rows = reader.nextInt();
        int cols = reader.nextInt();
        double[][] ret = new double[rows][cols];
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < cols; j++) {
                ret[i][j] = Double.parseDouble(reader.next());
            }/*from  w ww . ja  v  a2  s  .c  o m*/
        }
        return ret;
    }
}

Related

  1. load(InputStream in, int elementCountOverride)
  2. loadAWSCredentails(String file_path)
  3. loadBooleanArray(BufferedReader in)
  4. loadConf()
  5. loadDoubleArray(Scanner reader)
  6. loadIntArray(Scanner reader)
  7. loadNDimDoubleMatrix(Scanner reader, int numberOfDim, Object nmatrix)
  8. loadNDimDoubleMatrixRec(Scanner reader, int[] dim, Object nmatrix)
  9. loadSentencesMap(String path)