Package com.irurueta.algebra
Class Decomposer
java.lang.Object
com.irurueta.algebra.Decomposer
- Direct Known Subclasses:
CholeskyDecomposer
,EconomyQRDecomposer
,LUDecomposer
,QRDecomposer
,RQDecomposer
,SingularValueDecomposer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Matrix
Reference to input matrix to be decomposed.protected boolean
Member indicating whether this decomposer instance is locked or not. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor of this class.protected
Decomposer
(Matrix inputMatrix) Constructor of this class. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
This method computes matrix decomposition for each decomposer type.abstract DecomposerType
Returns decomposer type of this instance.Returns a reference to input matrix to be decomposed.abstract boolean
Returns boolean indicating whether decomposition has been computed and results can be retrieved.boolean
isLocked()
Returns boolean indicating whether this instance is locked or not.boolean
isReady()
Returns boolean indicating whether this instance is ready for decomposition computation.void
setInputMatrix
(Matrix inputMatrix) Sets reference to input matrix to be decomposed.
-
Field Details
-
inputMatrix
Reference to input matrix to be decomposed. -
locked
protected boolean lockedMember indicating whether this decomposer instance is locked or not. When locked, attempting to change parameters of this instance might raise a com.algebra.LockedException.
-
-
Constructor Details
-
Decomposer
protected Decomposer()Constructor of this class. -
Decomposer
Constructor of this class.- Parameters:
inputMatrix
- Reference to input matrix to be decomposed.
-
-
Method Details
-
getDecomposerType
Returns decomposer type of this instance. Decomposer type determines the algorithm being used for matrix decomposition. Depending on this type, after calling decompose() method, different object or matrices will be available for retrieval.- Returns:
- Decomposer type of this instance.
-
getInputMatrix
Returns a reference to input matrix to be decomposed.- Returns:
- Reference to input matrix to be decomposed.
-
setInputMatrix
Sets reference to input matrix to be decomposed.- Parameters:
inputMatrix
- Reference to input matrix to be decomposed.- Throws:
LockedException
- Exception thrown if attempting to call this method while this instance remains locked.
-
isReady
public boolean isReady()Returns boolean indicating whether this instance is ready for decomposition computation. Attempting to call decompose() method when this instance is not ready will result on a NotReadyException being thrown.- Returns:
- Boolean indicating whether this instance is ready for decomposition computation.
-
isLocked
public boolean isLocked()Returns boolean indicating whether this instance is locked or not. When locked, attempting to change some parameters of this instance might raise a LockedException.- Returns:
- Boolean indicating whether this instance is locked or not.
-
isDecompositionAvailable
public abstract boolean isDecompositionAvailable()Returns boolean indicating whether decomposition has been computed and results can be retrieved. Attempting to retrieve decomposition results when not available, will probably raise a NotAvailableException.- Returns:
- Boolean indicating whether decomposition has been computed and results can be retrieved.
-
decompose
This method computes matrix decomposition for each decomposer type. After execution of this method, different objects might be generated depending on decomposition type and decomposition results availability. Note: during execution of this method, this instance might become locked depending on subclass implementation.- Throws:
NotReadyException
- Exception thrown if attempting to call this method when this instance is not yet ready for decomposition, usually because some data or parameter is missing.LockedException
- Exception thrown if this decomposer is already locked before calling this method. Notice that this method will actually lock this instance while it is being executed.DecomposerException
- Exception thrown if for any other reason decomposition fails while being executed, like when convergence or results cannot be obtained, etc.
-