Examples of SizeException


Examples of org.jblas.exceptions.SizeException

    assertMultipliesWith(other);
    if (result.rows != rows || result.columns != other.columns) {
      if (result != this && result != other)
        result.resize(rows, other.columns);
      else
        throw new SizeException("Cannot resize result matrix because it is used in-place.");
    }
   
    if (result == this || result == other) {
      /* actually, blas cannot do multiplications in-place. Therefore, we will fake by
       * allocating a temporary object on the side and copy the result later.
View Full Code Here

Examples of org.jblas.exceptions.SizeException

   */
 
  /** Computes a rank-1-update A = A + alpha * x * y'. */
  public ComplexDoubleMatrix rankOneUpdate(ComplexDouble alpha, ComplexDoubleMatrix x, ComplexDoubleMatrix y) {
    if (rows != x.length)
      throw new SizeException("Vector x has wrong length (" + x.length + " != " + rows + ").");
    if (columns != y.length)
      throw new SizeException("Vector y has wrong length (" + x.length + " != " + columns + ").");     
   
    SimpleBlas.gerc(alpha, x, y, this);
    return this;
  }
View Full Code Here

Examples of org.jblas.exceptions.SizeException

     * Concatenates two matrices horizontally. Matrices must have identical
     * numbers of rows.
     */
    public static FloatMatrix concatHorizontally(FloatMatrix A, FloatMatrix B) {
        if (A.rows != B.rows) {
            throw new SizeException("Matrices don't have same number of rows.");
        }

        FloatMatrix result = new FloatMatrix(A.rows, A.columns + B.columns);
        SimpleBlas.copy(A, result);
        JavaBlas.rcopy(B.length, B.data, 0, 1, result.data, A.length, 1);
View Full Code Here

Examples of org.jblas.exceptions.SizeException

     * Concatenates two matrices vertically. Matrices must have identical
     * numbers of columns.
     */
    public static FloatMatrix concatVertically(FloatMatrix A, FloatMatrix B) {
        if (A.columns != B.columns) {
            throw new SizeException("Matrices don't have same number of columns (" + A.columns + " != " + B.columns + ".");
        }

        FloatMatrix result = new FloatMatrix(A.rows + B.rows, A.columns);

        for (int i = 0; i < A.columns; i++) {
View Full Code Here

Examples of org.jblas.exceptions.SizeException

    }

    public FloatMatrix getRows(Range indices, FloatMatrix result) {
        indices.init(0, rows);
        if (result.rows < indices.length()) {
            throw new SizeException("Result matrix does not have enough rows (" + result.rows + " < " + indices.length() + ")");
        }
        result.checkColumns(columns);

      indices.init(0, rows);
      for (int r = 0; indices.hasMore(); indices.next(), r++) {
View Full Code Here

Examples of org.jblas.exceptions.SizeException

    /** Get whole columns as specified by Range. */
    public FloatMatrix getColumns(Range indices, FloatMatrix result) {
        indices.init(0, columns);
        if (result.columns < indices.length()) {
            throw new SizeException("Result matrix does not have enough columns (" + result.columns + " < " + indices.length() + ")");
        }
        result.checkRows(rows);

        indices.init(0, columns);
        for (int c = 0; indices.hasMore(); indices.next(), c++) {
View Full Code Here

Examples of org.jblas.exceptions.SizeException

     * Assert that the matrix has a certain length.
     * @throws SizeException
     */
    public void checkLength(int l) {
        if (length != l) {
            throw new SizeException("Matrix does not have the necessary length (" + length + " != " + l + ").");
        }
    }
View Full Code Here

Examples of org.jblas.exceptions.SizeException

     * Asserts that the matrix has a certain number of rows.
     * @throws SizeException
     */
    public void checkRows(int r) {
        if (rows != r) {
            throw new SizeException("Matrix does not have the necessary number of rows (" + rows + " != " + r + ").");
        }
    }
View Full Code Here

Examples of org.jblas.exceptions.SizeException

     * Asserts that the amtrix has a certain number of columns.
     * @throws SizeException
     */
    public void checkColumns(int c) {
        if (columns != c) {
            throw new SizeException("Matrix does not have the necessary number of columns (" + columns + " != " + c + ").");
        }
    }
View Full Code Here

Examples of org.jblas.exceptions.SizeException

    }

    /** Throws SizeException unless two matrices have the same size. */
    public void assertSameSize(FloatMatrix a) {
        if (!sameSize(a)) {
            throw new SizeException("Matrices must have the same size.");
        }
    }
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.