Unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1197468 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
68d4f832e3
commit
b6040640af
|
@ -234,7 +234,7 @@ public class IntervalsSet extends AbstractRegion<Euclidean1D, Euclidean1D> {
|
|||
if ((checkPoint(low, loc) == Location.INSIDE) &&
|
||||
(checkPoint(high, loc) == Location.INSIDE)) {
|
||||
// merge the last interval added and the first one of the high sub-tree
|
||||
x = ((Interval) list.remove(list.size() - 1)).getLower();
|
||||
x = list.remove(list.size() - 1).getLower();
|
||||
}
|
||||
recurseList(high, list, x, upper);
|
||||
|
||||
|
|
|
@ -199,13 +199,13 @@ public class OutlineExtractor {
|
|||
for (Vector2D[] loop : vertices) {
|
||||
final boolean closed = loop[0] != null;
|
||||
int previous = closed ? (loop.length - 1) : 1;
|
||||
Vector3D previous3D = (Vector3D) plane.toSpace(loop[previous]);
|
||||
Vector3D previous3D = plane.toSpace(loop[previous]);
|
||||
int current = (previous + 1) % loop.length;
|
||||
Vector2D pPoint = new Vector2D(previous3D.dotProduct(u),
|
||||
previous3D.dotProduct(v));
|
||||
while (current < loop.length) {
|
||||
|
||||
final Vector3D current3D = (Vector3D) plane.toSpace(loop[current]);
|
||||
final Vector3D current3D = plane.toSpace(loop[current]);
|
||||
final Vector2D cPoint = new Vector2D(current3D.dotProduct(u),
|
||||
current3D.dotProduct(v));
|
||||
final org.apache.commons.math.geometry.euclidean.twod.Line line =
|
||||
|
|
|
@ -308,7 +308,7 @@ public class Plane implements Hyperplane<Euclidean3D>, Embedding<Euclidean3D, Eu
|
|||
if (FastMath.abs(dot) < 1.0e-10) {
|
||||
return null;
|
||||
}
|
||||
final Vector3D point = (Vector3D) line.toSpace(Vector1D.ZERO);
|
||||
final Vector3D point = line.toSpace(Vector1D.ZERO);
|
||||
final double k = -(originOffset + w.dotProduct(point)) / dot;
|
||||
return new Vector3D(1.0, point, k, direction);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class SubPlane extends AbstractSubHyperplane<Euclidean3D, Euclidean2D> {
|
|||
|
||||
final Plane otherPlane = (Plane) hyperplane;
|
||||
final Plane thisPlane = (Plane) getHyperplane();
|
||||
final Line inter = (Line) otherPlane.intersection(thisPlane);
|
||||
final Line inter = otherPlane.intersection(thisPlane);
|
||||
|
||||
if (inter == null) {
|
||||
// the hyperplanes are parallel,
|
||||
|
@ -98,7 +98,7 @@ public class SubPlane extends AbstractSubHyperplane<Euclidean3D, Euclidean2D> {
|
|||
|
||||
final Plane otherPlane = (Plane) hyperplane;
|
||||
final Plane thisPlane = (Plane) getHyperplane();
|
||||
final Line inter = (Line) otherPlane.intersection(thisPlane);
|
||||
final Line inter = otherPlane.intersection(thisPlane);
|
||||
|
||||
if (inter == null) {
|
||||
// the hyperplanes are parallel
|
||||
|
|
|
@ -164,7 +164,7 @@ public class SubLine extends AbstractSubHyperplane<Euclidean2D, Euclidean1D> {
|
|||
|
||||
// the lines do intersect
|
||||
final boolean direct = FastMath.sin(thisLine.getAngle() - otherLine.getAngle()) < 0;
|
||||
final Vector1D x = (Vector1D) thisLine.toSubSpace(crossing);
|
||||
final Vector1D x = thisLine.toSubSpace(crossing);
|
||||
return getRemainingRegion().side(new OrientedPoint(x, direct));
|
||||
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ public class SubLine extends AbstractSubHyperplane<Euclidean2D, Euclidean1D> {
|
|||
|
||||
// the lines do intersect
|
||||
final boolean direct = FastMath.sin(thisLine.getAngle() - otherLine.getAngle()) < 0;
|
||||
final Vector1D x = (Vector1D) thisLine.toSubSpace(crossing);
|
||||
final Vector1D x = thisLine.toSubSpace(crossing);
|
||||
final SubHyperplane<Euclidean1D> subPlus = new OrientedPoint(x, !direct).wholeHyperplane();
|
||||
final SubHyperplane<Euclidean1D> subMinus = new OrientedPoint(x, direct).wholeHyperplane();
|
||||
|
||||
|
|
|
@ -605,7 +605,7 @@ public abstract class AbstractRegion<S extends Space, T extends Space> implement
|
|||
* transform to the instance
|
||||
*/
|
||||
public AbstractRegion<S, T> applyTransform(final Transform<S, T> transform) {
|
||||
return (AbstractRegion<S, T>) buildNew(recurseTransform(getTree(false), transform));
|
||||
return buildNew(recurseTransform(getTree(false), transform));
|
||||
}
|
||||
|
||||
/** Recursively transform an inside/outside BSP-tree.
|
||||
|
|
|
@ -956,7 +956,7 @@ public class ArrayRealVectorTest {
|
|||
Assert.assertEquals("compare values ", v1.subtract(v2).getNorm(),dist_2, normTolerance);
|
||||
|
||||
//octave = sqrt(sumsq(v1-v2))
|
||||
double dist_3 = v1.getDistance((RealVector) v2);
|
||||
double dist_3 = v1.getDistance(v2);
|
||||
Assert.assertEquals("compare values ", v1.subtract(v2).getNorm(),dist_3, normTolerance);
|
||||
|
||||
//octave = ???
|
||||
|
@ -966,7 +966,7 @@ public class ArrayRealVectorTest {
|
|||
double d_getL1Distance_2 = v1.getL1Distance(v2_t);
|
||||
Assert.assertEquals("compare values ", 9d, d_getL1Distance_2, normTolerance);
|
||||
|
||||
double d_getL1Distance_3 = v1.getL1Distance((RealVector) v2);
|
||||
double d_getL1Distance_3 = v1.getL1Distance(v2);
|
||||
Assert.assertEquals("compare values ", 9d, d_getL1Distance_3, normTolerance);
|
||||
|
||||
//octave = ???
|
||||
|
@ -976,7 +976,7 @@ public class ArrayRealVectorTest {
|
|||
double d_getLInfDistance_2 = v1. getLInfDistance(v2_t);
|
||||
Assert.assertEquals("compare values ", 3d, d_getLInfDistance_2, normTolerance);
|
||||
|
||||
double d_getLInfDistance_3 = v1. getLInfDistance((RealVector) v2);
|
||||
double d_getLInfDistance_3 = v1. getLInfDistance(v2);
|
||||
Assert.assertEquals("compare values ", 3d, d_getLInfDistance_3, normTolerance);
|
||||
|
||||
//octave = v1 + v2
|
||||
|
@ -1007,7 +1007,7 @@ public class ArrayRealVectorTest {
|
|||
double[] result_ebeMultiply_2 = {4d, 10d, 18d};
|
||||
assertClose("compare vect" ,v_ebeMultiply_2.toArray(),result_ebeMultiply_2,normTolerance);
|
||||
|
||||
RealVector v_ebeMultiply_3 = v1.ebeMultiply((RealVector) v2);
|
||||
RealVector v_ebeMultiply_3 = v1.ebeMultiply(v2);
|
||||
double[] result_ebeMultiply_3 = {4d, 10d, 18d};
|
||||
assertClose("compare vect" ,v_ebeMultiply_3.toArray(),result_ebeMultiply_3,normTolerance);
|
||||
|
||||
|
@ -1020,7 +1020,7 @@ public class ArrayRealVectorTest {
|
|||
double[] result_ebeDivide_2 = {0.25d, 0.4d, 0.5d};
|
||||
assertClose("compare vect" ,v_ebeDivide_2.toArray(),result_ebeDivide_2,normTolerance);
|
||||
|
||||
RealVector v_ebeDivide_3 = v1.ebeDivide((RealVector) v2);
|
||||
RealVector v_ebeDivide_3 = v1.ebeDivide(v2);
|
||||
double[] result_ebeDivide_3 = {0.25d, 0.4d, 0.5d};
|
||||
assertClose("compare vect" ,v_ebeDivide_3.toArray(),result_ebeDivide_3,normTolerance);
|
||||
|
||||
|
@ -1038,7 +1038,7 @@ public class ArrayRealVectorTest {
|
|||
RealMatrix m_outerProduct_2 = v1.outerProduct(v2_t);
|
||||
Assert.assertEquals("compare val ",4d, m_outerProduct_2.getEntry(0,0), normTolerance);
|
||||
|
||||
RealMatrix m_outerProduct_3 = v1.outerProduct((RealVector) v2);
|
||||
RealMatrix m_outerProduct_3 = v1.outerProduct(v2);
|
||||
Assert.assertEquals("compare val ",4d, m_outerProduct_3.getEntry(0,0), normTolerance);
|
||||
|
||||
RealVector v_unitVector = v1.unitVector();
|
||||
|
|
|
@ -105,7 +105,7 @@ public final class EmpiricalDistributionTest {
|
|||
Assert.assertEquals(empiricalDistribution2.getSampleStats().getStandardDeviation(),
|
||||
1.0173699343977738,10E-7);
|
||||
|
||||
double[] bounds = ((EmpiricalDistributionImpl) empiricalDistribution2).getGeneratorUpperBounds();
|
||||
double[] bounds = empiricalDistribution2.getGeneratorUpperBounds();
|
||||
Assert.assertEquals(bounds.length, 100);
|
||||
Assert.assertEquals(bounds[99], 1.0, 10e-12);
|
||||
|
||||
|
|
Loading…
Reference in New Issue