@Test
  public void testNonZeroCount() {
    AVector v = Vectorz.createUniformRandomVector(5);
    v.add(1);
    assertEquals(v.length(), v.nonZeroCount());

    v.scale(0.0);
    assertEquals(0, v.nonZeroCount());
  }
Exemple #2
0
 @Override
 public long nonZeroCount() {
   return vector.nonZeroCount();
 }