Class RealLinearOperator
- java.lang.Object
-
- org.apache.commons.math4.legacy.linear.RealLinearOperator
-
- Direct Known Subclasses:
AbstractRealMatrix
,JacobiPreconditioner
public abstract class RealLinearOperator extends Object
This class defines a linear operator operating on real (double
) vector spaces. No direct access to the coefficients of the underlying matrix is provided. The motivation for such an interface is well stated by Barrett et al. (1994):We restrict ourselves to iterative methods, which work by repeatedly improving an approximate solution until it is accurate enough. These methods access the coefficient matrix A of the linear system only via the matrix-vector product y = A · x (and perhaps z = AT · x). Thus the user need only supply a subroutine for computing y (and perhaps z) given x, which permits full exploitation of the sparsity or other special structure of A.
- Barret et al. (1994)
- R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. M. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine and H. Van der Vorst, Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, SIAM
- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description RealLinearOperator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
getColumnDimension()
Returns the dimension of the domain of this operator.abstract int
getRowDimension()
Returns the dimension of the codomain of this operator.boolean
isTransposable()
Returnstrue
if this operator supportsoperateTranspose(RealVector)
.abstract RealVector
operate(RealVector x)
Returns the result of multiplyingthis
by the vectorx
.RealVector
operateTranspose(RealVector x)
Returns the result of multiplying the transpose ofthis
operator by the vectorx
(optional operation).
-
-
-
Constructor Detail
-
RealLinearOperator
public RealLinearOperator()
-
-
Method Detail
-
getRowDimension
public abstract int getRowDimension()
Returns the dimension of the codomain of this operator.- Returns:
- the number of rows of the underlying matrix
-
getColumnDimension
public abstract int getColumnDimension()
Returns the dimension of the domain of this operator.- Returns:
- the number of columns of the underlying matrix
-
operate
public abstract RealVector operate(RealVector x) throws DimensionMismatchException
Returns the result of multiplyingthis
by the vectorx
.- Parameters:
x
- the vector to operate on- Returns:
- the product of
this
instance withx
- Throws:
DimensionMismatchException
- if the column dimension does not match the size ofx
-
operateTranspose
public RealVector operateTranspose(RealVector x) throws DimensionMismatchException, UnsupportedOperationException
Returns the result of multiplying the transpose ofthis
operator by the vectorx
(optional operation). The default implementation throws anUnsupportedOperationException
. Users overriding this method must also overrideisTransposable()
.- Parameters:
x
- the vector to operate on- Returns:
- the product of the transpose of
this
instance withx
- Throws:
DimensionMismatchException
- if the row dimension does not match the size ofx
UnsupportedOperationException
- if this operation is not supported bythis
operator
-
isTransposable
public boolean isTransposable()
Returnstrue
if this operator supportsoperateTranspose(RealVector)
. Iftrue
is returned,operateTranspose(RealVector)
should not throwUnsupportedOperationException
. The default implementation returnsfalse
.- Returns:
false
-
-