Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format

/**
 * Basic matrix interface.
 */
public interface MatrixInterface {

  /**
   * @param i ith row of the matrix
   * @param j jth column of the matrix
   * @return A(i, j)
   */
  public double get(int i, int j);

  /**
   * Get a number of row of the matrix
   * 
   * @return a number of rows of the matrix
   */
  public int getRows();

  /**
   * Get a number of column of the matrix
   * 
   * @return a number of columns of the matrix
   */
  public int getColumns();

  /**
   * A(i, j) = value
   * 
   * @param i ith row of the matrix
   * @param j jth column of the matrix
   * @param value the value of entry
   */
  public void set(int i, int j, double value);

  /**
   * A=alpha*B
   * 
   * @param alpha
   * @param B
   * @return A
   */
  public Matrix set(double alpha, Matrix B);

  /**
   * A=B
   * 
   * @param B
   * @return A
   */
  public Matrix set(Matrix B);

  /**
   * A(row,column) += value
   * 
   * @param row
   * @param column
   * @param value
   */
  public void add(int row, int column, double value);

  /**
   * A = B + A
   * 
   * @param B
   * @return
   */
  public Matrix add(Matrix B);

  /**
   * A = alpha*B + A
   * 
   * @param alpha
   * @param B
   * @return A
   */
  public Matrix add(double alpha, Matrix B);

  /**
   * C = A*B
   * 
   * @param B
   * @return C
   */
  public Matrix mult(Matrix B);

  /**
   * C = alpha*A*B + C
   * 
   * @param alpha
   * @param B
   * @param C
   * @return C
   */
  public Matrix multAdd(double alpha, Matrix B, Matrix C)
          
  /**
   * Computes the given norm of the matrix
   * 
   * @param type
   * @return norm of the matrix
   */
  public double norm(Matrix.Norm type);
}