Package org.jblas.exceptions

Examples of org.jblas.exceptions.SizeException


      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(ComplexFloatMatrix a) {
    if (!sameSize(a))
      throw new SizeException("Matrices must have the same size.");
  }
View Full Code Here

    return columns == a.rows;
  }
 
  public void assertMultipliesWith(ComplexFloatMatrix 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(ComplexFloatMatrix 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(ComplexFloatMatrix other, ComplexFloatMatrix 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

    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

   */
 
  /** Computes a rank-1-update A = A + alpha * x * y'. */
  public ComplexFloatMatrix rankOneUpdate(ComplexFloat alpha, ComplexFloatMatrix x, ComplexFloatMatrix 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

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.