Class YMicroBlock
java.lang.Object
solvers.linearSystem.btf.ComponentBlock
solvers.linearSystem.btf.microBlocks.MicroBlock
solvers.linearSystem.btf.microBlocks.MatrixMicroBlock
solvers.linearSystem.btf.microBlocks.YMicroBlock
This class implements the Micro Blocks of the X block of the A matrix.
It extends MatrixMicroBlock and implements the methods to insert the correct coefficients into
the block for given equations.
- Author:
- Jack Bradshaw
-
Field Summary
Fields inherited from class MatrixMicroBlock
array, rowFields inherited from class ComponentBlock
basis, cols_printed, current_class, position, qnm, size -
Constructor Summary
ConstructorsConstructorDescriptionYMicroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h) YMicroBlock(YMicroBlock micro_block, int current_class) -
Method Summary
Modifier and TypeMethodDescriptionintaddCE(int row, PopulationChangeVector n, int queue) Adds the appropriate coefficients of a Convolution Expression to the blockintaddPC(int row, 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 fieldsizevoidsolve(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 MatrixMicroBlock
initialiseDataStructures, multiply, multiplyRow, printRow2Methods inherited from class MicroBlock
initialise, subBlockMethods inherited from class ComponentBlock
getStartingCol, getStartingRow, newLine, size
-
Constructor Details
-
YMicroBlock
public YMicroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h) throws InternalErrorException - Throws:
InternalErrorException
-
YMicroBlock
-
-
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.
-
computeDimensions
protected void computeDimensions()Description copied from class:MicroBlockComputes the dimensions of block and stores them in the member fieldsize- Specified by:
computeDimensionsin classMicroBlock
-
addCE
public int addCE(int row, 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:
row- 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 row, 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:
row- 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
-
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- Throws:
BTFMatrixErrorException
-