org.omegahat.Numerics.LinearAlgebra
Interface Arithmetic

All Known Subinterfaces:
NumericMatrix

public interface Arithmetic

Matrix arithmetic operations, including element-wise arithmetic and various matrix products and similar operations.

The element-wise operations are expected to work in place, while matrix products and other operations that generally produce results of different shape than the original object are expected to leave the object alone.

Implementations may extend the Protected interface, to signal that they promise to leave the original object untouched in all methods. Otherwise, the caller is responsible for copying when necessary.


Method Summary
 NumericMatrix add(double y)
          Add the scalar in place.
 NumericMatrix add(NumericMatrix y)
          Add in place the elements of the matrix, which must be identical in dimension.
 NumericMatrix crossProduct(NumericMatrix y)
          The cross products of the object and the argument.
 NumericMatrix divide(double y)
          Divide by the scalar in place.
 NumericMatrix divide(NumericMatrix y)
          Divide in place by the elements of the matrix, which must be identical in dimension.
 NumericMatrix elementInverse()
          Replace each element by 1.
 NumericMatrix multiply(double y)
          Multiply by the scalar in place.
 NumericMatrix multiply(NumericMatrix y)
          Multiply in place by the elements of the matrix, which must be identical in dimension.
 NumericMatrix product(NumericMatrix y)
          The matrix product, with y on the right
 NumericMatrix productLeft(NumericMatrix y)
          The matrix product, with y on the left.
 NumericMatrix productTranspose(NumericMatrix y)
          The matrix product on the right by the transpose of y.
 NumericMatrix subtract(double y)
          Subtract the scalar in place.
 NumericMatrix subtract(NumericMatrix y)
          Subtract in place the elements of the matrix, which must be identical in dimension.
 

Method Detail

add

public NumericMatrix add(NumericMatrix y)
Add in place the elements of the matrix, which must be identical in dimension.

subtract

public NumericMatrix subtract(NumericMatrix y)
Subtract in place the elements of the matrix, which must be identical in dimension.

multiply

public NumericMatrix multiply(NumericMatrix y)
Multiply in place by the elements of the matrix, which must be identical in dimension.

divide

public NumericMatrix divide(NumericMatrix y)
Divide in place by the elements of the matrix, which must be identical in dimension.

elementInverse

public NumericMatrix elementInverse()
Replace each element by 1. / the element, in place.

add

public NumericMatrix add(double y)
Add the scalar in place.

subtract

public NumericMatrix subtract(double y)
Subtract the scalar in place.

multiply

public NumericMatrix multiply(double y)
Multiply by the scalar in place.

divide

public NumericMatrix divide(double y)
Divide by the scalar in place.

product

public NumericMatrix product(NumericMatrix y)
The matrix product, with y on the right

productLeft

public NumericMatrix productLeft(NumericMatrix y)
The matrix product, with y on the left.

crossProduct

public NumericMatrix crossProduct(NumericMatrix y)
The cross products of the object and the argument. The [i, j] element of the result is the cross product of the column i of the object with column j of the argument.

productTranspose

public NumericMatrix productTranspose(NumericMatrix y)
The matrix product on the right by the transpose of y.