Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 177FC200B99 for ; Tue, 20 Sep 2016 19:31:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 15F9D160AC0; Tue, 20 Sep 2016 17:31:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 61677160AC9 for ; Tue, 20 Sep 2016 19:31:55 +0200 (CEST) Received: (qmail 48743 invoked by uid 500); 20 Sep 2016 17:31:52 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 47556 invoked by uid 99); 20 Sep 2016 17:31:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2016 17:31:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB3DEE17A9; Tue, 20 Sep 2016 17:31:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ggregory@apache.org To: commits@commons.apache.org Date: Tue, 20 Sep 2016 17:31:59 -0000 Message-Id: In-Reply-To: <73fa9a7eaa9540ff89c9676c4d42283d@git.apache.org> References: <73fa9a7eaa9540ff89c9676c4d42283d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/10] [math] Revert "Remove redundant type arguments." archived-at: Tue, 20 Sep 2016 17:31:58 -0000 http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotation.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotation.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotation.java index be89ef4..2dc6933 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotation.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldRotation.java @@ -374,9 +374,9 @@ public class FieldRotation> implements Serializabl public FieldRotation(final RotationOrder order, final RotationConvention convention, final T alpha1, final T alpha2, final T alpha3) { final T one = alpha1.getField().getOne(); - final FieldRotation r1 = new FieldRotation<>(new FieldVector3D<>(one, order.getA1()), alpha1, convention); - final FieldRotation r2 = new FieldRotation<>(new FieldVector3D<>(one, order.getA2()), alpha2, convention); - final FieldRotation r3 = new FieldRotation<>(new FieldVector3D<>(one, order.getA3()), alpha3, convention); + final FieldRotation r1 = new FieldRotation(new FieldVector3D(one, order.getA1()), alpha1, convention); + final FieldRotation r2 = new FieldRotation(new FieldVector3D(one, order.getA2()), alpha2, convention); + final FieldRotation r3 = new FieldRotation(new FieldVector3D(one, order.getA3()), alpha3, convention); final FieldRotation composed = r1.compose(r2.compose(r3, convention), convention); q0 = composed.q0; q1 = composed.q1; @@ -453,7 +453,7 @@ public class FieldRotation> implements Serializabl * of the instance */ public FieldRotation revert() { - return new FieldRotation<>(q0.negate(), q1, q2, q3, false); + return new FieldRotation(q0.negate(), q1, q2, q3, false); } /** Get the scalar coordinate of the quaternion. @@ -509,17 +509,17 @@ public class FieldRotation> implements Serializabl final T squaredSine = q1.multiply(q1).add(q2.multiply(q2)).add(q3.multiply(q3)); if (squaredSine.getReal() == 0) { final Field field = squaredSine.getField(); - return new FieldVector3D<>(convention == RotationConvention.VECTOR_OPERATOR ? field.getOne(): field.getOne().negate(), + return new FieldVector3D(convention == RotationConvention.VECTOR_OPERATOR ? field.getOne(): field.getOne().negate(), field.getZero(), field.getZero()); } else { final double sgn = convention == RotationConvention.VECTOR_OPERATOR ? +1 : -1; if (q0.getReal() < 0) { T inverse = squaredSine.sqrt().reciprocal().multiply(sgn); - return new FieldVector3D<>(q1.multiply(inverse), q2.multiply(inverse), q3.multiply(inverse)); + return new FieldVector3D(q1.multiply(inverse), q2.multiply(inverse), q3.multiply(inverse)); } final T inverse = squaredSine.sqrt().reciprocal().negate().multiply(sgn); - return new FieldVector3D<>(q1.multiply(inverse), q2.multiply(inverse), q3.multiply(inverse)); + return new FieldVector3D(q1.multiply(inverse), q2.multiply(inverse), q3.multiply(inverse)); } } @@ -1032,7 +1032,7 @@ public class FieldRotation> implements Serializabl */ private FieldVector3D vector(final double x, final double y, final double z) { final T zero = q0.getField().getZero(); - return new FieldVector3D<>(zero.add(x), zero.add(y), zero.add(z)); + return new FieldVector3D(zero.add(x), zero.add(y), zero.add(z)); } /** Get the 3X3 matrix corresponding to the instance @@ -1090,7 +1090,7 @@ public class FieldRotation> implements Serializabl final T s = q1.multiply(x).add(q2.multiply(y)).add(q3.multiply(z)); - return new FieldVector3D<>(q0.multiply(x.multiply(q0).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), + return new FieldVector3D(q0.multiply(x.multiply(q0).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), q0.multiply(y.multiply(q0).subtract(q3.multiply(x).subtract(q1.multiply(z)))).add(s.multiply(q2)).multiply(2).subtract(y), q0.multiply(z.multiply(q0).subtract(q1.multiply(y).subtract(q2.multiply(x)))).add(s.multiply(q3)).multiply(2).subtract(z)); @@ -1108,7 +1108,7 @@ public class FieldRotation> implements Serializabl final T s = q1.multiply(x).add(q2.multiply(y)).add(q3.multiply(z)); - return new FieldVector3D<>(q0.multiply(q0.multiply(x).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), + return new FieldVector3D(q0.multiply(q0.multiply(x).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), q0.multiply(q0.multiply(y).subtract(q3.multiply(x).subtract(q1.multiply(z)))).add(s.multiply(q2)).multiply(2).subtract(y), q0.multiply(q0.multiply(z).subtract(q1.multiply(y).subtract(q2.multiply(x)))).add(s.multiply(q3)).multiply(2).subtract(z)); @@ -1165,7 +1165,7 @@ public class FieldRotation> implements Serializabl final T s = x.multiply(r.getQ1()).add(y.multiply(r.getQ2())).add(z.multiply(r.getQ3())); - return new FieldVector3D<>(x.multiply(r.getQ0()).subtract(z.multiply(r.getQ2()).subtract(y.multiply(r.getQ3()))).multiply(r.getQ0()).add(s.multiply(r.getQ1())).multiply(2).subtract(x), + return new FieldVector3D(x.multiply(r.getQ0()).subtract(z.multiply(r.getQ2()).subtract(y.multiply(r.getQ3()))).multiply(r.getQ0()).add(s.multiply(r.getQ1())).multiply(2).subtract(x), y.multiply(r.getQ0()).subtract(x.multiply(r.getQ3()).subtract(z.multiply(r.getQ1()))).multiply(r.getQ0()).add(s.multiply(r.getQ2())).multiply(2).subtract(y), z.multiply(r.getQ0()).subtract(y.multiply(r.getQ1()).subtract(x.multiply(r.getQ2()))).multiply(r.getQ0()).add(s.multiply(r.getQ3())).multiply(2).subtract(z)); @@ -1184,7 +1184,7 @@ public class FieldRotation> implements Serializabl final T s = q1.multiply(x).add(q2.multiply(y)).add(q3.multiply(z)); final T m0 = q0.negate(); - return new FieldVector3D<>(m0.multiply(x.multiply(m0).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), + return new FieldVector3D(m0.multiply(x.multiply(m0).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), m0.multiply(y.multiply(m0).subtract(q3.multiply(x).subtract(q1.multiply(z)))).add(s.multiply(q2)).multiply(2).subtract(y), m0.multiply(z.multiply(m0).subtract(q1.multiply(y).subtract(q2.multiply(x)))).add(s.multiply(q3)).multiply(2).subtract(z)); @@ -1203,7 +1203,7 @@ public class FieldRotation> implements Serializabl final T s = q1.multiply(x).add(q2.multiply(y)).add(q3.multiply(z)); final T m0 = q0.negate(); - return new FieldVector3D<>(m0.multiply(m0.multiply(x).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), + return new FieldVector3D(m0.multiply(m0.multiply(x).subtract(q2.multiply(z).subtract(q3.multiply(y)))).add(s.multiply(q1)).multiply(2).subtract(x), m0.multiply(m0.multiply(y).subtract(q3.multiply(x).subtract(q1.multiply(z)))).add(s.multiply(q2)).multiply(2).subtract(y), m0.multiply(m0.multiply(z).subtract(q1.multiply(y).subtract(q2.multiply(x)))).add(s.multiply(q3)).multiply(2).subtract(z)); @@ -1263,7 +1263,7 @@ public class FieldRotation> implements Serializabl final T s = x.multiply(r.getQ1()).add(y.multiply(r.getQ2())).add(z.multiply(r.getQ3())); final double m0 = -r.getQ0(); - return new FieldVector3D<>(x.multiply(m0).subtract(z.multiply(r.getQ2()).subtract(y.multiply(r.getQ3()))).multiply(m0).add(s.multiply(r.getQ1())).multiply(2).subtract(x), + return new FieldVector3D(x.multiply(m0).subtract(z.multiply(r.getQ2()).subtract(y.multiply(r.getQ3()))).multiply(m0).add(s.multiply(r.getQ1())).multiply(2).subtract(x), y.multiply(m0).subtract(x.multiply(r.getQ3()).subtract(z.multiply(r.getQ1()))).multiply(m0).add(s.multiply(r.getQ2())).multiply(2).subtract(y), z.multiply(m0).subtract(y.multiply(r.getQ1()).subtract(x.multiply(r.getQ2()))).multiply(m0).add(s.multiply(r.getQ3())).multiply(2).subtract(z)); @@ -1317,7 +1317,7 @@ public class FieldRotation> implements Serializabl * using vector operator convention */ private FieldRotation composeInternal(final FieldRotation r) { - return new FieldRotation<>(r.q0.multiply(q0).subtract(r.q1.multiply(q1).add(r.q2.multiply(q2)).add(r.q3.multiply(q3))), + return new FieldRotation(r.q0.multiply(q0).subtract(r.q1.multiply(q1).add(r.q2.multiply(q2)).add(r.q3.multiply(q3))), r.q1.multiply(q0).add(r.q0.multiply(q1)).add(r.q2.multiply(q3).subtract(r.q3.multiply(q2))), r.q2.multiply(q0).add(r.q0.multiply(q2)).add(r.q3.multiply(q1).subtract(r.q1.multiply(q3))), r.q3.multiply(q0).add(r.q0.multiply(q3)).add(r.q1.multiply(q2).subtract(r.q2.multiply(q1))), @@ -1372,7 +1372,7 @@ public class FieldRotation> implements Serializabl * using vector operator convention */ private FieldRotation composeInternal(final Rotation r) { - return new FieldRotation<>(q0.multiply(r.getQ0()).subtract(q1.multiply(r.getQ1()).add(q2.multiply(r.getQ2())).add(q3.multiply(r.getQ3()))), + return new FieldRotation(q0.multiply(r.getQ0()).subtract(q1.multiply(r.getQ1()).add(q2.multiply(r.getQ2())).add(q3.multiply(r.getQ3()))), q0.multiply(r.getQ1()).add(q1.multiply(r.getQ0())).add(q3.multiply(r.getQ2()).subtract(q2.multiply(r.getQ3()))), q0.multiply(r.getQ2()).add(q2.multiply(r.getQ0())).add(q1.multiply(r.getQ3()).subtract(q3.multiply(r.getQ1()))), q0.multiply(r.getQ3()).add(q3.multiply(r.getQ0())).add(q2.multiply(r.getQ1()).subtract(q1.multiply(r.getQ2()))), @@ -1391,7 +1391,7 @@ public class FieldRotation> implements Serializabl * @return a new rotation which is the composition of r by the instance */ public static > FieldRotation applyTo(final Rotation r1, final FieldRotation rInner) { - return new FieldRotation<>(rInner.q0.multiply(r1.getQ0()).subtract(rInner.q1.multiply(r1.getQ1()).add(rInner.q2.multiply(r1.getQ2())).add(rInner.q3.multiply(r1.getQ3()))), + return new FieldRotation(rInner.q0.multiply(r1.getQ0()).subtract(rInner.q1.multiply(r1.getQ1()).add(rInner.q2.multiply(r1.getQ2())).add(rInner.q3.multiply(r1.getQ3()))), rInner.q1.multiply(r1.getQ0()).add(rInner.q0.multiply(r1.getQ1())).add(rInner.q2.multiply(r1.getQ3()).subtract(rInner.q3.multiply(r1.getQ2()))), rInner.q2.multiply(r1.getQ0()).add(rInner.q0.multiply(r1.getQ2())).add(rInner.q3.multiply(r1.getQ1()).subtract(rInner.q1.multiply(r1.getQ3()))), rInner.q3.multiply(r1.getQ0()).add(rInner.q0.multiply(r1.getQ3())).add(rInner.q1.multiply(r1.getQ2()).subtract(rInner.q2.multiply(r1.getQ1()))), @@ -1450,7 +1450,7 @@ public class FieldRotation> implements Serializabl * of the instance using vector operator convention */ private FieldRotation composeInverseInternal(FieldRotation r) { - return new FieldRotation<>(r.q0.multiply(q0).add(r.q1.multiply(q1).add(r.q2.multiply(q2)).add(r.q3.multiply(q3))).negate(), + return new FieldRotation(r.q0.multiply(q0).add(r.q1.multiply(q1).add(r.q2.multiply(q2)).add(r.q3.multiply(q3))).negate(), r.q0.multiply(q1).add(r.q2.multiply(q3).subtract(r.q3.multiply(q2))).subtract(r.q1.multiply(q0)), r.q0.multiply(q2).add(r.q3.multiply(q1).subtract(r.q1.multiply(q3))).subtract(r.q2.multiply(q0)), r.q0.multiply(q3).add(r.q1.multiply(q2).subtract(r.q2.multiply(q1))).subtract(r.q3.multiply(q0)), @@ -1509,7 +1509,7 @@ public class FieldRotation> implements Serializabl * of the instance using vector operator convention */ private FieldRotation composeInverseInternal(Rotation r) { - return new FieldRotation<>(q0.multiply(r.getQ0()).add(q1.multiply(r.getQ1()).add(q2.multiply(r.getQ2())).add(q3.multiply(r.getQ3()))).negate(), + return new FieldRotation(q0.multiply(r.getQ0()).add(q1.multiply(r.getQ1()).add(q2.multiply(r.getQ2())).add(q3.multiply(r.getQ3()))).negate(), q1.multiply(r.getQ0()).add(q3.multiply(r.getQ2()).subtract(q2.multiply(r.getQ3()))).subtract(q0.multiply(r.getQ1())), q2.multiply(r.getQ0()).add(q1.multiply(r.getQ3()).subtract(q3.multiply(r.getQ1()))).subtract(q0.multiply(r.getQ2())), q3.multiply(r.getQ0()).add(q2.multiply(r.getQ1()).subtract(q1.multiply(r.getQ2()))).subtract(q0.multiply(r.getQ3())), @@ -1530,7 +1530,7 @@ public class FieldRotation> implements Serializabl * of the instance */ public static > FieldRotation applyInverseTo(final Rotation rOuter, final FieldRotation rInner) { - return new FieldRotation<>(rInner.q0.multiply(rOuter.getQ0()).add(rInner.q1.multiply(rOuter.getQ1()).add(rInner.q2.multiply(rOuter.getQ2())).add(rInner.q3.multiply(rOuter.getQ3()))).negate(), + return new FieldRotation(rInner.q0.multiply(rOuter.getQ0()).add(rInner.q1.multiply(rOuter.getQ1()).add(rInner.q2.multiply(rOuter.getQ2())).add(rInner.q3.multiply(rOuter.getQ3()))).negate(), rInner.q0.multiply(rOuter.getQ1()).add(rInner.q2.multiply(rOuter.getQ3()).subtract(rInner.q3.multiply(rOuter.getQ2()))).subtract(rInner.q1.multiply(rOuter.getQ0())), rInner.q0.multiply(rOuter.getQ2()).add(rInner.q3.multiply(rOuter.getQ1()).subtract(rInner.q1.multiply(rOuter.getQ3()))).subtract(rInner.q2.multiply(rOuter.getQ0())), rInner.q0.multiply(rOuter.getQ3()).add(rInner.q1.multiply(rOuter.getQ2()).subtract(rInner.q2.multiply(rOuter.getQ1()))).subtract(rInner.q3.multiply(rOuter.getQ0())), http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java index bec2d74..f03a1ec 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3D.java @@ -408,7 +408,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D add(final FieldVector3D v) { - return new FieldVector3D<>(x.add(v.x), y.add(v.y), z.add(v.z)); + return new FieldVector3D(x.add(v.x), y.add(v.y), z.add(v.z)); } /** Add a vector to the instance. @@ -416,7 +416,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D add(final Vector3D v) { - return new FieldVector3D<>(x.add(v.getX()), y.add(v.getY()), z.add(v.getZ())); + return new FieldVector3D(x.add(v.getX()), y.add(v.getY()), z.add(v.getZ())); } /** Add a scaled vector to the instance. @@ -425,7 +425,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D add(final T factor, final FieldVector3D v) { - return new FieldVector3D<>(x.getField().getOne(), this, factor, v); + return new FieldVector3D(x.getField().getOne(), this, factor, v); } /** Add a scaled vector to the instance. @@ -434,7 +434,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D add(final T factor, final Vector3D v) { - return new FieldVector3D<>(x.add(factor.multiply(v.getX())), + return new FieldVector3D(x.add(factor.multiply(v.getX())), y.add(factor.multiply(v.getY())), z.add(factor.multiply(v.getZ()))); } @@ -445,7 +445,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D add(final double factor, final FieldVector3D v) { - return new FieldVector3D<>(1.0, this, factor, v); + return new FieldVector3D(1.0, this, factor, v); } /** Add a scaled vector to the instance. @@ -454,7 +454,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D add(final double factor, final Vector3D v) { - return new FieldVector3D<>(x.add(factor * v.getX()), + return new FieldVector3D(x.add(factor * v.getX()), y.add(factor * v.getY()), z.add(factor * v.getZ())); } @@ -464,7 +464,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D subtract(final FieldVector3D v) { - return new FieldVector3D<>(x.subtract(v.x), y.subtract(v.y), z.subtract(v.z)); + return new FieldVector3D(x.subtract(v.x), y.subtract(v.y), z.subtract(v.z)); } /** Subtract a vector from the instance. @@ -472,7 +472,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D subtract(final Vector3D v) { - return new FieldVector3D<>(x.subtract(v.getX()), y.subtract(v.getY()), z.subtract(v.getZ())); + return new FieldVector3D(x.subtract(v.getX()), y.subtract(v.getY()), z.subtract(v.getZ())); } /** Subtract a scaled vector from the instance. @@ -481,7 +481,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D subtract(final T factor, final FieldVector3D v) { - return new FieldVector3D<>(x.getField().getOne(), this, factor.negate(), v); + return new FieldVector3D(x.getField().getOne(), this, factor.negate(), v); } /** Subtract a scaled vector from the instance. @@ -490,7 +490,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D subtract(final T factor, final Vector3D v) { - return new FieldVector3D<>(x.subtract(factor.multiply(v.getX())), + return new FieldVector3D(x.subtract(factor.multiply(v.getX())), y.subtract(factor.multiply(v.getY())), z.subtract(factor.multiply(v.getZ()))); } @@ -501,7 +501,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D subtract(final double factor, final FieldVector3D v) { - return new FieldVector3D<>(1.0, this, -factor, v); + return new FieldVector3D(1.0, this, -factor, v); } /** Subtract a scaled vector from the instance. @@ -510,7 +510,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D subtract(final double factor, final Vector3D v) { - return new FieldVector3D<>(x.subtract(factor * v.getX()), + return new FieldVector3D(x.subtract(factor * v.getX()), y.subtract(factor * v.getY()), z.subtract(factor * v.getZ())); } @@ -551,13 +551,13 @@ public class FieldVector3D> implements Serializabl if (FastMath.abs(x.getReal()) <= threshold) { final T inverse = y.multiply(y).add(z.multiply(z)).sqrt().reciprocal(); - return new FieldVector3D<>(inverse.getField().getZero(), inverse.multiply(z), inverse.multiply(y).negate()); + return new FieldVector3D(inverse.getField().getZero(), inverse.multiply(z), inverse.multiply(y).negate()); } else if (FastMath.abs(y.getReal()) <= threshold) { final T inverse = x.multiply(x).add(z.multiply(z)).sqrt().reciprocal(); - return new FieldVector3D<>(inverse.multiply(z).negate(), inverse.getField().getZero(), inverse.multiply(x)); + return new FieldVector3D(inverse.multiply(z).negate(), inverse.getField().getZero(), inverse.multiply(x)); } else { final T inverse = x.multiply(x).add(y.multiply(y)).sqrt().reciprocal(); - return new FieldVector3D<>(inverse.multiply(y), inverse.multiply(x).negate(), inverse.getField().getZero()); + return new FieldVector3D(inverse.multiply(y), inverse.multiply(x).negate(), inverse.getField().getZero()); } } @@ -655,7 +655,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector which is opposite to the instance */ public FieldVector3D negate() { - return new FieldVector3D<>(x.negate(), y.negate(), z.negate()); + return new FieldVector3D(x.negate(), y.negate(), z.negate()); } /** Multiply the instance by a scalar. @@ -663,7 +663,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D scalarMultiply(final T a) { - return new FieldVector3D<>(x.multiply(a), y.multiply(a), z.multiply(a)); + return new FieldVector3D(x.multiply(a), y.multiply(a), z.multiply(a)); } /** Multiply the instance by a scalar. @@ -671,7 +671,7 @@ public class FieldVector3D> implements Serializabl * @return a new vector */ public FieldVector3D scalarMultiply(final double a) { - return new FieldVector3D<>(x.multiply(a), y.multiply(a), z.multiply(a)); + return new FieldVector3D(x.multiply(a), y.multiply(a), z.multiply(a)); } /** @@ -779,7 +779,7 @@ public class FieldVector3D> implements Serializabl * @return the cross product this ^ v as a new Vector3D */ public FieldVector3D crossProduct(final FieldVector3D v) { - return new FieldVector3D<>(x.linearCombination(y, v.z, z.negate(), v.y), + return new FieldVector3D(x.linearCombination(y, v.z, z.negate(), v.y), y.linearCombination(z, v.x, x.negate(), v.z), z.linearCombination(x, v.y, y.negate(), v.x)); } @@ -789,7 +789,7 @@ public class FieldVector3D> implements Serializabl * @return the cross product this ^ v as a new Vector3D */ public FieldVector3D crossProduct(final Vector3D v) { - return new FieldVector3D<>(x.linearCombination(v.getZ(), y, -v.getY(), z), + return new FieldVector3D(x.linearCombination(v.getZ(), y, -v.getY(), z), y.linearCombination(v.getX(), z, -v.getZ(), x), z.linearCombination(v.getY(), x, -v.getX(), y)); } @@ -993,7 +993,7 @@ public class FieldVector3D> implements Serializabl */ public static > FieldVector3D crossProduct(final Vector3D v1, final FieldVector3D v2) { - return new FieldVector3D<>(v2.x.linearCombination(v1.getY(), v2.z, -v1.getZ(), v2.y), + return new FieldVector3D(v2.x.linearCombination(v1.getY(), v2.z, -v1.getZ(), v2.y), v2.y.linearCombination(v1.getZ(), v2.x, -v1.getX(), v2.z), v2.z.linearCombination(v1.getX(), v2.y, -v1.getY(), v2.x)); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/OutlineExtractor.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/OutlineExtractor.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/OutlineExtractor.java index 67abdd1..a501813 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/OutlineExtractor.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/OutlineExtractor.java @@ -203,7 +203,7 @@ public class OutlineExtractor { } // compute the projection of the facet in the outline plane - final ArrayList> edges = new ArrayList<>(); + final ArrayList> edges = new ArrayList>(); for (Vector2D[] loop : vertices) { final boolean closed = loop[0] != null; int previous = closed ? (loop.length - 1) : 1; http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java index b99c9c2..095d6d5 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSet.java @@ -162,7 +162,7 @@ public class PolyhedronsSet extends AbstractRegion { final double tolerance) { if ((xMin >= xMax - tolerance) || (yMin >= yMax - tolerance) || (zMin >= zMax - tolerance)) { // too thin box, build an empty polygons set - return new BSPTree<>(Boolean.FALSE); + return new BSPTree(Boolean.FALSE); } final Plane pxMin = new Plane(new Vector3D(xMin, 0, 0), Vector3D.MINUS_I, tolerance); final Plane pxMax = new Plane(new Vector3D(xMax, 0, 0), Vector3D.PLUS_I, tolerance); @@ -226,7 +226,7 @@ public class PolyhedronsSet extends AbstractRegion { } } - final List> boundary = new ArrayList<>(); + final List> boundary = new ArrayList>(); for (final int[] facet : facets) { http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGenerator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGenerator.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGenerator.java index deef1e9..f28a762 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGenerator.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGenerator.java @@ -37,15 +37,15 @@ public class SphereGenerator implements SupportBallGenerator ballOnSupport(final List support) { if (support.size() < 1) { - return new EnclosingBall<>(Vector3D.ZERO, Double.NEGATIVE_INFINITY); + return new EnclosingBall(Vector3D.ZERO, Double.NEGATIVE_INFINITY); } else { final Vector3D vA = support.get(0); if (support.size() < 2) { - return new EnclosingBall<>(vA, 0, vA); + return new EnclosingBall(vA, 0, vA); } else { final Vector3D vB = support.get(1); if (support.size() < 3) { - return new EnclosingBall<>(new Vector3D(0.5, vA, 0.5, vB), + return new EnclosingBall(new Vector3D(0.5, vA, 0.5, vB), 0.5 * vA.distance(vB), vA, vB); } else { @@ -61,7 +61,7 @@ public class SphereGenerator implements SupportBallGenerator(p.toSpace(disk.getCenter()), + return new EnclosingBall(p.toSpace(disk.getCenter()), disk.getRadius(), vA, vB, vC); } else { @@ -118,7 +118,7 @@ public class SphereGenerator implements SupportBallGenerator(new Vector3D(centerX.doubleValue(), + return new EnclosingBall(new Vector3D(centerX.doubleValue(), centerY.doubleValue(), centerZ.doubleValue()), FastMath.sqrt(r2.doubleValue()), http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubLine.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubLine.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubLine.java index 61499d9..ae3dc4a 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubLine.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubLine.java @@ -85,7 +85,7 @@ public class SubLine { public List getSegments() { final List list = remainingRegion.asList(); - final List segments = new ArrayList<>(list.size()); + final List segments = new ArrayList(list.size()); for (final Interval interval : list) { final Vector3D start = line.toSpace((Point) new Vector1D(interval.getInf())); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubPlane.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubPlane.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubPlane.java index 0c89584..89885d4 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubPlane.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/threed/SubPlane.java @@ -67,11 +67,11 @@ public class SubPlane extends AbstractSubHyperplane { // the hyperplanes are parallel final double global = otherPlane.getOffset(thisPlane); if (global < -tolerance) { - return new SplitSubHyperplane<>(null, this); + return new SplitSubHyperplane(null, this); } else if (global > tolerance) { - return new SplitSubHyperplane<>(this, null); + return new SplitSubHyperplane(this, null); } else { - return new SplitSubHyperplane<>(null, null); + return new SplitSubHyperplane(null, null); } } @@ -92,15 +92,15 @@ public class SubPlane extends AbstractSubHyperplane { final BSPTree splitTree = getRemainingRegion().getTree(false).split(l2DMinus); final BSPTree plusTree = getRemainingRegion().isEmpty(splitTree.getPlus()) ? new BSPTree(Boolean.FALSE) : - new BSPTree<>(l2DPlus, new BSPTree(Boolean.FALSE), + new BSPTree(l2DPlus, new BSPTree(Boolean.FALSE), splitTree.getPlus(), null); final BSPTree minusTree = getRemainingRegion().isEmpty(splitTree.getMinus()) ? new BSPTree(Boolean.FALSE) : - new BSPTree<>(l2DMinus, new BSPTree(Boolean.FALSE), + new BSPTree(l2DMinus, new BSPTree(Boolean.FALSE), splitTree.getMinus(), null); - return new SplitSubHyperplane<>(new SubPlane(thisPlane.copySelf(), new PolygonsSet(plusTree, tolerance)), + return new SplitSubHyperplane(new SubPlane(thisPlane.copySelf(), new PolygonsSet(plusTree, tolerance)), new SubPlane(thisPlane.copySelf(), new PolygonsSet(minusTree, tolerance))); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGenerator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGenerator.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGenerator.java index a19a876..4cc3546 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGenerator.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGenerator.java @@ -33,15 +33,15 @@ public class DiskGenerator implements SupportBallGenerator ballOnSupport(final List support) { if (support.size() < 1) { - return new EnclosingBall<>(Vector2D.ZERO, Double.NEGATIVE_INFINITY); + return new EnclosingBall(Vector2D.ZERO, Double.NEGATIVE_INFINITY); } else { final Vector2D vA = support.get(0); if (support.size() < 2) { - return new EnclosingBall<>(vA, 0, vA); + return new EnclosingBall(vA, 0, vA); } else { final Vector2D vB = support.get(1); if (support.size() < 3) { - return new EnclosingBall<>(new Vector2D(0.5, vA, 0.5, vB), + return new EnclosingBall(new Vector2D(0.5, vA, 0.5, vB), 0.5 * vA.distance(vB), vA, vB); } else { @@ -86,7 +86,7 @@ public class DiskGenerator implements SupportBallGenerator(new Vector2D(centerX.doubleValue(), + return new EnclosingBall(new Vector2D(centerX.doubleValue(), centerY.doubleValue()), FastMath.sqrt(r2.doubleValue()), vA, vB, vC); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/NestedLoops.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/NestedLoops.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/NestedLoops.java index a967fb6..cb3a2be 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/NestedLoops.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/NestedLoops.java @@ -71,7 +71,7 @@ class NestedLoops { * @since 3.3 */ NestedLoops(final double tolerance) { - this.surrounded = new ArrayList<>(); + this.surrounded = new ArrayList(); this.tolerance = tolerance; } @@ -90,11 +90,11 @@ class NestedLoops { } this.loop = loop; - this.surrounded = new ArrayList<>(); + this.surrounded = new ArrayList(); this.tolerance = tolerance; // build the polygon defined by the loop - final ArrayList> edges = new ArrayList<>(); + final ArrayList> edges = new ArrayList>(); Vector2D current = loop[loop.length - 1]; for (int i = 0; i < loop.length; ++i) { final Vector2D previous = current; @@ -152,7 +152,7 @@ class NestedLoops { } // we should be separate from the remaining children - RegionFactory factory = new RegionFactory<>(); + RegionFactory factory = new RegionFactory(); for (final NestedLoops child : surrounded) { if (!factory.intersection(node.polygon, child.polygon).isEmpty()) { throw new MathIllegalArgumentException(LocalizedFormats.CROSSING_BOUNDARY_LOOPS); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSet.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSet.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSet.java index 38b94f4..6dcf2cd 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSet.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSet.java @@ -199,7 +199,7 @@ public class PolygonsSet extends AbstractRegion { final int n = vertices.length; if (n == 0) { // the tree represents the whole space - return new BSPTree<>(Boolean.TRUE); + return new BSPTree(Boolean.TRUE); } // build the vertices @@ -209,7 +209,7 @@ public class PolygonsSet extends AbstractRegion { } // build the edges - List edges = new ArrayList<>(n); + List edges = new ArrayList(n); for (int i = 0; i < n; ++i) { // get the endpoints of the edge @@ -238,7 +238,7 @@ public class PolygonsSet extends AbstractRegion { } // build the tree top-down - final BSPTree tree = new BSPTree<>(); + final BSPTree tree = new BSPTree(); insertEdges(hyperplaneThickness, tree, edges); return tree; @@ -287,8 +287,8 @@ public class PolygonsSet extends AbstractRegion { // we have split the node by inserting an edge as a cut sub-hyperplane // distribute the remaining edges in the two sub-trees - final List plusList = new ArrayList<>(); - final List minusList = new ArrayList<>(); + final List plusList = new ArrayList(); + final List minusList = new ArrayList(); for (final Edge edge : edges) { if (edge != inserted) { final double startOffset = inserted.getLine().getOffset((Point) edge.getStart().getLocation()); @@ -365,7 +365,7 @@ public class PolygonsSet extends AbstractRegion { this.location = location; this.incoming = null; this.outgoing = null; - this.lines = new ArrayList<>(); + this.lines = new ArrayList(); } /** Get Vertex location. @@ -640,7 +640,7 @@ public class PolygonsSet extends AbstractRegion { } // create the segment loops - final ArrayList> loops = new ArrayList<>(); + final ArrayList> loops = new ArrayList>(); for (ConnectableSegment s = getUnprocessed(segments); s != null; s = getUnprocessed(segments)) { final List loop = followLoop(s); if (loop != null) { @@ -824,7 +824,7 @@ public class PolygonsSet extends AbstractRegion { */ private List followLoop(final ConnectableSegment defining) { - final List loop = new ArrayList<>(); + final List loop = new ArrayList(); loop.add(defining); defining.setProcessed(true); @@ -998,7 +998,7 @@ public class PolygonsSet extends AbstractRegion { */ SegmentsBuilder(final double tolerance) { this.tolerance = tolerance; - this.segments = new ArrayList<>(); + this.segments = new ArrayList(); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/SubLine.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/SubLine.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/SubLine.java index eb24760..4f53e6c 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/SubLine.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/SubLine.java @@ -83,7 +83,7 @@ public class SubLine extends AbstractSubHyperplane { final Line line = (Line) getHyperplane(); final List list = ((IntervalsSet) getRemainingRegion()).asList(); - final List segments = new ArrayList<>(list.size()); + final List segments = new ArrayList(list.size()); for (final Interval interval : list) { final Vector2D start = line.toSpace((Point) new Vector1D(interval.getInf())); @@ -168,11 +168,11 @@ public class SubLine extends AbstractSubHyperplane { // the lines are parallel final double global = otherLine.getOffset(thisLine); if (global < -tolerance) { - return new SplitSubHyperplane<>(null, this); + return new SplitSubHyperplane(null, this); } else if (global > tolerance) { - return new SplitSubHyperplane<>(this, null); + return new SplitSubHyperplane(this, null); } else { - return new SplitSubHyperplane<>(null, null); + return new SplitSubHyperplane(null, null); } } @@ -187,13 +187,13 @@ public class SubLine extends AbstractSubHyperplane { final BSPTree splitTree = getRemainingRegion().getTree(false).split(subMinus); final BSPTree plusTree = getRemainingRegion().isEmpty(splitTree.getPlus()) ? new BSPTree(Boolean.FALSE) : - new BSPTree<>(subPlus, new BSPTree(Boolean.FALSE), + new BSPTree(subPlus, new BSPTree(Boolean.FALSE), splitTree.getPlus(), null); final BSPTree minusTree = getRemainingRegion().isEmpty(splitTree.getMinus()) ? new BSPTree(Boolean.FALSE) : - new BSPTree<>(subMinus, new BSPTree(Boolean.FALSE), + new BSPTree(subMinus, new BSPTree(Boolean.FALSE), splitTree.getMinus(), null); - return new SplitSubHyperplane<>(new SubLine(thisLine.copySelf(), new IntervalsSet(plusTree, tolerance)), + return new SplitSubHyperplane(new SubLine(thisLine.copySelf(), new IntervalsSet(plusTree, tolerance)), new SubLine(thisLine.copySelf(), new IntervalsSet(minusTree, tolerance))); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/AklToussaintHeuristic.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/AklToussaintHeuristic.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/AklToussaintHeuristic.java index 84be4ac..2388db0 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/AklToussaintHeuristic.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/AklToussaintHeuristic.java @@ -84,7 +84,7 @@ public final class AklToussaintHeuristic { return points; } - final List reducedPoints = new ArrayList<>(quadrilateral); + final List reducedPoints = new ArrayList(quadrilateral); for (final Vector2D p : points) { // check all points if they are within the quadrilateral // in which case they can not be part of the convex hull @@ -103,7 +103,7 @@ public final class AklToussaintHeuristic { * @return the quadrilateral */ private static List buildQuadrilateral(final Vector2D... points) { - List quadrilateral = new ArrayList<>(); + List quadrilateral = new ArrayList(); for (Vector2D p : points) { if (!quadrilateral.contains(p)) { quadrilateral.add(p); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHull2D.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHull2D.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHull2D.java index 7356da1..b973e13 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHull2D.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHull2D.java @@ -163,7 +163,7 @@ public class ConvexHull2D implements ConvexHull, Serializ if (vertices.length < 3) { throw new InsufficientDataException(); } - final RegionFactory factory = new RegionFactory<>(); + final RegionFactory factory = new RegionFactory(); final Segment[] segments = retrieveLineSegments(); final Line[] lineArray = new Line[segments.length]; for (int i = 0; i < segments.length; i++) { http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChain.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChain.java b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChain.java index 5746c7f..39caa99 100644 --- a/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChain.java +++ b/src/main/java/org/apache/commons/math4/geometry/euclidean/twod/hull/MonotoneChain.java @@ -77,7 +77,7 @@ public class MonotoneChain extends AbstractConvexHullGenerator2D { @Override public Collection findHullVertices(final Collection points) { - final List pointsSortedByXAxis = new ArrayList<>(points); + final List pointsSortedByXAxis = new ArrayList(points); // sort the points in increasing order on the x-axis Collections.sort(pointsSortedByXAxis, new Comparator() { @@ -97,13 +97,13 @@ public class MonotoneChain extends AbstractConvexHullGenerator2D { }); // build lower hull - final List lowerHull = new ArrayList<>(); + final List lowerHull = new ArrayList(); for (Vector2D p : pointsSortedByXAxis) { updateHull(p, lowerHull); } // build upper hull - final List upperHull = new ArrayList<>(); + final List upperHull = new ArrayList(); for (int idx = pointsSortedByXAxis.size() - 1; idx >= 0; idx--) { final Vector2D p = pointsSortedByXAxis.get(idx); updateHull(p, upperHull); @@ -111,7 +111,7 @@ public class MonotoneChain extends AbstractConvexHullGenerator2D { // concatenate the lower and upper hulls // the last point of each list is omitted as it is repeated at the beginning of the other list - final List hullVertices = new ArrayList<>(lowerHull.size() + upperHull.size() - 2); + final List hullVertices = new ArrayList(lowerHull.size() + upperHull.size() - 2); for (int idx = 0; idx < lowerHull.size() - 1; idx++) { hullVertices.add(lowerHull.get(idx)); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractRegion.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractRegion.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractRegion.java index 9463bb8..57d2c64 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractRegion.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractRegion.java @@ -53,7 +53,7 @@ public abstract class AbstractRegion implement * @param tolerance tolerance below which points are considered identical. */ protected AbstractRegion(final double tolerance) { - this.tree = new BSPTree<>(Boolean.TRUE); + this.tree = new BSPTree(Boolean.TRUE); this.tolerance = tolerance; } @@ -102,14 +102,14 @@ public abstract class AbstractRegion implement if (boundary.size() == 0) { // the tree represents the whole space - tree = new BSPTree<>(Boolean.TRUE); + tree = new BSPTree(Boolean.TRUE); } else { // sort the boundary elements in decreasing size order // (we don't want equal size elements to be removed, so // we use a trick to fool the TreeSet) - final TreeSet> ordered = new TreeSet<>(new Comparator>() { + final TreeSet> ordered = new TreeSet>(new Comparator>() { /** {@inheritDoc} */ @Override public int compare(final SubHyperplane o1, final SubHyperplane o2) { @@ -121,7 +121,7 @@ public abstract class AbstractRegion implement ordered.addAll(boundary); // build the tree top-down - tree = new BSPTree<>(); + tree = new BSPTree(); insertCuts(tree, ordered); // set up the inside/outside flags @@ -161,7 +161,7 @@ public abstract class AbstractRegion implement public AbstractRegion(final Hyperplane[] hyperplanes, final double tolerance) { this.tolerance = tolerance; if ((hyperplanes == null) || (hyperplanes.length == 0)) { - tree = new BSPTree<>(Boolean.FALSE); + tree = new BSPTree(Boolean.FALSE); } else { // use the first hyperplane to build the right class @@ -218,8 +218,8 @@ public abstract class AbstractRegion implement } // distribute the remaining edges in the two sub-trees - final ArrayList> plusList = new ArrayList<>(); - final ArrayList> minusList = new ArrayList<>(); + final ArrayList> plusList = new ArrayList>(); + final ArrayList> minusList = new ArrayList>(); while (iterator.hasNext()) { final SubHyperplane other = iterator.next(); final SubHyperplane.SplitSubHyperplane split = other.split(inserted); @@ -310,7 +310,7 @@ public abstract class AbstractRegion implement */ @Override public BoundaryProjection projectToBoundary(final Point point) { - final BoundaryProjector projector = new BoundaryProjector<>(point); + final BoundaryProjector projector = new BoundaryProjector(point); getTree(true).visit(projector); return projector.getProjection(); } @@ -376,7 +376,7 @@ public abstract class AbstractRegion implement /** {@inheritDoc} */ @Override public double getBoundarySize() { - final BoundarySizeVisitor visitor = new BoundarySizeVisitor<>(); + final BoundarySizeVisitor visitor = new BoundarySizeVisitor(); getTree(true).visit(visitor); return visitor.getSize(); } @@ -485,7 +485,7 @@ public abstract class AbstractRegion implement public AbstractRegion applyTransform(final Transform transform) { // transform the tree, except for boundary attribute splitters - final Map, BSPTree> map = new HashMap<>(); + final Map, BSPTree> map = new HashMap, BSPTree>(); final BSPTree transformedTree = recurseTransform(getTree(false), transform, map); // set up the boundary attributes splitters @@ -519,7 +519,7 @@ public abstract class AbstractRegion implement final BSPTree transformedNode; if (node.getCut() == null) { - transformedNode = new BSPTree<>(node.getAttribute()); + transformedNode = new BSPTree(node.getAttribute()); } else { final SubHyperplane sub = node.getCut(); @@ -531,10 +531,10 @@ public abstract class AbstractRegion implement final SubHyperplane tPI = (attribute.getPlusInside() == null) ? null : ((AbstractSubHyperplane) attribute.getPlusInside()).applyTransform(transform); // we start with an empty list of splitters, it will be filled in out of recursion - attribute = new BoundaryAttribute<>(tPO, tPI, new NodesSet()); + attribute = new BoundaryAttribute(tPO, tPI, new NodesSet()); } - transformedNode = new BSPTree<>(tSub, + transformedNode = new BSPTree(tSub, recurseTransform(node.getPlus(), transform, map), recurseTransform(node.getMinus(), transform, map), attribute); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractSubHyperplane.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractSubHyperplane.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractSubHyperplane.java index 275269e..76c925c 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractSubHyperplane.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/AbstractSubHyperplane.java @@ -116,7 +116,7 @@ public abstract class AbstractSubHyperplane final Hyperplane tHyperplane = transform.apply(hyperplane); // transform the tree, except for boundary attribute splitters - final Map, BSPTree> map = new HashMap<>(); + final Map, BSPTree> map = new HashMap, BSPTree>(); final BSPTree tTree = recurseTransform(remainingRegion.getTree(false), tHyperplane, transform, map); @@ -153,7 +153,7 @@ public abstract class AbstractSubHyperplane final BSPTree transformedNode; if (node.getCut() == null) { - transformedNode = new BSPTree<>(node.getAttribute()); + transformedNode = new BSPTree(node.getAttribute()); } else { @SuppressWarnings("unchecked") @@ -164,10 +164,10 @@ public abstract class AbstractSubHyperplane final SubHyperplane tPI = (attribute.getPlusInside() == null) ? null : transform.apply(attribute.getPlusInside(), hyperplane, transformed); // we start with an empty list of splitters, it will be filled in out of recursion - attribute = new BoundaryAttribute<>(tPO, tPI, new NodesSet()); + attribute = new BoundaryAttribute(tPO, tPI, new NodesSet()); } - transformedNode = new BSPTree<>(transform.apply(node.getCut(), hyperplane, transformed), + transformedNode = new BSPTree(transform.apply(node.getCut(), hyperplane, transformed), recurseTransform(node.getPlus(), transformed, transform, map), recurseTransform(node.getMinus(), transformed, transform, map), attribute); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/BSPTree.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/BSPTree.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/BSPTree.java index 0599d89..16548dd 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/BSPTree.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/BSPTree.java @@ -163,9 +163,9 @@ public class BSPTree { } cut = chopped; - plus = new BSPTree<>(); + plus = new BSPTree(); plus.parent = this; - minus = new BSPTree<>(); + minus = new BSPTree(); minus.parent = this; return true; @@ -181,10 +181,10 @@ public class BSPTree { public BSPTree copySelf() { if (cut == null) { - return new BSPTree<>(attribute); + return new BSPTree(attribute); } - return new BSPTree<>(cut.copySelf(), plus.copySelf(), minus.copySelf(), + return new BSPTree(cut.copySelf(), plus.copySelf(), minus.copySelf(), attribute); } @@ -340,7 +340,7 @@ public class BSPTree { * than maxOffset from the point) */ public List> getCloseCuts(final Point point, final double maxOffset) { - final List> close = new ArrayList<>(); + final List> close = new ArrayList>(); recurseCloseCuts(point, maxOffset, close); return close; } @@ -554,7 +554,7 @@ public class BSPTree { public BSPTree split(final SubHyperplane sub) { if (cut == null) { - return new BSPTree<>(sub, copySelf(), new BSPTree(attribute), null); + return new BSPTree(sub, copySelf(), new BSPTree(attribute), null); } final Hyperplane cHyperplane = cut.getHyperplane(); @@ -566,12 +566,12 @@ public class BSPTree { final BSPTree split = plus.split(sub); if (cut.split(sHyperplane).getSide() == Side.PLUS) { split.plus = - new BSPTree<>(cut.copySelf(), split.plus, minus.copySelf(), attribute); + new BSPTree(cut.copySelf(), split.plus, minus.copySelf(), attribute); split.plus.condense(); split.plus.parent = split; } else { split.minus = - new BSPTree<>(cut.copySelf(), split.minus, minus.copySelf(), attribute); + new BSPTree(cut.copySelf(), split.minus, minus.copySelf(), attribute); split.minus.condense(); split.minus.parent = split; } @@ -582,12 +582,12 @@ public class BSPTree { final BSPTree split = minus.split(sub); if (cut.split(sHyperplane).getSide() == Side.PLUS) { split.plus = - new BSPTree<>(cut.copySelf(), plus.copySelf(), split.plus, attribute); + new BSPTree(cut.copySelf(), plus.copySelf(), split.plus, attribute); split.plus.condense(); split.plus.parent = split; } else { split.minus = - new BSPTree<>(cut.copySelf(), plus.copySelf(), split.minus, attribute); + new BSPTree(cut.copySelf(), plus.copySelf(), split.minus, attribute); split.minus.condense(); split.minus.parent = split; } @@ -597,7 +597,7 @@ public class BSPTree { { final SubHyperplane.SplitSubHyperplane cutParts = cut.split(sHyperplane); final BSPTree split = - new BSPTree<>(sub, plus.split(subParts.getPlus()), minus.split(subParts.getMinus()), + new BSPTree(sub, plus.split(subParts.getPlus()), minus.split(subParts.getMinus()), null); split.plus.cut = cutParts.getPlus(); split.minus.cut = cutParts.getMinus(); @@ -612,8 +612,8 @@ public class BSPTree { } default : return cHyperplane.sameOrientationAs(sHyperplane) ? - new BSPTree<>(sub, plus.copySelf(), minus.copySelf(), attribute) : - new BSPTree<>(sub, minus.copySelf(), plus.copySelf(), attribute); + new BSPTree(sub, plus.copySelf(), minus.copySelf(), attribute) : + new BSPTree(sub, minus.copySelf(), plus.copySelf(), attribute); } } @@ -710,16 +710,16 @@ public class BSPTree { final Object internalAttributes) { // build the current cell leaf - BSPTree tree = new BSPTree<>(cellAttribute); + BSPTree tree = new BSPTree(cellAttribute); // build the pruned tree bottom-up for (BSPTree current = this; current.parent != null; current = current.parent) { final SubHyperplane parentCut = current.parent.cut.copySelf(); - final BSPTree sibling = new BSPTree<>(otherLeafsAttributes); + final BSPTree sibling = new BSPTree(otherLeafsAttributes); if (current == current.parent.plus) { - tree = new BSPTree<>(parentCut, tree, sibling, internalAttributes); + tree = new BSPTree(parentCut, tree, sibling, internalAttributes); } else { - tree = new BSPTree<>(parentCut, sibling, tree, internalAttributes); + tree = new BSPTree(parentCut, sibling, tree, internalAttributes); } } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryBuilder.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryBuilder.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryBuilder.java index a286235..2b35eb9 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryBuilder.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryBuilder.java @@ -44,18 +44,18 @@ class BoundaryBuilder implements BSPTreeVisitor { // characterize the cut sub-hyperplane, // first with respect to the plus sub-tree - final Characterization plusChar = new Characterization<>(node.getPlus(), node.getCut().copySelf()); + final Characterization plusChar = new Characterization(node.getPlus(), node.getCut().copySelf()); if (plusChar.touchOutside()) { // plusChar.outsideTouching() corresponds to a subset of the cut sub-hyperplane // known to have outside cells on its plus side, we want to check if parts // of this subset do have inside cells on their minus side - final Characterization minusChar = new Characterization<>(node.getMinus(), plusChar.outsideTouching()); + final Characterization minusChar = new Characterization(node.getMinus(), plusChar.outsideTouching()); if (minusChar.touchInside()) { // this part belongs to the boundary, // it has the outside on its plus side and the inside on its minus side plusOutside = minusChar.insideTouching(); - splitters = new NodesSet<>(); + splitters = new NodesSet(); splitters.addAll(minusChar.getInsideSplitters()); splitters.addAll(plusChar.getOutsideSplitters()); } @@ -65,13 +65,13 @@ class BoundaryBuilder implements BSPTreeVisitor { // plusChar.insideTouching() corresponds to a subset of the cut sub-hyperplane // known to have inside cells on its plus side, we want to check if parts // of this subset do have outside cells on their minus side - final Characterization minusChar = new Characterization<>(node.getMinus(), plusChar.insideTouching()); + final Characterization minusChar = new Characterization(node.getMinus(), plusChar.insideTouching()); if (minusChar.touchOutside()) { // this part belongs to the boundary, // it has the inside on its plus side and the outside on its minus side plusInside = minusChar.outsideTouching(); if (splitters == null) { - splitters = new NodesSet<>(); + splitters = new NodesSet(); } splitters.addAll(minusChar.getOutsideSplitters()); splitters.addAll(plusChar.getInsideSplitters()); @@ -86,7 +86,7 @@ class BoundaryBuilder implements BSPTreeVisitor { } // set the boundary attribute at non-leaf nodes - node.setAttribute(new BoundaryAttribute<>(plusOutside, plusInside, splitters)); + node.setAttribute(new BoundaryAttribute(plusOutside, plusInside, splitters)); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryProjector.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryProjector.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryProjector.java index 212f624..afb8884 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryProjector.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/BoundaryProjector.java @@ -130,7 +130,7 @@ class BoundaryProjector implements BSPTreeVisi // fix offset sign offset = FastMath.copySign(offset, (Boolean) leaf.getAttribute() ? -1 : +1); - return new BoundaryProjection<>(original, projected, offset); + return new BoundaryProjection(original, projected, offset); } @@ -140,7 +140,7 @@ class BoundaryProjector implements BSPTreeVisi */ private List> boundaryRegions(final BSPTree node) { - final List> regions = new ArrayList<>(2); + final List> regions = new ArrayList>(2); @SuppressWarnings("unchecked") final BoundaryAttribute ba = (BoundaryAttribute) node.getAttribute(); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/Characterization.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/Characterization.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/Characterization.java index 9eae358..69df9ad 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/Characterization.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/Characterization.java @@ -56,8 +56,8 @@ class Characterization { Characterization(final BSPTree node, final SubHyperplane sub) { outsideTouching = null; insideTouching = null; - outsideSplitters = new NodesSet<>(); - insideSplitters = new NodesSet<>(); + outsideSplitters = new NodesSet(); + insideSplitters = new NodesSet(); characterize(node, sub, new ArrayList>()); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/NodesSet.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/NodesSet.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/NodesSet.java index 1d55c5b..e7588e0 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/NodesSet.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/NodesSet.java @@ -35,7 +35,7 @@ public class NodesSet implements Iterable> { /** Simple constructor. */ public NodesSet() { - list = new ArrayList<>(); + list = new ArrayList>(); } /** Add a node if not already known. http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java b/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java index 3b0e795..6d49939 100644 --- a/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java +++ b/src/main/java/org/apache/commons/math4/geometry/partitioning/RegionFactory.java @@ -176,7 +176,7 @@ public class RegionFactory { private BSPTree recurseComplement(final BSPTree node) { // transform the tree, except for boundary attribute splitters - final Map, BSPTree> map = new HashMap<>(); + final Map, BSPTree> map = new HashMap, BSPTree>(); final BSPTree transformedTree = recurseComplement(node, map); // set up the boundary attributes splitters @@ -208,7 +208,7 @@ public class RegionFactory { final BSPTree transformedNode; if (node.getCut() == null) { - transformedNode = new BSPTree<>(((Boolean) node.getAttribute()) ? Boolean.FALSE : Boolean.TRUE); + transformedNode = new BSPTree(((Boolean) node.getAttribute()) ? Boolean.FALSE : Boolean.TRUE); } else { @SuppressWarnings("unchecked") @@ -219,10 +219,10 @@ public class RegionFactory { final SubHyperplane plusInside = (attribute.getPlusOutside() == null) ? null : attribute.getPlusOutside().copySelf(); // we start with an empty list of splitters, it will be filled in out of recursion - attribute = new BoundaryAttribute<>(plusOutside, plusInside, new NodesSet()); + attribute = new BoundaryAttribute(plusOutside, plusInside, new NodesSet()); } - transformedNode = new BSPTree<>(node.getCut().copySelf(), + transformedNode = new BSPTree(node.getCut().copySelf(), recurseComplement(node.getPlus(), map), recurseComplement(node.getMinus(), map), attribute); @@ -330,7 +330,7 @@ public class RegionFactory { final BSPTree cell = node.pruneAroundConvexCell(Boolean.TRUE, Boolean.FALSE, null); final Region r = region1.buildNew(cell); final Point p = r.getBarycenter(); - return new BSPTree<>(region1.checkPoint(p) == Location.INSIDE && + return new BSPTree(region1.checkPoint(p) == Location.INSIDE && region2.checkPoint(p) == Location.OUTSIDE); } @@ -376,10 +376,10 @@ public class RegionFactory { public BSPTree fixNode(final BSPTree node) { if (node.getPlus().getAttribute().equals(node.getMinus().getAttribute())) { // no ambiguity - return new BSPTree<>(node.getPlus().getAttribute()); + return new BSPTree(node.getPlus().getAttribute()); } else { // ambiguous node - return new BSPTree<>(inside); + return new BSPTree(inside); } } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSet.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSet.java b/src/main/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSet.java index bc1e390..1436ce2 100644 --- a/src/main/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSet.java +++ b/src/main/java/org/apache/commons/math4/geometry/spherical/oned/ArcsSet.java @@ -132,7 +132,7 @@ public class ArcsSet extends AbstractRegion implements Itera if (Precision.equals(lower, upper, 0) || (upper - lower) >= MathUtils.TWO_PI) { // the tree must cover the whole circle - return new BSPTree<>(Boolean.TRUE); + return new BSPTree(Boolean.TRUE); } else if (lower > upper) { throw new NumberIsTooLargeException(LocalizedFormats.ENDPOINTS_NOT_AN_INTERVAL, lower, upper, true); @@ -148,9 +148,9 @@ public class ArcsSet extends AbstractRegion implements Itera // simple arc starting after 0 and ending before 2 \pi final SubHyperplane upperCut = new LimitAngle(new S1Point(normalizedUpper), true, tolerance).wholeHyperplane(); - return new BSPTree<>(lowerCut, + return new BSPTree(lowerCut, new BSPTree(Boolean.FALSE), - new BSPTree<>(upperCut, + new BSPTree(upperCut, new BSPTree(Boolean.FALSE), new BSPTree(Boolean.TRUE), null), @@ -159,8 +159,8 @@ public class ArcsSet extends AbstractRegion implements Itera // arc wrapping around 2 \pi final SubHyperplane upperCut = new LimitAngle(new S1Point(normalizedUpper - MathUtils.TWO_PI), true, tolerance).wholeHyperplane(); - return new BSPTree<>(lowerCut, - new BSPTree<>(upperCut, + return new BSPTree(lowerCut, + new BSPTree(upperCut, new BSPTree(Boolean.FALSE), new BSPTree(Boolean.TRUE), null), @@ -504,9 +504,9 @@ public class ArcsSet extends AbstractRegion implements Itera final double previousOffset = alpha - previous; final double currentOffset = a[0] - alpha; if (previousOffset < currentOffset) { - return new BoundaryProjection<>(point, new S1Point(previous), previousOffset); + return new BoundaryProjection(point, new S1Point(previous), previousOffset); } else { - return new BoundaryProjection<>(point, new S1Point(a[0]), currentOffset); + return new BoundaryProjection(point, new S1Point(a[0]), currentOffset); } } } else if (alpha <= a[1]) { @@ -515,9 +515,9 @@ public class ArcsSet extends AbstractRegion implements Itera final double offset0 = a[0] - alpha; final double offset1 = alpha - a[1]; if (offset0 < offset1) { - return new BoundaryProjection<>(point, new S1Point(a[1]), offset1); + return new BoundaryProjection(point, new S1Point(a[1]), offset1); } else { - return new BoundaryProjection<>(point, new S1Point(a[0]), offset0); + return new BoundaryProjection(point, new S1Point(a[0]), offset0); } } } @@ -527,7 +527,7 @@ public class ArcsSet extends AbstractRegion implements Itera if (Double.isNaN(previous)) { // there are no points at all in the arcs set - return new BoundaryProjection<>(point, null, MathUtils.TWO_PI); + return new BoundaryProjection(point, null, MathUtils.TWO_PI); } else { @@ -538,18 +538,18 @@ public class ArcsSet extends AbstractRegion implements Itera final double previousOffset = alpha - (previous - MathUtils.TWO_PI); final double currentOffset = first - alpha; if (previousOffset < currentOffset) { - return new BoundaryProjection<>(point, new S1Point(previous), previousOffset); + return new BoundaryProjection(point, new S1Point(previous), previousOffset); } else { - return new BoundaryProjection<>(point, new S1Point(first), currentOffset); + return new BoundaryProjection(point, new S1Point(first), currentOffset); } } else { // the test point is between last and 2\pi final double previousOffset = alpha - previous; final double currentOffset = first + MathUtils.TWO_PI - alpha; if (previousOffset < currentOffset) { - return new BoundaryProjection<>(point, new S1Point(previous), previousOffset); + return new BoundaryProjection(point, new S1Point(previous), previousOffset); } else { - return new BoundaryProjection<>(point, new S1Point(first), currentOffset); + return new BoundaryProjection(point, new S1Point(first), currentOffset); } } @@ -565,7 +565,7 @@ public class ArcsSet extends AbstractRegion implements Itera * @return a new ordered list containing {@link Arc Arc} elements */ public List asList() { - final List list = new ArrayList<>(); + final List list = new ArrayList(); for (final double[] a : this) { list.add(new Arc(a[0], a[1], getTolerance())); } @@ -724,8 +724,8 @@ public class ArcsSet extends AbstractRegion implements Itera */ public Split split(final Arc arc) { - final List minus = new ArrayList<>(); - final List plus = new ArrayList<>(); + final List minus = new ArrayList(); + final List plus = new ArrayList(); final double reference = FastMath.PI + arc.getInf(); final double arcLength = arc.getSup() - arc.getInf(); @@ -861,7 +861,7 @@ public class ArcsSet extends AbstractRegion implements Itera } // build the tree by adding all angular sectors - BSPTree tree = new BSPTree<>(Boolean.FALSE); + BSPTree tree = new BSPTree(Boolean.FALSE); for (int i = 0; i < limits.size() - 1; i += 2) { addArcLimit(tree, limits.get(i), true); addArcLimit(tree, limits.get(i + 1), false); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/spherical/oned/SubLimitAngle.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/spherical/oned/SubLimitAngle.java b/src/main/java/org/apache/commons/math4/geometry/spherical/oned/SubLimitAngle.java index 37a6de8..31f79fd 100644 --- a/src/main/java/org/apache/commons/math4/geometry/spherical/oned/SubLimitAngle.java +++ b/src/main/java/org/apache/commons/math4/geometry/spherical/oned/SubLimitAngle.java @@ -59,8 +59,8 @@ public class SubLimitAngle extends AbstractSubHyperplane { public SplitSubHyperplane split(final Hyperplane hyperplane) { final double global = hyperplane.getOffset(((LimitAngle) getHyperplane()).getLocation()); return (global < -1.0e-10) ? - new SplitSubHyperplane<>(null, this) : - new SplitSubHyperplane<>(this, null); + new SplitSubHyperplane(null, this) : + new SplitSubHyperplane(this, null); } } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/spherical/twod/EdgesBuilder.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/spherical/twod/EdgesBuilder.java b/src/main/java/org/apache/commons/math4/geometry/spherical/twod/EdgesBuilder.java index 86f12c6..002d42c 100644 --- a/src/main/java/org/apache/commons/math4/geometry/spherical/twod/EdgesBuilder.java +++ b/src/main/java/org/apache/commons/math4/geometry/spherical/twod/EdgesBuilder.java @@ -55,8 +55,8 @@ class EdgesBuilder implements BSPTreeVisitor { EdgesBuilder(final BSPTree root, final double tolerance) { this.root = root; this.tolerance = tolerance; - this.edgeToNode = new IdentityHashMap<>(); - this.nodeToEdgesList = new IdentityHashMap<>(); + this.edgeToNode = new IdentityHashMap>(); + this.nodeToEdgesList = new IdentityHashMap, List>(); } /** {@inheritDoc} */ @@ -165,7 +165,7 @@ class EdgesBuilder implements BSPTreeVisitor { previous.setNextEdge(getFollowingEdge(previous)); } - return new ArrayList<>(edgeToNode.keySet()); + return new ArrayList(edgeToNode.keySet()); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/main/java/org/apache/commons/math4/geometry/spherical/twod/PropertiesComputer.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math4/geometry/spherical/twod/PropertiesComputer.java b/src/main/java/org/apache/commons/math4/geometry/spherical/twod/PropertiesComputer.java index b7bcbf0..eadc223 100644 --- a/src/main/java/org/apache/commons/math4/geometry/spherical/twod/PropertiesComputer.java +++ b/src/main/java/org/apache/commons/math4/geometry/spherical/twod/PropertiesComputer.java @@ -50,7 +50,7 @@ class PropertiesComputer implements BSPTreeVisitor { this.tolerance = tolerance; this.summedArea = 0; this.summedBarycenter = Vector3D.ZERO; - this.convexCellsInsidePoints = new ArrayList<>(); + this.convexCellsInsidePoints = new ArrayList(); } /** {@inheritDoc} */