Class BTFLinearSystem
java.lang.Object
solvers.linearSystem.LinearSystem
solvers.linearSystem.btf.BTFLinearSystem
This class implements the BTF linear system, using the idea that the matrices only need to be generated once.
- Author:
- Jack Bradshaw
-
Field Summary
Fields inherited from class LinearSystem
basis, qnm -
Constructor Summary
ConstructorsConstructorDescriptionBTFLinearSystem(QNModel qnm, CoMoMBasis basis) ConstructorBTFLinearSystem(QNModel qnm, CoMoMBasis basis, boolean in_place) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidinitialiseMatricesForClass(PopulationVector current_N, int current_class) Initialises the matrices of the linear system ready for iteration on current_class at the specified populationvoidmultiply(BigRational[] lhs_result, BigRational[] rhs_result) Multiplies the matrices by the values in the previous and current bases.voidsolve()Solve the linear system in its current configurationvoidupdate(int current_class_population) Updates the N_l values in the linear systemMethods inherited from class LinearSystem
computePerformanceMeasures, initialiseForClass
-
Constructor Details
-
BTFLinearSystem
public BTFLinearSystem(QNModel qnm, CoMoMBasis basis) throws InternalErrorException, BTFMatrixErrorException, InconsistentLinearSystemException Constructor- Parameters:
qnm- The model under studybasis- The basis of the model- Throws:
InternalErrorExceptionBTFMatrixErrorExceptionInconsistentLinearSystemException
-
BTFLinearSystem
public BTFLinearSystem(QNModel qnm, CoMoMBasis basis, boolean in_place) throws InternalErrorException, BTFMatrixErrorException, InconsistentLinearSystemException Constructor- Parameters:
qnm- The model under studybasis- The basis of the modelin_place- Boolean to specify in the LUP decomposition should be in place or not.- Throws:
InternalErrorExceptionBTFMatrixErrorExceptionInconsistentLinearSystemException
-
-
Method Details
-
initialiseMatricesForClass
public void initialiseMatricesForClass(PopulationVector current_N, int current_class) throws BTFMatrixErrorException, InternalErrorException, InconsistentLinearSystemException Description copied from class:LinearSystemInitialises the matrices of the linear system ready for iteration on current_class at the specified population- Specified by:
initialiseMatricesForClassin classLinearSystem- Parameters:
current_N- The current population vectorcurrent_class- The current class under consideration- Throws:
BTFMatrixErrorExceptionInternalErrorExceptionInconsistentLinearSystemException
-
solve
public void solve() throws OperationNotSupportedException, InconsistentLinearSystemException, InternalErrorException, BTFMatrixErrorExceptionDescription copied from class:LinearSystemSolve the linear system in its current configuration- Specified by:
solvein classLinearSystem- Throws:
OperationNotSupportedExceptionInconsistentLinearSystemExceptionInternalErrorExceptionBTFMatrixErrorException
-
update
public void update(int current_class_population) Description copied from class:LinearSystemUpdates the N_l values in the linear system- Specified by:
updatein classLinearSystem- Parameters:
current_class_population- The population in the current class under consideration
-
multiply
public void multiply(BigRational[] lhs_result, BigRational[] rhs_result) throws BTFMatrixErrorException Multiplies the matrices by the values in the previous and current bases.- Parameters:
lhs_result- The Left-Hand-Side of the linear systemrhs_result- The Right-Hand-Side of the linear system- Throws:
BTFMatrixErrorException
-