Java Scanner Read loadNDimDoubleMatrixRec(Scanner reader, int[] dim, Object nmatrix)

Here you can find the source of loadNDimDoubleMatrixRec(Scanner reader, int[] dim, Object nmatrix)

Description

load N Dim Double Matrix Rec

License

Open Source License

Declaration

public static void loadNDimDoubleMatrixRec(Scanner reader, int[] dim, Object nmatrix) 

Method Source Code

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

import java.util.Arrays;

import java.util.Scanner;

public class Main {
    public static void loadNDimDoubleMatrixRec(Scanner reader, int[] dim, Object nmatrix) {
        if (dim.length == 1) {
            for (int i = 0; i < dim[0]; i++) {
                ((double[]) nmatrix)[i] = reader.nextDouble();
            }/*  www  . j  a v  a2  s .c om*/
        } else {
            int[] newDim = Arrays.copyOfRange(dim, 1, dim.length);
            for (int i = 0; i < dim[0]; i++) {
                loadNDimDoubleMatrixRec(reader, newDim, ((Object[]) nmatrix)[i]);
            }
        }
    }
}

Related

  1. loadConf()
  2. loadDoubleArray(Scanner reader)
  3. loadDoubleMatrix(Scanner reader)
  4. loadIntArray(Scanner reader)
  5. loadNDimDoubleMatrix(Scanner reader, int numberOfDim, Object nmatrix)
  6. loadSentencesMap(String path)
  7. loadSolution(File file)
  8. loadTestProgram(final Class resourceClass, final String fileName)
  9. loadTimeseries(File file, String delimeter, int _amountOfLines)