@Override
    public void read(String path) {

        long startTime = System.currentTimeMillis();

        try {

            Scanner in = new Scanner(new FileReader(path));
            rows = in.nextInt();
            cols = in.nextInt();
            in.useLocale(Locale.US);
            for (int i = 0; i < rows; i++) {
                for (int j = 0; j < cols; j++) {
                    this.setValue(i, j, in.nextDouble());
                }
            }

        } catch (FileNotFoundException ex) {
            System.out.println("The specified file is not found!");
        } catch (MatrixIndexOutOfBoundsException ex) {
            System.out.println("Error: " + ex);
        }

        long endTime = System.currentTimeMillis();
        long time = endTime - startTime;

        System.out.println("Reading of the file lasted " + time + " ms.");

    }