/** * Creates a new matrix initialized to the same value than the specified one. * The specified matrix size must be {@value #SIZE}×{@value #SIZE}. * This is not verified by this constructor, since it shall be verified by {@link Matrices}. * * @param matrix the matrix to copy. * @throws IllegalArgumentException if the given matrix is not of the expected size. */ Matrix4(final Matrix matrix) throws IllegalArgumentException { for (int j=0; j<SIZE; j++) { for (int i=0; i<SIZE; i++) { setElement(j,i, matrix.getElement(j,i)); } } }
/** * Creates a new matrix initialized to the same value than the specified one. * The specified matrix size must be {@value #SIZE}×{@value #SIZE}. * This is not verified by this constructor, since it shall be verified by {@link Matrices}. * * @param matrix the matrix to copy. * @throws IllegalArgumentException if the given matrix is not of the expected size. */ Matrix4(final Matrix matrix) throws IllegalArgumentException { for (int j=0; j<SIZE; j++) { for (int i=0; i<SIZE; i++) { setElement(j,i, matrix.getElement(j,i)); } } }