@Test public void getElementsTest() { double[][] affineTransformElements = GeneralMatrix.getElements(affineTransform2D); assertArrayEquals(affineTransformElements, affineMatrix); double[][] generalAffineMatrixElements = GeneralMatrix.getElements(generalAffineMatrix); assertArrayEquals(generalAffineMatrixElements, affineMatrix); }
public static double[][] getElements(final Matrix matrix) { if (matrix instanceof GeneralMatrix) { return ((GeneralMatrix) matrix).getElements(); } final int numCol = matrix.getNumCol(); final double[][] rows = new double[matrix.getNumRow()][]; for (int j = 0; j < rows.length; j++) { final double[] row; rows[j] = row = new double[numCol]; for (int i = 0; i < row.length; i++) { row[i] = matrix.getElement(j, i); } } return rows; }
GeneralMatrix implements XMatrix, Serializable { public static double[][] getElements(final Matrix matrix) { if (matrix instanceof GeneralMatrix) { return ((GeneralMatrix) matrix).getElements(); } final int numCol = matrix.getNumCol(); final double[][] rows = new double[matrix.getNumRow()][]; for (int j = 0; j < rows.length; j++) { final double[] row; rows[j] = row = new double[numCol]; for (int i = 0; i < row.length; i++) { row[i] = matrix.getElement(j, i); } } return rows; } }
GeneralMatrix implements XMatrix, Serializable { public static double[][] getElements(final Matrix matrix) { if (matrix instanceof GeneralMatrix) { return ((GeneralMatrix) matrix).getElements(); } final int numCol = matrix.getNumCol(); final double[][] rows = new double[matrix.getNumRow()][]; for (int j = 0; j < rows.length; j++) { final double[] row; rows[j] = row = new double[numCol]; for (int i = 0; i < row.length; i++) { row[i] = matrix.getElement(j, i); } } return rows; } GeneralMatrix(final int size);  GeneralMatrix(final int numRow, final int numCol);  GeneralMatrix(final int numRow, final int numCol, final double... matrix);  GeneralMatrix(final int numRow, final int numCol, final Matrix matrix);  GeneralMatrix(final double[][] matrix);  GeneralMatrix(final Matrix matrix);  GeneralMatrix(final GeneralMatrix matrix);  GeneralMatrix(final AffineTransform transform);  GeneralMatrix(final Envelope srcRegion, final Envelope dstRegion);  GeneralMatrix(final AxisDirection[] srcAxis, final AxisDirection[] dstAxis);  GeneralMatrix(
            final Envelope srcRegion,
            final AxisDirection[] srcAxis,
            final Envelope dstRegion,
            final AxisDirection[] dstAxis); private  GeneralMatrix(
            final Envelope srcRegion,
            final AxisDirection[] srcAxis,
            final Envelope dstRegion,
            final AxisDirection[] dstAxis,
            final boolean validRegions); }
GeneralMatrix implements XMatrix, Serializable { public static double[][] getElements(final Matrix matrix) { if (matrix instanceof GeneralMatrix) { return ((GeneralMatrix) matrix).getElements(); } final int numCol = matrix.getNumCol(); final double[][] rows = new double[matrix.getNumRow()][]; for (int j = 0; j < rows.length; j++) { final double[] row; rows[j] = row = new double[numCol]; for (int i = 0; i < row.length; i++) { row[i] = matrix.getElement(j, i); } } return rows; } GeneralMatrix(final int size);  GeneralMatrix(final int numRow, final int numCol);  GeneralMatrix(final int numRow, final int numCol, final double... matrix);  GeneralMatrix(final int numRow, final int numCol, final Matrix matrix);  GeneralMatrix(final double[][] matrix);  GeneralMatrix(final Matrix matrix);  GeneralMatrix(final GeneralMatrix matrix);  GeneralMatrix(final AffineTransform transform);  GeneralMatrix(final Envelope srcRegion, final Envelope dstRegion);  GeneralMatrix(final AxisDirection[] srcAxis, final AxisDirection[] dstAxis);  GeneralMatrix(
            final Envelope srcRegion,
            final AxisDirection[] srcAxis,
            final Envelope dstRegion,
            final AxisDirection[] dstAxis); private  GeneralMatrix(
            final Envelope srcRegion,
            final AxisDirection[] srcAxis,
            final Envelope dstRegion,
            final AxisDirection[] dstAxis,
            final boolean validRegions); static double[][] getElements(final Matrix matrix); final double[][] getElements(); final boolean isAffine(); @Override void negate(); @Override void negate(Matrix matrix); @Override void transpose(); @Override void transpose(Matrix matrix); @Override void invert(); @Override void invert(Matrix matrix); @Override int getNumRow(); @Override int getNumCol(); @Override double getElement(int row, int column); void setColumn(int column, double... values); void setRow(int row, double... values); @Override void setElement(int row, int column, double value); @Override void setZero(); @Override void setIdentity(); final boolean isIdentity(); final boolean isIdentity(double tolerance); final void multiply(final Matrix matrix); @Override int hashCode(); @Override boolean equals(Object obj); boolean equals(final Matrix matrix, final double tolerance); final AffineTransform toAffineTransform2D(); static GeneralMatrix load(final File file); static GeneralMatrix load(final BufferedReader in, final Locale locale); @Override String toString(); @Override GeneralMatrix clone(); void copySubMatrix(
            int rowSource,
            int colSource,
            int numRows,
            int numCol,
            int rowDest,
            int colDest,
            GeneralMatrix target); void getColumn(int col, double[] array); @Override void mul(double scalar); @Override void mul(double scalar, Matrix matrix); void getRow(int row, double[] array); final void mul(Matrix matrix); void mul(Matrix matrix1, Matrix matrix2); @Override void sub(double scalar); @Override void sub(double scalar, Matrix matrix); void sub(Matrix matrix); void sub(Matrix matrix1, Matrix matrix2); void set(double[] matrix); void setSize(int numRows, int numCols); @Override void add(double scalar); @Override void add(double scalar, XMatrix matrix); @Override void add(XMatrix matrix); @Override void add(XMatrix matrix1, XMatrix matrix2); @Override double determinate(); }
GeneralMatrix implements XMatrix, Serializable { public static double[][] getElements(final Matrix matrix) { if (matrix instanceof GeneralMatrix) { return ((GeneralMatrix) matrix).getElements(); } final int numCol = matrix.getNumCol(); final double[][] rows = new double[matrix.getNumRow()][]; for (int j = 0; j < rows.length; j++) { final double[] row; rows[j] = row = new double[numCol]; for (int i = 0; i < row.length; i++) { row[i] = matrix.getElement(j, i); } } return rows; } GeneralMatrix(final int size);  GeneralMatrix(final int numRow, final int numCol);  GeneralMatrix(final int numRow, final int numCol, final double... matrix);  GeneralMatrix(final int numRow, final int numCol, final Matrix matrix);  GeneralMatrix(final double[][] matrix);  GeneralMatrix(final Matrix matrix);  GeneralMatrix(final GeneralMatrix matrix);  GeneralMatrix(final AffineTransform transform);  GeneralMatrix(final Envelope srcRegion, final Envelope dstRegion);  GeneralMatrix(final AxisDirection[] srcAxis, final AxisDirection[] dstAxis);  GeneralMatrix(
            final Envelope srcRegion,
            final AxisDirection[] srcAxis,
            final Envelope dstRegion,
            final AxisDirection[] dstAxis); private  GeneralMatrix(
            final Envelope srcRegion,
            final AxisDirection[] srcAxis,
            final Envelope dstRegion,
            final AxisDirection[] dstAxis,
            final boolean validRegions); static double[][] getElements(final Matrix matrix); final double[][] getElements(); final boolean isAffine(); @Override void negate(); @Override void negate(Matrix matrix); @Override void transpose(); @Override void transpose(Matrix matrix); @Override void invert(); @Override void invert(Matrix matrix); @Override int getNumRow(); @Override int getNumCol(); @Override double getElement(int row, int column); void setColumn(int column, double... values); void setRow(int row, double... values); @Override void setElement(int row, int column, double value); @Override void setZero(); @Override void setIdentity(); final boolean isIdentity(); final boolean isIdentity(double tolerance); final void multiply(final Matrix matrix); @Override int hashCode(); @Override boolean equals(Object obj); boolean equals(final Matrix matrix, final double tolerance); final AffineTransform toAffineTransform2D(); static GeneralMatrix load(final File file); static GeneralMatrix load(final BufferedReader in, final Locale locale); @Override String toString(); @Override GeneralMatrix clone(); void copySubMatrix(
            int rowSource,
            int colSource,
            int numRows,
            int numCol,
            int rowDest,
            int colDest,
            GeneralMatrix target); void getColumn(int col, double[] array); @Override void mul(double scalar); @Override void mul(double scalar, Matrix matrix); void getRow(int row, double[] array); final void mul(Matrix matrix); void mul(Matrix matrix1, Matrix matrix2); @Override void sub(double scalar); @Override void sub(double scalar, Matrix matrix); void sub(Matrix matrix); void sub(Matrix matrix1, Matrix matrix2); void set(double[] matrix); void setSize(int numRows, int numCols); @Override void add(double scalar); @Override void add(double scalar, XMatrix matrix); @Override void add(XMatrix matrix); @Override void add(XMatrix matrix1, XMatrix matrix2); @Override double determinate();  }