Package mikera.matrixx

Examples of mikera.matrixx.AMatrix.nonZeroCount()


  public static void main(String[] args) {
    SparseRowMatrix sm=createMatrix();
    System.out.println(sm.nonZeroCount() +" elements are non-zero out of " + sm.elementCount()+" total elements");
   
    AMatrix smm=sm.innerProduct(sm);
    System.out.println(smm.nonZeroCount() +" elements are non-zero in the product.");
  }

}
View Full Code Here


    AMatrix m=ZeroMatrix.create(2000000, 2000000);
    m=m.sparseClone();
    assertTrue("Not fully sparse:" +m.getClass(), m.isFullyMutable());
    m.set(3,4,7.0);
 
    assertEquals(1,m.nonZeroCount());
  }
 
  @Test public void testBigIdentity() {
    AMatrix m=IdentityMatrix.create(2000000);
    m=m.sparse();
View Full Code Here

  @Test public void testBigIdentity() {
    AMatrix m=IdentityMatrix.create(2000000);
    m=m.sparse();
   
    assertEquals(m,m.innerProduct(m));
    assertEquals(m.rowCount(),m.nonZeroCount());
  }
 
 
  @Test public void testSparseSet() {
    SparseRowMatrix m=SparseRowMatrix.create(300, 300);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.