SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype.mathoperation
Interface MatrixMathOperation

All Known Implementing Classes:
SimpleMatrixMathOperation

public interface MatrixMathOperation

This interface defines some standard operations for matrices. The definitions do not assume any particular implementation of Matrix. Thus, a class that implements this interface should work with all Matrix subclasses. The return type of the computations is the general interface Matrix.


Method Summary
 Matrix add(Matrix A1, Matrix A2)
          A1 + A2
 Matrix minus(Matrix A1, Matrix A2)
          A1 - A2
 Matrix multiply(Matrix A1, Matrix A2)
          A1 %*% A2
 Vector multiply(Matrix A, Vector v)
          A %*% v
 Matrix scaled(Matrix A, double s)
          s * A
 Matrix transpose(Matrix A)
          t(A)
 

Method Detail

add

Matrix add(Matrix A1,
           Matrix A2)
A1 + A2

Parameters:
A1 - a matrix
A2 - a matrix
Returns:
the sum of A1 and A2

minus

Matrix minus(Matrix A1,
             Matrix A2)
A1 - A2

Parameters:
A1 - a matrix
A2 - a matrix
Returns:
the difference between A1 and A2

multiply

Matrix multiply(Matrix A1,
                Matrix A2)
A1 %*% A2

Parameters:
A1 - a matrix
A2 - a matrix
Returns:
the product of A1 and A2

multiply

Vector multiply(Matrix A,
                Vector v)
A %*% v

Parameters:
A - a matrix
v - a vector
Returns:
the product of A and v

scaled

Matrix scaled(Matrix A,
              double s)
s * A

Parameters:
A - a matrix
s - a scalar
Returns:
A scaled by s

transpose

Matrix transpose(Matrix A)
t(A)

Parameters:
A - a matrix
Returns:
the transpose of A

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.