Package org.hipparchus.linear
Interface RealLinearOperator
-
- All Known Implementing Classes:
AbstractRealMatrix
,Array2DRowRealMatrix
,BlockRealMatrix
,DiagonalMatrix
,JacobiPreconditioner
,OpenMapRealMatrix
public interface RealLinearOperator
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
getColumnDimension()
Returns the dimension of the domain of this operator.int
getRowDimension()
Returns the dimension of the codomain of this operator.default boolean
isTransposable()
Returnstrue
if this operator supportsoperateTranspose(RealVector)
.RealVector
operate(RealVector x)
Returns the result of multiplyingthis
by the vectorx
.default RealVector
operateTranspose(RealVector x)
Returns the result of multiplying the transpose ofthis
operator by the vectorx
(optional operation).
-
-
-
Method Detail
-
getRowDimension
int getRowDimension()
Returns the dimension of the codomain of this operator.- Returns:
- the number of rows of the underlying matrix
-
getColumnDimension
int getColumnDimension()
Returns the dimension of the domain of this operator.- Returns:
- the number of columns of the underlying matrix
-
operate
RealVector operate(RealVector x) throws MathIllegalArgumentException
Returns the result of multiplyingthis
by the vectorx
.- Parameters:
x
- the vector to operate on- Returns:
- the product of
this
instance withx
- Throws:
MathIllegalArgumentException
- if the column dimension does not match the size ofx
-
operateTranspose
default RealVector operateTranspose(RealVector x) throws MathIllegalArgumentException, UnsupportedOperationException
Returns the result of multiplying the transpose ofthis
operator by the vectorx
(optional operation).The default implementation throws an
UnsupportedOperationException
. 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:
MathIllegalArgumentException
- if the row dimension does not match the size ofx
UnsupportedOperationException
- if this operation is not supported bythis
operator
-
isTransposable
default boolean isTransposable()
Returnstrue
if this operator supportsoperateTranspose(RealVector)
.If
true
is returned,operateTranspose(RealVector)
should not throwUnsupportedOperationException
.The default implementation returns
false
.- Returns:
false
-
-