Package mikera.matrixx.impl

Examples of mikera.matrixx.impl.VectorMatrixMN


    }
  }

  @Test
  public void testBasicDeterminant() {
    VectorMatrixMN mmn = new VectorMatrixMN(2, 2);
    mmn.getRow(0).set(Vector.of(2, 1));
    mmn.getRow(1).set(Vector.of(1, 2));
    assertEquals(3.0, mmn.determinant(), 0.0);
  }
View Full Code Here


    assertEquals(3.0, mmn.determinant(), 0.0);
  }

  @Test
  public void testPermuteDeterminant() {
    VectorMatrixMN mmn = new VectorMatrixMN(3, 3);
    mmn.set(0, 1, 1);
    mmn.set(1, 0, 1);
    mmn.set(2, 2, 1);
    assertEquals(-1.0, mmn.determinant(), 0.0);
  }
View Full Code Here

    for (int i = 0; i < 3; i++)
      for (int j = 0; j < 3; j++) {
        m33.set(i, j, Math.random());
      }

    VectorMatrixMN mmn = new VectorMatrixMN(3, 3);
    mmn.set(m33);

    for (int i = 0; i < 3; i++)
      for (int j = 0; j < 3; j++) {
        assertEquals(m33.get(i, j), mmn.get(i, j), 0.0);
      }

    assertEquals(m33.determinant(), mmn.determinant(), 0.00001);

  }
View Full Code Here

    doGenericTests(m11);
  }
 
  @Test public void g_PermutedMatrix() {
    // general M*N matrix
    VectorMatrixMN mmn=new VectorMatrixMN(6 ,7);

    // permuted matrix
    PermutedMatrix pmm=new PermutedMatrix(mmn,
        Indexz.createRandomPermutation(mmn.rowCount()),
        Indexz.createRandomPermutation(mmn.columnCount()));
    doGenericTests(pmm);
    doGenericTests(pmm.subMatrix(1, 4, 1, 5));
   
 
View Full Code Here

    Arrayz.fillNormal(mm3,101);
    doGenericTests(mm3);
    doGenericTests(mm3.subMatrix(1, 1, 1, 1));
 
    // general M*N matrix
    VectorMatrixMN mmn=new VectorMatrixMN(6 ,7);
    randomise(mmn);
    doGenericTests(mmn);
    doGenericTests(mmn.subMatrix(1, 4, 1, 5));
 
    // small 2*2 matrix
    mmn=new VectorMatrixMN(2,2);
    doGenericTests(mmn);
   
    // 1x0 matrix should work
    mmn=new VectorMatrixMN(1 ,0);
    doGenericTests(mmn);

    // square M*M matrix
    mmn=new VectorMatrixMN(6 ,6);
    doGenericTests(mmn);
  }
View Full Code Here

    Arrayz.fillNormal(m, seed++)
  }

  @Test public void g_Matrix() {
    // general M*N matrix
    VectorMatrixMN mmn=new VectorMatrixMN(6 ,7);
    randomise(mmn);

    Matrix am1=new Matrix(Matrix33.createScaleMatrix(4.0));
    doGenericTests(am1);
   
View Full Code Here

 
  @Test public void g_DenseColumnMatrix() {
    Matrix am1=new Matrix(Matrix33.createScaleMatrix(Math.PI));
    doGenericTests(am1.getTranspose());
   
    Matrix am2=new Matrix(new VectorMatrixMN(6 ,7));
    randomise(am2);
    doGenericTests(am2.getTranspose());
  }
View Full Code Here

    AMatrix mt=m.getTranspose();
    assertEquals(0,mt.columnCount());
  }
 
  @Test public void testCreateMN() {
    VectorMatrixMN m=new VectorMatrixMN(0,3);
    assertEquals(0,m.rowCount());
    assertEquals(3,m.columnCount());
   
    AMatrix mt=m.getTranspose();
    assertEquals(0,mt.columnCount());
  }
View Full Code Here

TOP

Related Classes of mikera.matrixx.impl.VectorMatrixMN

Copyright © 2018 www.massapicom. 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.