/** * Tests {@link MatrixSIS#convertAfter(int, Number, Number)} * using {@link java.awt.geom.AffineTransform} as a reference implementation. * * @since 0.6 */ @Test public void testConvertAfter() { testConvertAfter(new GeneralMatrix(3, 3, true, 1)); // Double precision testConvertAfter(new GeneralMatrix(3, 3, true, 2)); // Double-double precision }
/** * Tests {@link MatrixSIS#convertBefore(int, Number, Number)} * using {@link java.awt.geom.AffineTransform} as a reference implementation. * * @since 0.6 */ @Test public void testConvertBefore() { testConvertBefore(new GeneralMatrix(3, 3, true, 1), true); // Double precision testConvertBefore(new GeneralMatrix(3, 3, true, 2), true); // Double-double precision }
/** * Tests {@link MatrixSIS#multiply(double[])} * using {@link java.awt.geom.AffineTransform} as a reference implementation. * * @since 0.8 */ @Test public void testMultiplyVector() { testMultiplyVector(new GeneralMatrix(3, 3, true, 1)); // Double precision testMultiplyVector(new GeneralMatrix(3, 3, true, 2)); // Double-double precision }
/** * Tests {@link GeneralMatrix#getExtendedElements(Matrix, int, int, boolean)}. * This test is a copy of {@link GeneralMatrixTest#testGetExtendedElements()}, * but on a {@link Matrix2} instance instead of {@link GeneralMatrix}. */ @Test public void testGetExtendedElements() { GeneralMatrixTest.testGetExtendedElements(new Matrix2( StrictMath.PI / 180, // Degrees to radians 180 / StrictMath.PI, // Radians to degrees 0.9, // Grads to degrees 0.1234567)); // Random value with no special meaning. } }
/** * Tests {@link MatrixSIS#translate(double[])} * using {@link java.awt.geom.AffineTransform} as a reference implementation. * * @since 1.0 */ @Test public void testTranslateVector() { testTranslateVector(new GeneralMatrix(3, 3, true, 1)); // Double precision // testTranslateVector(new GeneralMatrix(3, 3, true, 2)); // Double-double precision // TODO: revisit commented-out test after using Math.fma with JDK9. } }
/** * Tests {@link GeneralMatrix#getExtendedElements(Matrix, int, int, boolean)}. * This test verifies that {@code getExtendedElements} can infer default error * terms for some well known values. * * @see Matrix2Test#testGetExtendedElements() */ @Test public void testGetExtendedElements() { testGetExtendedElements(new GeneralMatrix(2, 2, new double[] { StrictMath.PI / 180, // Degrees to radians 180 / StrictMath.PI, // Radians to degrees 0.9, // Grads to degrees 0.1234567})); // Random value with no special meaning. }