Package org.jblas.exceptions

Examples of org.jblas.exceptions.SizeException


    return get(0);
  }
 
  public static ComplexDoubleMatrix concatHorizontally(ComplexDoubleMatrix A, ComplexDoubleMatrix B) {
    if (A.rows != B.rows)
      throw new SizeException("Matrices don't have same number of rows.");
   
    ComplexDoubleMatrix result = new ComplexDoubleMatrix(A.rows, A.columns + B.columns);
    SimpleBlas.copy(A, result);
    NativeBlas.zcopy(B.length, B.data, 0, 1, result.data, A.length, 1);
    return result;
View Full Code Here


    return result;
  }

  public static ComplexDoubleMatrix concatVertically(ComplexDoubleMatrix A, ComplexDoubleMatrix B) {
    if (A.columns != B.columns)
      throw new SizeException("Matrices don't have same number of columns.");
   
    ComplexDoubleMatrix result = new ComplexDoubleMatrix(A.rows + B.rows, A.columns);

    for (int i = 0; i < A.columns; i++) {
      NativeBlas.zcopy(A.rows, A.data, A.index(0, i), 1, result.data, result.index(0, i), 1);
View Full Code Here

    return get(rindices.findIndices(), cindices.findIndices());
  }
 
  private void checkLength(int l) {
    if (length != l)
      throw new SizeException("Matrix does not have the necessary length (" + length + " != " + l + ").");
  }
View Full Code Here

      throw new SizeException("Matrix does not have the necessary length (" + length + " != " + l + ").");
  }

  private void checkRows(int r) {
    if (rows != r)
      throw new SizeException("Matrix does not have the necessary length (" + length + " != " + r + ").");
  }
View Full Code Here

      throw new SizeException("Matrix does not have the necessary length (" + length + " != " + r + ").");
  }
 
  private void checkColumns(int c) {
    if (columns != c)
      throw new SizeException("Matrix does not have the necessary length (" + length + " != " + c + ").");
  }
View Full Code Here

   * @param a the other matrix
   * @throws SizeException if matrix sizes don't match.
   * */
  public void assertSameSize(ComplexDoubleMatrix a) {
    if (!sameSize(a))
      throw new SizeException("Matrices must have the same size.");
  }
View Full Code Here

    return columns == a.rows;
  }
 
  public void assertMultipliesWith(ComplexDoubleMatrix a) {
    if (!multipliesWith(a))
      throw new SizeException("Number of columns of left matrix must be equal to number of rows of right matrix.");
  }
View Full Code Here

    return length == a.length;
  }
 
  public void assertSameLength(ComplexDoubleMatrix a) {
    if (!sameLength(a))
      throw new SizeException("Matrices must have same length (is: " + length + " and " + a.length + ")");
  }
View Full Code Here

    return columns == rows;
  }
 
  public void assertSquare() {
    if (!isSquare())
      throw new SizeException("Matrix must be square!");
  }
View Full Code Here

   * resizing result is tried, which fails if result == this or result == other.
   */
  private void ensureResultLength(ComplexDoubleMatrix other, ComplexDoubleMatrix result) {
    if (!sameLength(result)) {
      if (result == this || result == other)
        throw new SizeException("Cannot resize result matrix because it is used in-place.");
      result.resize(rows, columns);
    }
  }
View Full Code Here

TOP

Related Classes of org.jblas.exceptions.SizeException

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.