Examples of numColumns()


Examples of no.uib.cipr.matrix.io.MatrixSize.numColumns()

                    MatrixInfo.MatrixSymmetry.General);
        MatrixSize size = r.readMatrixSize(info);

        // Resize the matrix to correct size
        numRows = size.numRows();
        numColumns = size.numColumns();

        // Check that the matrix is in an acceptable format
        if (info.isPattern())
            throw new UnsupportedOperationException(
                    "Pattern matrices are not supported");
View Full Code Here

Examples of no.uib.cipr.matrix.io.MatrixSize.numColumns()

                    MatrixInfo.MatrixSymmetry.General);
        MatrixSize size = r.readMatrixSize(info);

        // Resize the matrix to correct size
        numRows = size.numRows();
        numColumns = size.numColumns();
        data = new double[numRows * numColumns];

        // Check that the matrix is in an acceptable format
        if (info.isPattern())
            throw new UnsupportedOperationException(
View Full Code Here

Examples of no.uib.cipr.matrix.io.MatrixSize.numColumns()

                    "Complex matrices are not supported");

        // Resize the matrix to correct size
        MatrixSize size = r.readMatrixSize(info);
        numRows = size.numRows();
        numColumns = size.numColumns();

        // Start reading entries
        int numEntries = size.numEntries();
        int[] row = new int[numEntries];
        int[] column = new int[numEntries];
View Full Code Here

Examples of no.uib.cipr.matrix.io.MatrixSize.numColumns()

      MatrixInfo info = r.readMatrixInfo();
      if (info.isComplex()) throw new IllegalArgumentException("complex matrices not supported");
      if (!info.isCoordinate()) throw new IllegalArgumentException("only coordinate matrices supported");
      MatrixSize size = r.readMatrixSize(info);
      numRows = size.numRows();
      numColumns = size.numColumns();
      links = new Linked();

      int nz = size.numEntries();
      int[] row = new int[nz];
      int[] column = new int[nz];
View Full Code Here

Examples of no.uib.cipr.matrix.io.MatrixSize.numColumns()

                    "Complex matrices are not supported");

        // Resize the matrix to correct size
        MatrixSize size = r.readMatrixSize(info);
        numRows = size.numRows();
        numColumns = size.numColumns();

        // Start reading entries
        int numEntries = size.numEntries();
        int[] row = new int[numEntries];
        int[] column = new int[numEntries];
View Full Code Here

Examples of no.uib.cipr.matrix.sparse.CompRowMatrix.numColumns()

      testFile.deleteOnExit();
    BufferedWriter out = new BufferedWriter(new FileWriter(testFile));
    MatrixVectorWriter writer = new MatrixVectorWriter(out);
    MatrixInfo mi = new MatrixInfo(true, MatrixInfo.MatrixField.Real, MatrixInfo.MatrixSymmetry.General);
    writer.printMatrixInfo(mi);
    writer.printMatrixSize(new MatrixSize(mat.numColumns(), mat.numColumns(), mat.getData().length), mi);
    int[] rows = buildRowArray(mat);
    writer.printCoordinate(rows, mat.getColumnIndices(), mat.getData(), 1);
    out.close();
    CompRowMatrix newMat = new CompRowMatrix(new MatrixVectorReader(new FileReader(testFile)));
    MatrixTestAbstract.assertEquals(mat, newMat);
View Full Code Here

Examples of no.uib.cipr.matrix.sparse.CompRowMatrix.numColumns()

      testFile.deleteOnExit();
    BufferedWriter out = new BufferedWriter(new FileWriter(testFile));
    MatrixVectorWriter writer = new MatrixVectorWriter(out);
    MatrixInfo mi = new MatrixInfo(true, MatrixInfo.MatrixField.Real, MatrixInfo.MatrixSymmetry.General);
    writer.printMatrixInfo(mi);
    writer.printMatrixSize(new MatrixSize(mat.numColumns(), mat.numColumns(), mat.getData().length), mi);
    int[] rows = buildRowArray(mat);
    writer.printCoordinate(rows, mat.getColumnIndices(), mat.getData(), 1);
    out.close();
    CompRowMatrix newMat = new CompRowMatrix(new MatrixVectorReader(new FileReader(testFile)));
    MatrixTestAbstract.assertEquals(mat, newMat);
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.JavaArray2D.numColumns()

    assertEquals(30.0, a2d.get(1, 0));
    assertEquals(10.0, a2d.get(0, 0));
   
    // Verify new dimensions
    assertEquals(newRowIdx + 1, a2d.numRows());
    assertEquals(newColIdx + 1, a2d.numColumns(newRowIdx));
  }

  private static double[][] copy(double[][] a) {
    double[][] copy = new double[a.length][];
    for (int i = 0; i < a.length; i++) {
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.JavaArray2D.numColumns()

   
    JavaArray2D a = new JavaArray2D();
    a.set(0, 0, 100);
    a.set(2, 2, 300);
    assertEquals(100.0, a.get(0, 0));
    assertEquals(0, a.numColumns(1)); // row 1 has not been assigned anything
    assertEquals(300.0, a.get(2, 2));
   
    // Columns 0 and 1 not exlicitly assigned in this row; expects default value of 0.
    assertEquals(0.0, a.get(2, 0));
    assertEquals(0.0, a.get(2, 1));
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.JavaArray2D.numColumns()

    // case where JavaArray2D accidentally modifies the input array.
    double[] expectedRow = Util.copyArray(row);
   
    JavaArray2D a = new JavaArray2D(row);
    assertEquals(1, a.numRows());
    assertEquals(3, a.numColumns(0));
    for (int i = 0; i < expectedRow.length; i++) {
      assertEquals(expectedRow[i], a.get(0, i));
    }
  }
 
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.