drasys.or.linear.algebra
Interface AlgebraI

All Known Implementing Classes:
Algebra

public interface AlgebraI

Smart linear algebra operations. These algebraic operations are analagous to the drasys.or.linear.blas, but operate on all vector and matrix classes. Each method checks the class type and sparcity of the arguments to determine the best way to perform the operation.

References:

Linear Algebra and Its Applications
    Gilbert Strang / Hardcover / Published 1988
Matrix Computations (Johns Hopkins Studies in the Mathematical Sciences)
    Gene H. Golub, Charles F. Van Loan (Contributor) / Paperback / Published 1996
Numerical Recipes in C : The Art of Scientific Computing
    William H. Press, et al / Hardcover / Published 1993
Parallel Algorithms for Matrix Computations
    K.A. Gallivan / Paperback / Published 1990


Method Summary
 DenseMatrix add(MatrixI a, MatrixI b)
          Add two matrices.
 DenseVector add(VectorI a, VectorI b)
          Add two vectors.
 DenseMatrix invert(MatrixI a)
          Invert a matrix.
 DenseMatrix matrixProduct(VectorI columnVector, VectorI rowVector)
          Compute the matrix product of a column and row vector.
 DenseMatrix multiply(MatrixI a, MatrixI b)
          Multiply two matrices.
 DenseVector multiply(MatrixI a, VectorI b)
          Multiply a matrix by column vector.
 DenseVector multiply(VectorI a, MatrixI b)
          Multiply a row vector by matrix.
 double scalerProduct(VectorI a, VectorI b)
          Compute the dot product two vectors.
 DenseMatrix subtract(MatrixI a, MatrixI b)
          Subtract two matrices.
 DenseVector subtract(VectorI a, VectorI b)
          Subtract two vectors.
 DenseMatrix transpose(MatrixI a)
          Transpose matrix.
 

Method Detail

add

public DenseMatrix add(MatrixI a,
                       MatrixI b)
                throws AlgebraException
Add two matrices.
Throws:
AlgebraException - if the sizes don't match.

subtract

public DenseMatrix subtract(MatrixI a,
                            MatrixI b)
                     throws AlgebraException
Subtract two matrices.
Throws:
AlgebraException - if the sizes don't match.

multiply

public DenseMatrix multiply(MatrixI a,
                            MatrixI b)
                     throws AlgebraException
Multiply two matrices.
Throws:
AlgebraException - if the sizes don't match.

multiply

public DenseVector multiply(VectorI a,
                            MatrixI b)
                     throws AlgebraException
Multiply a row vector by matrix.
Returns:
a column vector.
Throws:
AlgebraException - if the sizes don't match.

multiply

public DenseVector multiply(MatrixI a,
                            VectorI b)
                     throws AlgebraException
Multiply a matrix by column vector.
Returns:
a row vector.
Throws:
AlgebraException - if the sizes don't match.

transpose

public DenseMatrix transpose(MatrixI a)
Transpose matrix.

invert

public DenseMatrix invert(MatrixI a)
                   throws AlgebraException
Invert a matrix.
Throws:
AlgebraException - if the matrix isn't square or the inverse doesn't exist.

add

public DenseVector add(VectorI a,
                       VectorI b)
                throws AlgebraException
Add two vectors.
Throws:
AlgebraException - if the sizes don't match.

subtract

public DenseVector subtract(VectorI a,
                            VectorI b)
                     throws AlgebraException
Subtract two vectors.
Throws:
AlgebraException - if the sizes don't match.

scalerProduct

public double scalerProduct(VectorI a,
                            VectorI b)
                     throws AlgebraException
Compute the dot product two vectors.
Throws:
AlgebraException - if the sizes don't match.

matrixProduct

public DenseMatrix matrixProduct(VectorI columnVector,
                                 VectorI rowVector)
                          throws AlgebraException
Compute the matrix product of a column and row vector.
Throws:
AlgebraException - if the sizes don't match.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com