@Test @Repeat(iterations = 10) public void testCreation() { Vector vec = randomVector(); double[] entries = new double[vec.getNumNondefaultElements()]; int index = 0; for (Vector.Element e : vec) { entries[index] = e.get(); index++; } Vector result = Vectors.newSequentialAccessSparseVector(entries); assertEquals("Original vector should have same length as the one created from its entries.", vec.norm(2), result.norm(2), 0.0001); }
public static SequentialAccessSparseVector newSequentialAccessSparseVector(double... ds) { SequentialAccessSparseVector result = new SequentialAccessSparseVector(ds.length); for (int i = 0; i < ds.length; i++) { result.setQuick(i, ds[i]); } return result; }
Vectors { public static SequentialAccessSparseVector newSequentialAccessSparseVector(double... ds) { SequentialAccessSparseVector result = new SequentialAccessSparseVector(ds.length); for (int i = 0; i < ds.length; i++) { result.setQuick(i, ds[i]); } return result; } }
Vectors { public static SequentialAccessSparseVector newSequentialAccessSparseVector(double... ds) { SequentialAccessSparseVector result = new SequentialAccessSparseVector(ds.length); for (int i = 0; i < ds.length; i++) { result.setQuick(i, ds[i]); } return result; }  }
Vectors { public static SequentialAccessSparseVector newSequentialAccessSparseVector(double... ds) { SequentialAccessSparseVector result = new SequentialAccessSparseVector(ds.length); for (int i = 0; i < ds.length; i++) { result.setQuick(i, ds[i]); } return result; }  static Vector append(Vector... vectors); static SequentialAccessSparseVector newSequentialAccessSparseVector(double... ds); }
Vectors { public static SequentialAccessSparseVector newSequentialAccessSparseVector(double... ds) { SequentialAccessSparseVector result = new SequentialAccessSparseVector(ds.length); for (int i = 0; i < ds.length; i++) { result.setQuick(i, ds[i]); } return result; }  static Vector append(Vector... vectors); static SequentialAccessSparseVector newSequentialAccessSparseVector(double... ds);  }