}
@Test
public void testVectorAdd() {
// The default value should be 0
FloatDenseVector vec1 = new FloatDenseVector(10);
assertEquals(0.0, vec1.get(0), E);
// Basic get/set
vec1.set(0, 0.1f);
vec1.set(6, 1.4f);
assertEquals(0.1, vec1.get(0), E);
assertEquals(0.0, vec1.get(4), E);
assertEquals(1.4, vec1.get(6), E);
assertEquals(0.0, vec1.get(15), E);
// Add another vector
FloatDenseVector vec2 = new FloatDenseVector(20);
vec2.set(0, 0.5f);
vec2.set(5, 1.7f);
vec1.add(vec2);
assertEquals(0.6, vec1.get(0), E);
assertEquals(1.7, vec1.get(5), E);
assertEquals(1.4, vec1.get(6), E);