@Test public void testEquals() { VectorN vec1 = VectorN.from(5, 0, -2); VectorN vec2 = VectorN.from(5, 0, -2); Boolean result = vec1.equals(vec2); assertTrue(result); vec1 = VectorN.from(3.1f, 1.4, -0.1); vec2 = VectorN.from(3.1f, 1.4, -0.1); result = vec1.equals(vec2); assertTrue(result); vec1 = VectorN.from(3.1f, 1.4, 0); vec2 = VectorN.from(3.1f, 1.3, 0); result = vec1.equals(vec2); assertTrue(!result); EqualsVerifier.forClass(VectorN.class) .suppress(Warning.NONFINAL_FIELDS) .verify(); }
public static VectorN from(final double... data) { if (data == null) { return VectorN.empty(); } return new VectorN(data); }
VectorN extends AVectorN { public static VectorN from(final double... data) { if (data == null) { return VectorN.empty(); } return new VectorN(data); } }
VectorN extends AVectorN { public static VectorN from(final double... data) { if (data == null) { return VectorN.empty(); } return new VectorN(data); } private  VectorN(final int dim); private  VectorN(final double... data); private  VectorN(final IVector vector); }
VectorN extends AVectorN { public static VectorN from(final double... data) { if (data == null) { return VectorN.empty(); } return new VectorN(data); } private  VectorN(final int dim); private  VectorN(final double... data); private  VectorN(final IVector vector); static VectorN zero(final int dim); static VectorN empty(); static VectorN from(final double... data); static VectorN copy(final IVector vector); static VectorN fromReal(final RealVector rv); void set(final int i, final double value); VectorN add(final IVector vector); VectorN subtract(final IVector vector); VectorN multiply(final double factor); VectorN apply(final Function<Double, Double> function); @Override double x(); @Override double y(); @Override double get(final int i); @Override int getNumDimensions(); }
VectorN extends AVectorN { public static VectorN from(final double... data) { if (data == null) { return VectorN.empty(); } return new VectorN(data); } private  VectorN(final int dim); private  VectorN(final double... data); private  VectorN(final IVector vector); static VectorN zero(final int dim); static VectorN empty(); static VectorN from(final double... data); static VectorN copy(final IVector vector); static VectorN fromReal(final RealVector rv); void set(final int i, final double value); VectorN add(final IVector vector); VectorN subtract(final IVector vector); VectorN multiply(final double factor); VectorN apply(final Function<Double, Double> function); @Override double x(); @Override double y(); @Override double get(final int i); @Override int getNumDimensions();  }