commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [09/16] commons-numbers git commit: Multimodule project setup.
Date Wed, 18 Jan 2017 13:54:48 GMT
http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c4541327/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java
----------------------------------------------------------------------
diff --git a/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java b/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java
new file mode 100644
index 0000000..b96a0b4
--- /dev/null
+++ b/commons-numbers-quaternion/src/test/java/org/apache/commons/numbers/quaternion/QuaternionTest.java
@@ -0,0 +1,456 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.numbers.quaternion;
+
+import java.util.Random;
+
+import org.apache.commons.numbers.quaternion.Quaternion;
+import org.junit.Test;
+import org.junit.Assert;
+
+public class QuaternionTest {
+    /** Epsilon for double comparison. */
+    private static final double EPS = Math.ulp(1d);
+    /** Epsilon for double comparison. */
+    private static final double COMPARISON_EPS = 1e-14;
+
+    @Test
+    public final void testAccessors1() {
+        final double q0 = 2;
+        final double q1 = 5.4;
+        final double q2 = 17;
+        final double q3 = 0.0005;
+        final Quaternion q = new Quaternion(q0, q1, q2, q3);
+
+        Assert.assertEquals(q0, q.getQ0(), 0);
+        Assert.assertEquals(q1, q.getQ1(), 0);
+        Assert.assertEquals(q2, q.getQ2(), 0);
+        Assert.assertEquals(q3, q.getQ3(), 0);
+    }
+
+    @Test
+    public final void testAccessors2() {
+        final double q0 = 2;
+        final double q1 = 5.4;
+        final double q2 = 17;
+        final double q3 = 0.0005;
+        final Quaternion q = new Quaternion(q0, q1, q2, q3);
+
+        final double sP = q.getScalarPart();
+        final double[] vP = q.getVectorPart();
+
+        Assert.assertEquals(q0, sP, 0);
+        Assert.assertEquals(q1, vP[0], 0);
+        Assert.assertEquals(q2, vP[1], 0);
+        Assert.assertEquals(q3, vP[2], 0);
+    }
+
+    @Test
+    public final void testAccessors3() {
+        final double q0 = 2;
+        final double q1 = 5.4;
+        final double q2 = 17;
+        final double q3 = 0.0005;
+        final Quaternion q = new Quaternion(q0, new double[] { q1, q2, q3 });
+
+        final double sP = q.getScalarPart();
+        final double[] vP = q.getVectorPart();
+
+        Assert.assertEquals(q0, sP, 0);
+        Assert.assertEquals(q1, vP[0], 0);
+        Assert.assertEquals(q2, vP[1], 0);
+        Assert.assertEquals(q3, vP[2], 0);
+    }
+
+    @Test(expected=IllegalArgumentException.class)
+    public void testWrongDimension() {
+        new Quaternion(new double[] { 1, 2 });
+    }
+
+    @Test
+    public final void testConjugate() {
+        final double q0 = 2;
+        final double q1 = 5.4;
+        final double q2 = 17;
+        final double q3 = 0.0005;
+        final Quaternion q = new Quaternion(q0, q1, q2, q3);
+
+        final Quaternion qConjugate = q.getConjugate();
+
+        Assert.assertEquals(q0, qConjugate.getQ0(), 0);
+        Assert.assertEquals(-q1, qConjugate.getQ1(), 0);
+        Assert.assertEquals(-q2, qConjugate.getQ2(), 0);
+        Assert.assertEquals(-q3, qConjugate.getQ3(), 0);
+    }
+
+    /* TODO remove dependency on Vector3D
+    @Test
+    public final void testProductQuaternionQuaternion() {
+
+        // Case : analytic test case
+
+        final Quaternion qA = new Quaternion(1, 0.5, -3, 4);
+        final Quaternion qB = new Quaternion(6, 2, 1, -9);
+        final Quaternion qResult = Quaternion.multiply(qA, qB);
+
+        Assert.assertEquals(44, qResult.getQ0(), EPS);
+        Assert.assertEquals(28, qResult.getQ1(), EPS);
+        Assert.assertEquals(-4.5, qResult.getQ2(), EPS);
+        Assert.assertEquals(21.5, qResult.getQ3(), EPS);
+
+        // comparison with the result given by the formula :
+        // qResult = (scalarA * scalarB - vectorA . vectorB) + (scalarA * vectorB + scalarB * vectorA + vectorA ^
+        // vectorB)
+
+        final Vector3D vectorA = new Vector3D(qA.getVectorPart());
+        final Vector3D vectorB = new Vector3D(qB.getVectorPart());
+        final Vector3D vectorResult = new Vector3D(qResult.getVectorPart());
+
+        final double scalarPartRef = qA.getScalarPart() * qB.getScalarPart() - Vector3D.dotProduct(vectorA, vectorB);
+
+        Assert.assertEquals(scalarPartRef, qResult.getScalarPart(), EPS);
+
+        final Vector3D vectorPartRef = ((vectorA.scalarMultiply(qB.getScalarPart())).add(vectorB.scalarMultiply(qA
+                .getScalarPart()))).add(Vector3D.crossProduct(vectorA, vectorB));
+        final double norm = (vectorResult.subtract(vectorPartRef)).getNorm();
+
+        Assert.assertEquals(0, norm, EPS);
+
+        // Conjugate of the product of two quaternions and product of their conjugates :
+        // Conj(qA * qB) = Conj(qB) * Conj(qA)
+
+        final Quaternion conjugateOfProduct = qB.getConjugate().multiply(qA.getConjugate());
+        final Quaternion productOfConjugate = (qA.multiply(qB)).getConjugate();
+
+        Assert.assertEquals(conjugateOfProduct.getQ0(), productOfConjugate.getQ0(), EPS);
+        Assert.assertEquals(conjugateOfProduct.getQ1(), productOfConjugate.getQ1(), EPS);
+        Assert.assertEquals(conjugateOfProduct.getQ2(), productOfConjugate.getQ2(), EPS);
+        Assert.assertEquals(conjugateOfProduct.getQ3(), productOfConjugate.getQ3(), EPS);
+    }
+    */
+    /* TODO remove dependency on Vector3D
+    @Test
+    public final void testProductQuaternionVector() {
+
+        // Case : Product between a vector and a quaternion : QxV
+
+        final Quaternion quaternion = new Quaternion(4, 7, -1, 2);
+        final double[] vector = {2.0, 1.0, 3.0};
+        final Quaternion qResultQxV = Quaternion.multiply(quaternion, new Quaternion(vector));
+
+        Assert.assertEquals(-19, qResultQxV.getQ0(), EPS);
+        Assert.assertEquals(3, qResultQxV.getQ1(), EPS);
+        Assert.assertEquals(-13, qResultQxV.getQ2(), EPS);
+        Assert.assertEquals(21, qResultQxV.getQ3(), EPS);
+
+        // comparison with the result given by the formula :
+        // qResult = (- vectorQ . vector) + (scalarQ * vector + vectorQ ^ vector)
+
+        final double[] vectorQ = quaternion.getVectorPart();
+        final double[] vectorResultQxV = qResultQxV.getVectorPart();
+
+        final double scalarPartRefQxV = -Vector3D.dotProduct(new Vector3D(vectorQ), new Vector3D(vector));
+        Assert.assertEquals(scalarPartRefQxV, qResultQxV.getScalarPart(), EPS);
+
+        final Vector3D vectorPartRefQxV = (new Vector3D(vector).scalarMultiply(quaternion.getScalarPart())).add(Vector3D
+                .crossProduct(new Vector3D(vectorQ), new Vector3D(vector)));
+        final double normQxV = (new Vector3D(vectorResultQxV).subtract(vectorPartRefQxV)).getNorm();
+        Assert.assertEquals(0, normQxV, EPS);
+
+        // Case : Product between a vector and a quaternion : VxQ
+
+        final Quaternion qResultVxQ = Quaternion.multiply(new Quaternion(vector), quaternion);
+
+        Assert.assertEquals(-19, qResultVxQ.getQ0(), EPS);
+        Assert.assertEquals(13, qResultVxQ.getQ1(), EPS);
+        Assert.assertEquals(21, qResultVxQ.getQ2(), EPS);
+        Assert.assertEquals(3, qResultVxQ.getQ3(), EPS);
+
+        final double[] vectorResultVxQ = qResultVxQ.getVectorPart();
+
+        // comparison with the result given by the formula :
+        // qResult = (- vector . vectorQ) + (scalarQ * vector + vector ^ vectorQ)
+
+        final double scalarPartRefVxQ = -Vector3D.dotProduct(new Vector3D(vectorQ), new Vector3D(vector));
+        Assert.assertEquals(scalarPartRefVxQ, qResultVxQ.getScalarPart(), EPS);
+
+        final Vector3D vectorPartRefVxQ = (new Vector3D(vector).scalarMultiply(quaternion.getScalarPart())).add(Vector3D
+                .crossProduct(new Vector3D(vector), new Vector3D(vectorQ)));
+        final double normVxQ = (new Vector3D(vectorResultVxQ).subtract(vectorPartRefVxQ)).getNorm();
+        Assert.assertEquals(0, normVxQ, EPS);
+    }
+    */
+    @Test
+    public final void testDotProductQuaternionQuaternion() {
+        // expected output
+        final double expected = -6.;
+        // inputs
+        final Quaternion q1 = new Quaternion(1, 2, 2, 1);
+        final Quaternion q2 = new Quaternion(3, -2, -1, -3);
+
+        final double actual1 = Quaternion.dotProduct(q1, q2);
+        final double actual2 = q1.dotProduct(q2);
+
+        Assert.assertEquals(expected, actual1, EPS);
+        Assert.assertEquals(expected, actual2, EPS);
+    }
+
+    @Test
+    public final void testScalarMultiplyDouble() {
+        // expected outputs
+        final double w = 1.6;
+        final double x = -4.8;
+        final double y = 11.20;
+        final double z = 2.56;
+        // inputs
+        final Quaternion q1 = new Quaternion(0.5, -1.5, 3.5, 0.8);
+        final double a = 3.2;
+
+        final Quaternion q = q1.multiply(a);
+
+        Assert.assertEquals(w, q.getQ0(), COMPARISON_EPS);
+        Assert.assertEquals(x, q.getQ1(), COMPARISON_EPS);
+        Assert.assertEquals(y, q.getQ2(), COMPARISON_EPS);
+        Assert.assertEquals(z, q.getQ3(), COMPARISON_EPS);
+    }
+
+    @Test
+    public final void testAddQuaternionQuaternion() {
+        // expected outputs
+        final double w = 4;
+        final double x = -1;
+        final double y = 2;
+        final double z = -4;
+        // inputs
+        final Quaternion q1 = new Quaternion(1., 2., -2., -1.);
+        final Quaternion q2 = new Quaternion(3., -3., 4., -3.);
+
+        final Quaternion qa = Quaternion.add(q1, q2);
+        final Quaternion qb = q1.add(q2);
+
+        Assert.assertEquals(w, qa.getQ0(), EPS);
+        Assert.assertEquals(x, qa.getQ1(), EPS);
+        Assert.assertEquals(y, qa.getQ2(), EPS);
+        Assert.assertEquals(z, qa.getQ3(), EPS);
+
+        Assert.assertEquals(w, qb.getQ0(), EPS);
+        Assert.assertEquals(x, qb.getQ1(), EPS);
+        Assert.assertEquals(y, qb.getQ2(), EPS);
+        Assert.assertEquals(z, qb.getQ3(), EPS);
+    }
+
+    @Test
+    public final void testSubtractQuaternionQuaternion() {
+        // expected outputs
+        final double w = -2.;
+        final double x = 5.;
+        final double y = -6.;
+        final double z = 2.;
+        // inputs
+        final Quaternion q1 = new Quaternion(1., 2., -2., -1.);
+        final Quaternion q2 = new Quaternion(3., -3., 4., -3.);
+
+        final Quaternion qa = Quaternion.subtract(q1, q2);
+        final Quaternion qb = q1.subtract(q2);
+
+        Assert.assertEquals(w, qa.getQ0(), EPS);
+        Assert.assertEquals(x, qa.getQ1(), EPS);
+        Assert.assertEquals(y, qa.getQ2(), EPS);
+        Assert.assertEquals(z, qa.getQ3(), EPS);
+
+        Assert.assertEquals(w, qb.getQ0(), EPS);
+        Assert.assertEquals(x, qb.getQ1(), EPS);
+        Assert.assertEquals(y, qb.getQ2(), EPS);
+        Assert.assertEquals(z, qb.getQ3(), EPS);
+}
+
+    @Test
+    public final void testNorm() {
+
+        final double q0 = 2;
+        final double q1 = 1;
+        final double q2 = -4;
+        final double q3 = 3;
+        final Quaternion q = new Quaternion(q0, q1, q2, q3);
+
+        final double norm = q.getNorm();
+
+        Assert.assertEquals(Math.sqrt(30), norm, 0);
+
+        final double normSquareRef = Quaternion.multiply(q, q.getConjugate()).getScalarPart();
+        Assert.assertEquals(Math.sqrt(normSquareRef), norm, 0);
+    }
+
+    @Test
+    public final void testNormalize() {
+
+        final Quaternion q = new Quaternion(2, 1, -4, -2);
+
+        final Quaternion versor = q.normalize();
+
+        Assert.assertEquals(2.0 / 5.0, versor.getQ0(), 0);
+        Assert.assertEquals(1.0 / 5.0, versor.getQ1(), 0);
+        Assert.assertEquals(-4.0 / 5.0, versor.getQ2(), 0);
+        Assert.assertEquals(-2.0 / 5.0, versor.getQ3(), 0);
+
+        Assert.assertEquals(1, versor.getNorm(), 0);
+    }
+
+    @Test(expected=IllegalStateException.class)
+    public final void testNormalizeFail() {
+        final Quaternion zeroQ = new Quaternion(0, 0, 0, 0);
+        zeroQ.normalize();
+    }
+
+    @Test
+    public final void testObjectEquals() {
+        final double one = 1;
+        final Quaternion q1 = new Quaternion(one, one, one, one);
+        Assert.assertTrue(q1.equals(q1));
+
+        final Quaternion q2 = new Quaternion(one, one, one, one);
+        Assert.assertTrue(q2.equals(q1));
+
+        final Quaternion q3 = new Quaternion(one, Math.nextUp(one), one, one);
+        Assert.assertFalse(q3.equals(q1));
+    }
+
+    @Test
+    public final void testQuaternionEquals() {
+        final double inc = 1e-5;
+        final Quaternion q1 = new Quaternion(2, 1, -4, -2);
+        final Quaternion q2 = new Quaternion(q1.getQ0() + inc, q1.getQ1(), q1.getQ2(), q1.getQ3());
+        final Quaternion q3 = new Quaternion(q1.getQ0(), q1.getQ1() + inc, q1.getQ2(), q1.getQ3());
+        final Quaternion q4 = new Quaternion(q1.getQ0(), q1.getQ1(), q1.getQ2() + inc, q1.getQ3());
+        final Quaternion q5 = new Quaternion(q1.getQ0(), q1.getQ1(), q1.getQ2(), q1.getQ3() + inc);
+
+        Assert.assertFalse(q1.equals(q2, 0.9 * inc));
+        Assert.assertFalse(q1.equals(q3, 0.9 * inc));
+        Assert.assertFalse(q1.equals(q4, 0.9 * inc));
+        Assert.assertFalse(q1.equals(q5, 0.9 * inc));
+
+        Assert.assertTrue(q1.equals(q2, 1.1 * inc));
+        Assert.assertTrue(q1.equals(q3, 1.1 * inc));
+        Assert.assertTrue(q1.equals(q4, 1.1 * inc));
+        Assert.assertTrue(q1.equals(q5, 1.1 * inc));
+    }
+
+    @Test
+    public final void testQuaternionEquals2() {
+        final Quaternion q1 = new Quaternion(1, 4, 2, 3);
+        final double gap = 1e-5;
+        final Quaternion q2 = new Quaternion(1 + gap, 4 + gap, 2 + gap, 3 + gap);
+
+        Assert.assertTrue(q1.equals(q2, 10 * gap));
+        Assert.assertFalse(q1.equals(q2, gap));
+        Assert.assertFalse(q1.equals(q2, gap / 10));
+    }
+
+    @Test
+    public final void testIsUnitQuaternion() {
+        final Random r = new Random(48);
+        final int numberOfTrials = 1000;
+        for (int i = 0; i < numberOfTrials; i++) {
+            final Quaternion q1 = new Quaternion(r.nextDouble(), r.nextDouble(), r.nextDouble(), r.nextDouble());
+            final Quaternion q2 = q1.normalize();
+            Assert.assertTrue(q2.isUnitQuaternion(COMPARISON_EPS));
+        }
+
+        final Quaternion q = new Quaternion(1, 1, 1, 1);
+        Assert.assertFalse(q.isUnitQuaternion(COMPARISON_EPS));
+    }
+
+    @Test
+    public final void testIsPureQuaternion() {
+        final Quaternion q1 = new Quaternion(0, 5, 4, 8);
+        Assert.assertTrue(q1.isPureQuaternion(EPS));
+
+        final Quaternion q2 = new Quaternion(0 - EPS, 5, 4, 8);
+        Assert.assertTrue(q2.isPureQuaternion(EPS));
+
+        final Quaternion q3 = new Quaternion(0 - 1.1 * EPS, 5, 4, 8);
+        Assert.assertFalse(q3.isPureQuaternion(EPS));
+
+        final Random r = new Random(48);
+        final double[] v = {r.nextDouble(), r.nextDouble(), r.nextDouble()};
+        final Quaternion q4 = new Quaternion(v);
+        Assert.assertTrue(q4.isPureQuaternion(0));
+
+        final Quaternion q5 = new Quaternion(0, v);
+        Assert.assertTrue(q5.isPureQuaternion(0));
+    }
+
+    /*
+    @Test
+    public final void testPolarForm() {
+        final Random r = new Random(48);
+        final int numberOfTrials = 1000;
+        for (int i = 0; i < numberOfTrials; i++) {
+            final Quaternion q = new Quaternion(2 * (r.nextDouble() - 0.5), 2 * (r.nextDouble() - 0.5),
+                                                2 * (r.nextDouble() - 0.5), 2 * (r.nextDouble() - 0.5));
+            final Quaternion qP = q.getPositivePolarForm();
+
+            Assert.assertTrue(qP.isUnitQuaternion(COMPARISON_EPS));
+            Assert.assertTrue(qP.getQ0() >= 0);
+
+            final Rotation rot = new Rotation(q.getQ0(), q.getQ1(), q.getQ2(), q.getQ3(), true);
+            final Rotation rotP = new Rotation(qP.getQ0(), qP.getQ1(), qP.getQ2(), qP.getQ3(), true);
+
+            Assert.assertEquals(rot.getAngle(), rotP.getAngle(), COMPARISON_EPS);
+            Assert.assertEquals(rot.getAxis(RotationConvention.VECTOR_OPERATOR).getX(),
+                                rot.getAxis(RotationConvention.VECTOR_OPERATOR).getX(),
+                                COMPARISON_EPS);
+            Assert.assertEquals(rot.getAxis(RotationConvention.VECTOR_OPERATOR).getY(),
+                                rot.getAxis(RotationConvention.VECTOR_OPERATOR).getY(),
+                                COMPARISON_EPS);
+            Assert.assertEquals(rot.getAxis(RotationConvention.VECTOR_OPERATOR).getZ(),
+                                rot.getAxis(RotationConvention.VECTOR_OPERATOR).getZ(),
+                                COMPARISON_EPS);
+        }
+    }
+*/
+    @Test
+    public final void testGetInverse() {
+        final Quaternion q = new Quaternion(1.5, 4, 2, -2.5);
+
+        final Quaternion inverseQ = q.getInverse();
+        Assert.assertEquals(1.5 / 28.5, inverseQ.getQ0(), 0);
+        Assert.assertEquals(-4.0 / 28.5, inverseQ.getQ1(), 0);
+        Assert.assertEquals(-2.0 / 28.5, inverseQ.getQ2(), 0);
+        Assert.assertEquals(2.5 / 28.5, inverseQ.getQ3(), 0);
+
+        final Quaternion product = Quaternion.multiply(inverseQ, q);
+        Assert.assertEquals(1, product.getQ0(), EPS);
+        Assert.assertEquals(0, product.getQ1(), EPS);
+        Assert.assertEquals(0, product.getQ2(), EPS);
+        Assert.assertEquals(0, product.getQ3(), EPS);
+
+        final Quaternion qNul = new Quaternion(0, 0, 0, 0);
+        try {
+            final Quaternion inverseQNul = qNul.getInverse();
+            Assert.fail("expecting ZeroException but got : " + inverseQNul);
+        } catch (IllegalStateException ex) {
+            // expected
+        }
+    }
+
+    @Test
+    public final void testToString() {
+        final Quaternion q = new Quaternion(1, 2, 3, 4);
+        Assert.assertTrue(q.toString().equals("[1.0 2.0 3.0 4.0]"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c4541327/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index dbffb77..b1e4336 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -15,39 +15,40 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v0_0_1.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
     <version>41</version>
   </parent>
+
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.commons</groupId>
-  <artifactId>commons-complex</artifactId>
+  <artifactId>commons-numbers-parent</artifactId>
+  <packaging>pom</packaging>
   <version>1.0-SNAPSHOT</version>
-  <name>Apache Commons Complex</name>
-
-  <inceptionYear>2016</inceptionYear>
-  <description>The Apache Commons Complex project provides self-contained components addressing the most common practical problems involving Java computing with complex numbers.</description>
+  <name>Apache Commons Numbers</name>
 
-  <url>http://commons.apache.org/proper/commons-complex/</url>
+  <inceptionYear>2017</inceptionYear>
+  <description>The Apache Commons Numbers project provides number types and utilities.</description>
+  <url>http://commons.apache.org/proper/commons-numbers/</url>
 
   <issueManagement>
     <system>jira</system>
-    <url>http://issues.apache.org/jira/browse/COMPLEX</url>
+    <url>http://issues.apache.org/jira/browse/NUMBERS</url>
   </issueManagement>
 
   <scm>
-    <connection>scm:git:http://git-wip-us.apache.org/repos/asf/commons-complex.git</connection>
-    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-complex.git</developerConnection>
-    <url>https://git-wip-us.apache.org/repos/asf?p=commons-complex.git</url>
+    <connection>scm:git:http://git-wip-us.apache.org/repos/asf/commons-numbers.git</connection>
+    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/commons-numbers.git</developerConnection>
+    <url>https://git-wip-us.apache.org/repos/asf?p=commons-numbers.git</url>
   </scm>
 
   <distributionManagement>
     <site>
       <id>apache.website</id>
       <name>Apache Commons Site</name>
-      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-complex/</url>
+      <url>scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-numbers/</url>
     </site>
   </distributionManagement>
 
@@ -57,48 +58,54 @@
       <id>ericbarnhill</id>
       <email>ericbarnhill at apache dot org</email>
     </developer>
+    <developer>
+      <name>Gilles Sadowski</name>
+      <id>erans</id>
+      <email>erans at apache dot org</email>
+    </developer>
   </developers>
 
+  <contributors>
+    <contributor>
+      <name>Raymond DeCampo</name>
+    </contributor>
+  </contributors>
+
   <dependencies>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.11</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.commons</groupId>
-      <artifactId>commons-math3</artifactId>
-      <version>3.6.1</version>
+      <version>4.12</version>
       <scope>test</scope>
     </dependency>
   </dependencies>
 
   <properties>
-    <!-- Do not change: "math" is the name of the component even if the
+    <!-- Do not change: "numbers" is the name of the component even if the
          name of the base package evolves with major release numbers
          (see "commons.osgi.symbolicName", below). -->
-    <!-- TODO: when releasing 4.0, the properties below need to be updated, and
-         the 3.x release artifacts need to be put int commons.release.3  -->
-    <commons.componentid>complex</commons.componentid>
+    <commons.componentid>numbers</commons.componentid>
     <!-- This value must reflect the current name of the base package. -->
-    <commons.osgi.symbolicName>org.apache.commons.complex</commons.osgi.symbolicName>
+    <commons.osgi.symbolicName>org.apache.commons.numbers</commons.osgi.symbolicName>
+    <!-- OSGi -->
+    <commons.osgi.export>org.apache.commons.numbers</commons.osgi.export>
     <!-- do not use snapshot suffix here -->
     <commons.release.version>1.0</commons.release.version>
-    <commons.release.desc>(requires Java 1.5+)</commons.release.desc>
+    <commons.release.desc>(requires Java 7+)</commons.release.desc>
     <!-- <commons.rc.version>RC1</commons.rc.version> -->
     <commons.binary.suffix>-bin</commons.binary.suffix>
 
-    <commons.jira.id>COMPLEX</commons.jira.id>
+    <commons.jira.id>NUMBERS</commons.jira.id>
     <commons.jira.pid>12310485</commons.jira.pid>
     <commons.encoding>UTF-8</commons.encoding>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
-    <math.pmd.version>3.5</math.pmd.version>
-    <math.findbugs.version>3.0.2</math.findbugs.version>
-    <math.checkstyle.version>2.17</math.checkstyle.version>
-    <math.clirr.version>2.7</math.clirr.version>
+    <maven.compiler.source>1.6</maven.compiler.source>
+    <maven.compiler.target>1.6</maven.compiler.target>
+    <numbers.pmd.version>3.5</numbers.pmd.version>
+    <numbers.findbugs.version>3.0.2</numbers.findbugs.version>
+    <numbers.checkstyle.version>2.17</numbers.checkstyle.version>
+    <numbers.clirr.version>2.7</numbers.clirr.version>
+    <!-- Workaround to avoid duplicating config files. -->
+    <numbers.parent.dir>${basedir}</numbers.parent.dir>
 
     <!-- Temporary fix to support Java 8 -->
     <commons.jacoco.version>0.7.5.201505241946</commons.jacoco.version>
@@ -110,70 +117,61 @@
     <commons.jacoco.lineRatio>0.85</commons.jacoco.lineRatio>
     <commons.jacoco.haltOnFailure>false</commons.jacoco.haltOnFailure>
 
-    <commons.site.path>complex</commons.site.path>
-    <commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-complex</commons.scmPubUrl>
+    <commons.site.path>numbers</commons.site.path>
+    <commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-numbers</commons.scmPubUrl>
     <commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory>
 
     <!-- Temporary fix to replace svn-based build number with git-based build number -->
     <buildnumber.skip>true</buildnumber.skip>
-    <math.jgit.buildnumber.version>1.2.10</math.jgit.buildnumber.version>
+    <numbers.jgit.buildnumber.version>1.2.10</numbers.jgit.buildnumber.version>
     <implementation.build>${git.revision}; ${maven.build.timestamp}</implementation.build>
 
     <!-- Override default buildNumber timestamp format, needed for coveralls plugin -->
     <maven.buildNumber.timestampFormat>{0,date,yyyy-MM-dd HH:mm:ssZ}</maven.buildNumber.timestampFormat>
+
+    <!--
+        Override so that "mvn commons:download-page" will generates a web page
+        referring to the files created by the "dist-archive" module.
+        Temporary workaround?
+    -->
+    <commons.release.name>commons-numbers-${project.version}</commons.release.name>
   </properties>
 
   <build>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.maven.plugins</groupId>
-          <artifactId>maven-surefire-plugin</artifactId>
-            <configuration>
-              <includes>
-                <include>**/*Test.java</include>
-                <include>**/*TestBinary.java</include>
-                <include>**/*TestPermutations.java</include>
-              </includes>
-              <excludes>
-                <exclude>**/*AbstractTest.java</exclude>
-              </excludes>
-          </configuration>
-        </plugin>
-        <plugin>
-          <artifactId>maven-assembly-plugin</artifactId>
-          <configuration>
-            <descriptors>
-              <descriptor>src/main/assembly/src.xml</descriptor>
-              <descriptor>src/main/assembly/bin.xml</descriptor>
-            </descriptors>
-            <!-- There are a lot of long file names. Suppress the warnings. -->
-            <tarLongFileMode>gnu</tarLongFileMode>
-          </configuration>
-        </plugin>
-        <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>clirr-maven-plugin</artifactId>
-          <version>${math.clirr.version}</version>
-          <configuration>
-            <minSeverity>${minSeverity}</minSeverity>
-            <ignoredDifferencesFile>${basedir}/clirr-ignored.xml</ignoredDifferencesFile>
-          </configuration>
-          <executions>
-            <execution>
-              <goals>
-              </goals>
-            </execution>
-          </executions>
-        </plugin>
+    <plugins>
       <plugin>
-        <artifactId>maven-pmd-plugin</artifactId>
-        <version>${math.pmd.version}</version>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.5.1</version>
         <configuration>
-          <targetJdk>${maven.compiler.target}</targetJdk>
-          <skipEmptyReport>false</skipEmptyReport>
-          <rulesets>
-            <ruleset>${basedir}/pmd-ruleset.xml</ruleset>
-          </rulesets>
+          <compilerArgs>
+            <!-- <arg>-verbose</arg> -->
+            <arg>-Xlint:all,-options,-path</arg>
+          </compilerArgs>
+        </configuration>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <includes>
+            <include>**/*Test.java</include>
+          </includes>
+          <excludes>
+            <exclude>**/*AbstractTest.java</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>src/assembly/src.xml</descriptor>
+            <descriptor>src/assembly/bin.xml</descriptor>
+          </descriptors>
+          <!-- There are a lot of long file names. Suppress the warnings. -->
+          <tarLongFileMode>gnu</tarLongFileMode>
         </configuration>
       </plugin>
       <plugin>
@@ -187,93 +185,98 @@
       </plugin>
 
       <plugin>
-        <artifactId>maven-antrun-plugin</artifactId>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
         <executions>
           <execution>
-            <phase>package</phase>
-            <configuration>
-              <target>
-                <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}-tools.jar">
-                  <metainf dir="${basedir}" includes="NOTICE.txt,LICENSE.txt" />
-                  <manifest>
-                    <attribute name="Specification-Title" value="${project.name} Tools" />
-                    <attribute name="Implementation-Title" value="${project.name} Tools" />
-                    <attribute name="Implementation-Vendor" value="${project.organization.name}" />
-                    <attribute name="Implementation-Version" value="${project.version}" />
-                    <attribute name="Implementation-Vendor-Id" value="org.apache" />
-                    <attribute name="Implementation-Build" value="${implementation.build}"/>
-                    <attribute name="X-Compile-Source-JDK" value="${maven.compiler.source}" />
-                    <attribute name="X-Compile-Target-JDK" value="${maven.compiler.target}" />
-                  </manifest>
-                  <fileset dir="${project.build.directory}/test-classes"
-                           includes="org/apache/commons/complex/PerfTestUtils*" />
-                </jar>
-              </target>
-            </configuration>
+            <id>validate</id>
+            <phase>validate</phase>
             <goals>
-              <goal>run</goal>
+              <goal>check</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
-      <!--  Attaches the commons-math4 tools JAR to the Maven lifecycle
-            to ensure they will be signed and deployed as normal -->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <version>1.7</version>
-        <executions>
-          <execution>
-            <id>attach-artifacts</id>
-            <phase>package</phase>
-            <goals>
-              <goal>attach-artifact</goal>
-            </goals>
-            <configuration>
-              <artifacts>
-                <artifact>
-                  <file>${project.build.directory}/${project.artifactId}-${project.version}-tools.jar</file>
-                  <type>jar</type>
-                  <classifier>tools</classifier>
-                </artifact>
-              </artifacts>
-            </configuration>
-          </execution>
-        </executions>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <version>${numbers.findbugs.version}</version>
       </plugin>
-      <!--  MathJax -->
       <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-javadoc-plugin</artifactId>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <version>${commons.rat.version}</version>
         <configuration>
-          <additionalparam>-header &apos;&lt;script type=&quot;text/javascript&quot; src=&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;&apos;</additionalparam>
+        <!--
+          Needed for command-line access, e.g mvn apache-rat:rat and mvn apache-rat:check
+          Below should agree with config in <reporting> section, so the site
+          gets consistent output.
+        -->
+          <excludes combine.children="append">
+            <!-- version 0.8 of apache-rat-plugin does not exclude properly
+                 some default development tools files (see RAT-126) -->
+            <exclude>.ekstazi/**</exclude>
+            <exclude>src/site/resources/txt/userguide/stress/dh/**</exclude>
+            <exclude>src/site/resources/txt/userguide/stress/tu/**</exclude>
+            <exclude>dist-archive/**</exclude>
+          </excludes>
         </configuration>
       </plugin>
     </plugins>
+
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <version>${numbers.checkstyle.version}</version>
+          <configuration>
+            <includeTestSourceDirectory>false</includeTestSourceDirectory>
+            <configLocation>${numbers.parent.dir}/src/main/resources/checkstyle/checkstyle.xml</configLocation>
+            <headerLocation>${numbers.parent.dir}/src/main/resources/checkstyle/license-header.txt</headerLocation>
+            <logViolationsToConsole>false</logViolationsToConsole>
+            <failOnViolation>false</failOnViolation>
+            <resourceExcludes>NOTICE.txt,LICENSE.txt</resourceExcludes>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
   </build>
 
   <reporting>
     <plugins>
       <plugin>
+        <groupId>org.apache.rat</groupId>
+        <artifactId>apache-rat-plugin</artifactId>
+        <version>${commons.rat.version}</version>
+        <configuration>
+         <!--  Should agree with apache-rat-plugin config under <build> -->
+          <excludes combine.children="append">
+            <!-- version 0.8 of apache-rat-plugin does not exclude properly
+                 some default development tools files (see RAT-126) -->
+            <exclude>.ekstazi/**</exclude>
+            <exclude>dist-archive/**</exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-changes-plugin</artifactId>
         <version>${commons.changes.version}</version>
         <configuration>
-          <issueLinkTemplatePerSystem>
-            <default>%URL%/%ISSUE%</default>
-          </issueLinkTemplatePerSystem>
-          <!--  Add sample JIRA report - 'mvn changes:jira-report' or 'mvn site' -->
-          <onlyCurrentVersion>false</onlyCurrentVersion>
-          <columnNames>Fix Version,Key,Summary,Type,Resolution,Status</columnNames>
-          <!-- Sort cols have to be reversed in JIRA 4 -->
-          <sortColumnNames>Key DESC,Type,Fix Version DESC</sortColumnNames>
+          <xmlPath>${basedir}/src/changes/changes.xml</xmlPath>
+          <columnNames>Fix Version,Key,Component,Summary,Type,Resolution,Status</columnNames>
+          <!-- Sort cols in natural order when using JQL for JIRA 5.1 -->
+          <sortColumnNames>Fix Version DESC,Type,Key DESC</sortColumnNames>
           <resolutionIds>Fixed</resolutionIds>
           <statusIds>Resolved,Closed</statusIds>
           <!-- Don't include sub-task -->
           <typeIds>Bug,New Feature,Task,Improvement,Wish,Test</typeIds>
-          <fixVersionIds>${commons.release.version}</fixVersionIds>
-          <!-- The default is 100 -->
-          <maxEntries>100</maxEntries>
+          <!-- For JIRA >= 5.1 -->
+          <useJql>true</useJql>
+          <onlyCurrentVersion>${commons.changes.onlyCurrentVersion}</onlyCurrentVersion>
+          <maxEntries>${commons.changes.maxEntries}</maxEntries>
+          <runOnlyAtExecutionRoot>${commons.changes.runOnlyAtExecutionRoot}</runOnlyAtExecutionRoot>
         </configuration>
         <reportSets>
           <reportSet>
@@ -285,48 +288,24 @@
         </reportSets>
       </plugin>
       <plugin>
-        <groupId>org.apache.rat</groupId>
-        <artifactId>apache-rat-plugin</artifactId>
-        <version>${commons.rat.version}</version>
-        <configuration>
-          <excludes>
-
-            <!-- MANIFEST files cannot have any comments, so we can't put license header -->
-            <exclude>src/test/maxima/special/RealFunctionValidation/MANIFEST.txt</exclude>
-
-            <!-- text file explaining reference to a public domain image -->
-            <exclude>src/userguide/resources/references.txt</exclude>
-
-            <!-- version 0.8 of apache-rat-plugin does not exclude properly
-                 some default development tools files (see RAT-126) -->
-            <exclude>bin/**</exclude>
-            <exclude>.gitignore</exclude>
-            <exclude>.git/**</exclude>
-            <exclude>.checkstyle</exclude>
-            <exclude>.ekstazi/**</exclude>
-
-          </excludes>
-        </configuration>
-      </plugin>
-      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>findbugs-maven-plugin</artifactId>
-        <version>${complex.findbugs.version}</version>
+        <version>${numbers.findbugs.version}</version>
         <configuration>
           <threshold>Normal</threshold>
           <effort>Default</effort>
-          <excludeFilterFile>${basedir}/findbugs-exclude-filter.xml</excludeFilterFile>
-       </configuration>
+          <excludeFilterFile>${numbers.parent.dir}/src/main/resources/findbugs/findbugs-exclude-filter.xml</excludeFilterFile>
+        </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
-        <version>${math.checkstyle.version}</version>
+        <version>${numbers.checkstyle.version}</version>
         <configuration>
-          <configLocation>${basedir}/checkstyle.xml</configLocation>
+          <configLocation>${numbers.parent.dir}/src/main/resources/checkstyle/checkstyle.xml</configLocation>
+          <headerLocation>${numbers.parent.dir}/src/main/resources/checkstyle/license-header.txt</headerLocation>
           <enableRulesSummary>false</enableRulesSummary>
           <includeResources>false</includeResources>
-          <headerLocation>${basedir}/license-header.txt</headerLocation>
         </configuration>
         <reportSets>
           <reportSet>
@@ -339,31 +318,27 @@
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>clirr-maven-plugin</artifactId>
-        <version>${math.clirr.version}</version>
+        <version>${numbers.clirr.version}</version>
         <configuration>
           <minSeverity>${minSeverity}</minSeverity>
-          <ignoredDifferencesFile>${basedir}/clirr-ignored.xml</ignoredDifferencesFile>
-         </configuration>
+          <ignoredDifferencesFile>${numbers.parent.dir}/src/main/resources/clirr/clirr-ignored.xml</ignoredDifferencesFile>
+        </configuration>
       </plugin>
       <plugin>
         <artifactId>maven-pmd-plugin</artifactId>
-        <version>${math.pmd.version}</version>
+        <version>${numbers.pmd.version}</version>
         <configuration>
           <targetJdk>${maven.compiler.target}</targetJdk>
           <skipEmptyReport>false</skipEmptyReport>
           <rulesets>
-            <ruleset>${basedir}/pmd-ruleset.xml</ruleset>
+            <ruleset>${numbers.parent.dir}/src/main/resources/pmd/pmd-ruleset.xml</ruleset>
           </rulesets>
         </configuration>
         <reportSets>
           <reportSet>
             <reports>
               <report>pmd</report>
-              <!-- As of 3.x series, the cpd report sees (correctly) numerous duplications -->
-              <!-- This is due to packages being renamed, and the old name still needs to be -->
-              <!-- available for compatibility. They will be removed in 4.0 -->
-              <!-- So we temporarily disable the CPD report -->
-              <!-- <report>cpd</report> -->
+              <report>cpd</report>
             </reports>
           </reportSet>
         </reportSets>
@@ -373,7 +348,8 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-javadoc-plugin</artifactId>
         <configuration>
-          <additionalparam>-header &apos;&lt;script type=&quot;text/javascript&quot; src=&quot;http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&quot;&gt;&lt;/script&gt;&apos;</additionalparam>
+          <additionalparam>-Xdoclint:all -header '&lt;script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"&gt;&lt;/script&gt;'</additionalparam>
+          <!-- <aggregate>true</aggregate> -->
         </configuration>
       </plugin>
     </plugins>
@@ -392,7 +368,7 @@
           <plugin>
             <groupId>ru.concerteza.buildnumber</groupId>
             <artifactId>maven-jgit-buildnumber-plugin</artifactId>
-            <version>${math.jgit.buildnumber.version}</version>
+            <version>${numbers.jgit.buildnumber.version}</version>
             <executions>
               <execution>
                 <phase>generate-resources</phase>
@@ -430,18 +406,18 @@
                 <configuration>
                   <tasks>
                     <exec executable="svn">
-                      <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}" />
+                      <arg line="checkout --depth immediates ${commons.scmPubUrl} ${commons.scmPubCheckoutDirectory}"/>
                     </exec>
 
                     <exec executable="svn">
-                      <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs" />
+                      <arg line="update --set-depth exclude ${commons.scmPubCheckoutDirectory}/javadocs"/>
                     </exec>
 
                     <pathconvert pathsep=" " property="dirs">
-                      <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*" />
+                      <dirset dir="${commons.scmPubCheckoutDirectory}" includes="*"/>
                     </pathconvert>
                     <exec executable="svn">
-                      <arg line="update --set-depth infinity ${dirs}" />
+                      <arg line="update --set-depth infinity ${dirs}"/>
                     </exec>
                   </tasks>
                 </configuration>
@@ -505,11 +481,51 @@
             <version>${commons.jacoco.version}</version>
             <executions>
               <execution>
-                <id>prepare-agent</id>
+                <id>default-prepare-agent</id>
                 <goals>
                   <goal>prepare-agent</goal>
                 </goals>
               </execution>
+              <execution>
+                <id>default-prepare-agent-integration</id>
+                <goals>
+                  <goal>prepare-agent-integration</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>default-report</id>
+                <goals>
+                  <goal>report</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>default-report-integration</id>
+                <goals>
+                  <goal>report-integration</goal>
+                </goals>
+              </execution>
+              <execution>
+                <id>default-check</id>
+                <goals>
+                  <goal>check</goal>
+                </goals>
+                <configuration>
+                  <rules>
+                    <!--  implementation is needed only for Maven 2  -->
+                    <rule implementation="org.jacoco.maven.RuleConfiguration">
+                      <element>BUNDLE</element>
+                      <limits>
+                        <!--  implementation is needed only for Maven 2  -->
+                        <limit implementation="org.jacoco.report.check.Limit">
+                          <counter>COMPLEXITY</counter>
+                          <value>COVEREDRATIO</value>
+                          <minimum>0.60</minimum>
+                        </limit>
+                      </limits>
+                    </rule>
+                  </rules>
+                </configuration>
+              </execution>
             </executions>
           </plugin>
           <plugin>
@@ -520,5 +536,15 @@
         </plugins>
       </build>
     </profile>
+
   </profiles>
+
+  <modules>
+    <module>commons-numbers-core</module>
+    <module>commons-numbers-complex</module>
+    <module>commons-numbers-quaternion</module>
+    <!-- <module>commons-numbers-fraction</module> -->
+    <!-- <module>commons-numbers-continuedfraction</module> -->
+  </modules>
+
 </project>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c4541327/src/main/resources/checkstyle/checkstyle.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/checkstyle/checkstyle.xml b/src/main/resources/checkstyle/checkstyle.xml
new file mode 100644
index 0000000..a138af6
--- /dev/null
+++ b/src/main/resources/checkstyle/checkstyle.xml
@@ -0,0 +1,202 @@
+<?xml version="1.0"?>
+
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+
+<!-- Commons RNG customization of default Checkstyle behavior -->
+<module name="Checker">
+  <property name="localeLanguage" value="en"/>
+
+  <module name="TreeWalker">
+
+    <!-- Operator must be at end of wrapped line -->
+    <module name="OperatorWrap">
+      <property name="option" value="eol"/>
+    </module>
+
+    <!-- No if/else/do/for/while without braces -->
+    <module name="NeedBraces"/>
+
+    <!-- Interfaces must be types (not just constants) -->
+    <module name="InterfaceIsType"/>
+
+    <!-- Must have class / interface header comments -->
+    <module name="JavadocType"/>
+
+     <!-- Require method javadocs, allow undeclared RTE -->
+    <module name="JavadocMethod">
+      <property name="allowUndeclaredRTE" value="true"/>
+      <property name="allowThrowsTagsForSubclasses" value="true"/>
+      <property name="validateThrows" value="false"/>
+    </module>
+
+    <!-- Require field javadoc -->
+    <module name="JavadocVariable"/>
+
+    <!-- No public fields -->
+    <module name="VisibilityModifier">
+       <property name="protectedAllowed" value="true"/>
+    </module>
+
+    <!-- Require hash code override when equals is -->
+    <module name="EqualsHashCode"/>
+
+    <!-- Disallow unnecessary instantiation of Boolean, String -->
+    <module name="IllegalInstantiation">
+      <property name="classes" value="java.lang.Boolean, java.lang.String"/>
+    </module>
+
+    <!-- Required for SuppressionCommentFilter below -->
+    <module name="FileContentsHolder"/>
+
+    <!--  Import should be explicit, really needed and only from pure java packages -->
+    <module name="AvoidStarImport" />
+    <module name="UnusedImports" />
+    <module name="IllegalImport" />
+
+    <!-- Utility class should not be instantiated, they must have a private constructor -->
+    <module name="HideUtilityClassConstructor" />
+
+    <!-- Switch statements should be complete and with independent cases -->
+    <module name="FallThrough" />
+    <module name="MissingSwitchDefault" />
+
+    <!-- Constant names should obey the traditional all uppercase naming convention -->
+    <module name="ConstantName" />
+
+    <!-- Method parameters and local variables should not hide fields, except in constructors and setters -->
+    <module name="HiddenField">
+        <property name="ignoreConstructorParameter" value="true" />
+        <property name="ignoreSetter" value="true" />
+    </module>
+
+    <!-- No trailing whitespace -->
+    <module name="Regexp">
+      <property name="format" value="[ \t]+$"/>
+      <property name="illegalPattern" value="true"/>
+      <property name="message" value="Trailing whitespace"/>
+    </module>
+
+    <!-- No System.out.println() statements -->
+    <module name="Regexp">
+      <!-- no sysouts -->
+      <property name="format" value="System\.out\.println"/>
+      <property name="illegalPattern" value="true"/>
+    </module>
+
+    <!-- Authors should be in pom.xml file -->
+    <module name="Regexp">
+      <property name="format" value="@author"/>
+      <property name="illegalPattern" value="true"/>
+      <property name="message" value="developers names should be in pom file"/>
+    </module>
+
+    <!-- Use a consistent way to put modifiers -->
+    <module name="RedundantModifier" />
+    <module name="ModifierOrder" />
+
+    <!-- Use a consistent way to put declarations -->
+    <module name="DeclarationOrder" />
+
+    <!-- Don't add up parentheses when they are not required -->
+    <module name="UnnecessaryParentheses" />
+
+    <!--  Don't use too widespread catch (Exception, Throwable, RuntimeException)  -->
+    <module name="IllegalCatch" />
+
+    <!-- Don't use = or != for string comparisons -->
+    <module name="StringLiteralEquality" />
+
+   <!-- Don't declare multiple variables in the same statement -->
+    <module name="MultipleVariableDeclarations" />
+
+    <!-- String literals more than one character long should not be repeated several times -->
+    <!-- the "unchecked" string is also accepted to allow @SuppressWarnings("unchecked") -->
+    <module name="MultipleStringLiterals" >
+      <property name="ignoreStringsRegexp" value='^(("")|(".")|("unchecked"))$'/>
+    </module>
+
+    <!-- Check if @Override tags are present  -->
+    <module name="MissingOverride" />
+
+    <!-- <module name="TodoComment" /> -->
+
+  </module>
+
+  <!-- Verify that EVERY source file has the appropriate license -->
+  <module name="Header">
+    <property name="headerFile" value="${checkstyle.header.file}"/>
+  </module>
+
+  <!-- No tabs allowed! -->
+  <module name="FileTabCharacter"/>
+
+  <!-- Require files to end with newline characters -->
+  <module name="NewlineAtEndOfFile"/>
+
+  <!-- Require package javadoc -->
+  <module name="JavadocPackage"/>
+
+  <!-- Setup special comments to suppress specific checks from source files -->
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop JavadocVariable"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume JavadocVariable"/>
+    <property name="checkFormat"      value="JavadocVariable"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop JavadocMethodCheck"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume JavadocMethodCheck"/>
+    <property name="checkFormat"      value="JavadocMethodCheck"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop ConstantName"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume ConstantName"/>
+    <property name="checkFormat"      value="ConstantName"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop HideUtilityClassConstructor"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume HideUtilityClassConstructor"/>
+    <property name="checkFormat"      value="HideUtilityClassConstructor"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop MultipleVariableDeclarations"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume MultipleVariableDeclarations"/>
+    <property name="checkFormat"      value="MultipleVariableDeclarations"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop IllegalCatch"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume IllegalCatch"/>
+    <property name="checkFormat"      value="IllegalCatch"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop DeclarationOrder"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume DeclarationOrder"/>
+    <property name="checkFormat"      value="DeclarationOrder"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop RedundantModifier"/>
+    <property name="onCommentFormat"  value="CHECKSTYLE\: resume RedundantModifier"/>
+    <property name="checkFormat"      value="RedundantModifier"/>
+  </module>
+  <module name="SuppressionCommentFilter">
+    <property name="offCommentFormat" value="CHECKSTYLE\: stop all"/>
+    <property name="onCommentFormat" value="CHECKSTYLE\: resume all"/>
+  </module>
+</module>
+

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c4541327/src/main/resources/checkstyle/license-header.txt
----------------------------------------------------------------------
diff --git a/src/main/resources/checkstyle/license-header.txt b/src/main/resources/checkstyle/license-header.txt
new file mode 100644
index 0000000..ae6f28c
--- /dev/null
+++ b/src/main/resources/checkstyle/license-header.txt
@@ -0,0 +1,16 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c4541327/src/main/resources/clirr/clirr-ignored.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/clirr/clirr-ignored.xml b/src/main/resources/clirr/clirr-ignored.xml
new file mode 100644
index 0000000..ed97259
--- /dev/null
+++ b/src/main/resources/clirr/clirr-ignored.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<differences>
+
+</differences>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c4541327/src/main/resources/findbugs/findbugs-exclude-filter.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/findbugs/findbugs-exclude-filter.xml b/src/main/resources/findbugs/findbugs-exclude-filter.xml
new file mode 100644
index 0000000..8a9c858
--- /dev/null
+++ b/src/main/resources/findbugs/findbugs-exclude-filter.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+
+<!--
+  This file contains some false positive bugs detected by findbugs. Their
+  false positive nature has been analyzed individually and they have been
+  put here to instruct findbugs it must ignore them.
+-->
+<FindBugsFilter>
+
+  <Class name="~.*\.jmh\.generated\..*" />
+
+</FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/c4541327/src/main/resources/pmd/pmd-ruleset.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/pmd/pmd-ruleset.xml b/src/main/resources/pmd/pmd-ruleset.xml
new file mode 100644
index 0000000..c637ef7
--- /dev/null
+++ b/src/main/resources/pmd/pmd-ruleset.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<ruleset name="commons-rng-customized"
+    xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
+  <description>
+    This ruleset checks the code for discouraged programming constructs.
+  </description>
+
+  <rule ref="rulesets/java/basic.xml"/>
+
+  <rule ref="rulesets/java/braces.xml"/>
+
+  <rule ref="rulesets/java/comments.xml">
+    <exclude name="CommentSize"/>
+  </rule>
+  <rule ref="rulesets/java/comments.xml/CommentSize">
+    <properties>
+      <property name="maxLines"      value="200"/>
+      <property name="maxLineLength" value="256"/>
+    </properties>
+  </rule>
+
+  <rule ref="rulesets/java/empty.xml"/>
+
+  <rule ref="rulesets/java/finalizers.xml"/>
+
+  <rule ref="rulesets/java/imports.xml"/>
+
+  <rule ref="rulesets/java/typeresolution.xml"/>
+
+  <rule ref="rulesets/java/clone.xml"/>
+
+  <rule ref="rulesets/java/unnecessary.xml">
+    <!-- We do use extra parentheses there as most people do not recall operator precedence,
+         this means even if the parentheses are useless for the compiler, we don't consider
+         them useless for the developer. This is the reason why we disable this rule. -->
+    <exclude name="UselessParentheses"/>
+  </rule>
+
+</ruleset>


Mime
View raw message