Package mikera.matrixx

Examples of mikera.matrixx.AMatrix.elementSum()


    startTimer();
   
    AMatrix t=Matrixx.createRandomMatrix(SIZE, CSIZE);
    printTime("Construct dense matrix: ");
   
    System.out.println("Dense element sum = "+t.elementSum());

    // Finally compute the innerProduct (matrix multiplication) of
    // sparse matrix with dense matrix
   
    startTimer();
View Full Code Here


   
    AMatrix result=m.innerProduct(t);
   
    printTime("Multiply with dense matrix: ");
   
    System.out.println("Result element sum = "+result.elementSum());
    // if this demo is working, the element sum should be roughly the same before and after transformation
    // (modulo some small numerical errors)

        // ----------------------------------------------------------------------
    // Construct another (smaller) sparse matrix.
View Full Code Here

    AMatrix m=Matrixx.createSparse(2000000,2000000);
    m.set(3,4,7.0);
   
    AMatrix r=m.innerProduct(m.getTranspose());
    assertEquals(49.0,r.get(3,3),0.0);
    assertEquals(49.0,r.elementSum(),0.0);
  }
 
  @Test public void testSparseAdd() {
    AMatrix m=Matrixx.createSparse(20000,20000);
    m.add(ZeroMatrix.create(20000, 20000));
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.