@Test public void testLike() { RealVector of = Vectors.of(1.0, -2.0, 7.0); RealVector like = Vectors.like(of); assertEquals(of.getDimension(), like.getDimension()); assertEquals(0.0, like.getEntry(0)); assertSame(of.getClass(), like.getClass()); }
public static RealVector like(RealVector vector) { int dimension = vector.getDimension(); return vector instanceof SparseRealVector ? sparse(dimension) : dense(dimension); }
Vectors { public static RealVector like(RealVector vector) { int dimension = vector.getDimension(); return vector instanceof SparseRealVector ? sparse(dimension) : dense(dimension); } }
Vectors { public static RealVector like(RealVector vector) { int dimension = vector.getDimension(); return vector instanceof SparseRealVector ? sparse(dimension) : dense(dimension); } private  Vectors(); }
Vectors { public static RealVector like(RealVector vector) { int dimension = vector.getDimension(); return vector instanceof SparseRealVector ? sparse(dimension) : dense(dimension); } private  Vectors(); static RealVector of(double... values); static RealVector dense(int dimension); static SparseRealVector sparse(int dimension); static SparseRealVector sparse(int dimension, int expectedSize); static RealVector like(RealVector vector); }
Vectors { public static RealVector like(RealVector vector) { int dimension = vector.getDimension(); return vector instanceof SparseRealVector ? sparse(dimension) : dense(dimension); } private  Vectors(); static RealVector of(double... values); static RealVector dense(int dimension); static SparseRealVector sparse(int dimension); static SparseRealVector sparse(int dimension, int expectedSize); static RealVector like(RealVector vector);  }