Class CMicroBlock
java.lang.Object
solvers.linearSystem.btf.ComponentBlock
solvers.linearSystem.btf.microBlocks.MicroBlock
solvers.linearSystem.btf.microBlocks.CMicroBlock
This class implements the Micro Blocks of the Carry Forward Equations componet of the Linear System.
- Author:
- Jack Bradshaw
-
Field Summary
Fields inherited from class ComponentBlock
basis, cols_printed, current_class, position, qnm, size -
Constructor Summary
ConstructorsConstructorDescriptionCMicroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h) CMicroBlock(CMicroBlock full_block, int current_class) -
Method Summary
Modifier and TypeMethodDescriptionintaddCE(int position, PopulationChangeVector n, int queue) Adds the appropriate coefficients of a Convolution Expression to the blockintaddPC(int position, PopulationChangeVector n, int _class) Adds the appropriate coefficients of a Population Constraint to the blockprotected voidComputes the dimensions of block and stores them in the member fieldsizeprotected voidInitialise any underlying data structuresvoidmultiply(BigRational[] result) Carries out the appropriate matrix multiplication operation for the blockvoidprintRow2(int row) Prints a line of the block if the contains therow.voidsolve(BigRational[] rhs) Makes the block carry out its role in the solution of the linear systemprotected MicroBlocksubBlockCopy(int current_class) Factory Method for sub-block creation This method is to be overridden by subclasses to instantiate a copy of the current block (of the correct type) For instance, a copy of an XMicroBlocks needs to be a XMicroBlockMethods inherited from class MicroBlock
initialise, subBlockMethods inherited from class ComponentBlock
getStartingCol, getStartingRow, newLine, size
-
Constructor Details
-
CMicroBlock
public CMicroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h) throws InternalErrorException - Throws:
InternalErrorException
-
CMicroBlock
-
-
Method Details
-
subBlockCopy
Description copied from class:MicroBlockFactory Method for sub-block creation This method is to be overridden by subclasses to instantiate a copy of the current block (of the correct type) For instance, a copy of an XMicroBlocks needs to be a XMicroBlock- Specified by:
subBlockCopyin classMicroBlock- Parameters:
current_class- The class for which the copy is created- Returns:
- A shallow copy of calling block, for the current_class. Without micro blocks.
-
initialiseDataStructures
Description copied from class:MicroBlockInitialise any underlying data structures- Specified by:
initialiseDataStructuresin classMicroBlock- Throws:
InternalErrorException
-
computeDimensions
protected void computeDimensions()Description copied from class:MicroBlockComputes the dimensions of block and stores them in the member fieldsize- Specified by:
computeDimensionsin classMicroBlock
-
printRow2
public void printRow2(int row) Description copied from class:ComponentBlockPrints a line of the block if the contains therow. The number of columns printed for the current row is incremented accordingly.- Specified by:
printRow2in classComponentBlock- Parameters:
row- The absolute row of the overall matrix to be printed.
-
addCE
public int addCE(int position, PopulationChangeVector n, int queue) throws BTFMatrixErrorException, InternalErrorException Description copied from class:ComponentBlockAdds the appropriate coefficients of a Convolution Expression to the block- Specified by:
addCEin classComponentBlock- Parameters:
position- Carries information on where to insert the equation depending on the context (can be interpreted differently by subclasses)n- The Population Change Vector n to which the equation relatesqueue- The queue k to which the equation relates; 1 <= k <= M- Returns:
- The row at which the equation was inserted
- Throws:
BTFMatrixErrorExceptionInternalErrorException
-
addPC
public int addPC(int position, PopulationChangeVector n, int _class) throws BTFMatrixErrorException, InternalErrorException Description copied from class:ComponentBlockAdds the appropriate coefficients of a Population Constraint to the block- Specified by:
addPCin classComponentBlock- Parameters:
position- Carries information on where to insert the equation depending on the context (can be interpreted differently by subclasses)n- The Population Change Vector n to which the equation relates_class- The class r to which the equation relates; 1 <= r <= R- Returns:
- The row at which the equation was inserted
- Throws:
BTFMatrixErrorExceptionInternalErrorException
-
multiply
Description copied from class:ComponentBlockCarries out the appropriate matrix multiplication operation for the block- Specified by:
multiplyin classComponentBlock- Parameters:
result- Result vector- Throws:
BTFMatrixErrorException
-
solve
Description copied from class:ComponentBlockMakes the block carry out its role in the solution of the linear system- Specified by:
solvein classComponentBlock- Parameters:
rhs- The intermediate basis used during the computation of the solution
-