Class YBlock
java.lang.Object
solvers.linearSystem.btf.ComponentBlock
solvers.linearSystem.btf.topLevelBlocks.TopLevelBlock
solvers.linearSystem.btf.topLevelBlocks.ATopLevelBlock
solvers.linearSystem.btf.topLevelBlocks.YBlock
This class implements the Y Block of the A matrix.
The Factory Methods newMacroBlock, newSecondaryMacroBlock and subBlockCopy are implemented to return the correct
block type in the parallel hierarchy.
Type 1 Macro Blocks are selected for lower class linear systems
- Author:
- Jack Bradshaw
-
Field Summary
Fields inherited from class ATopLevelBlock
sec_macro_blocksFields inherited from class TopLevelBlock
macro_blocks, selection_policyFields inherited from class ComponentBlock
basis, cols_printed, current_class, position, qnm, size -
Constructor Summary
ConstructorsConstructorDescriptionYBlock(QNModel qnm, CoMoMBasis basis) YBlock(QNModel qnm, CoMoMBasis basis, Position position) -
Method Summary
Modifier and TypeMethodDescriptionprotected MacroBlocknewMacroBlock(Position block_position, int h) Factory Method for Macro Blocks To be overridden by subclasses in order to create the appropriate subclass of MacroBlock in the parallel hierarchy.protected voidnewSecondaryMacroBlock(int h, MacroBlock block_1, MacroBlock block_2) Factory Method for Secondary Macro Blocks To be overridden by subclasses in order to create the appropriate subclass of SecondaryMacroBlock in the parallel hierarchy.voidprintRow2(int row) Prints a line of the block if the contains therow.protected TopLevelBlocksubBlockCopy(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 correct typeMethods inherited from class ATopLevelBlock
addCE, addPC, initialise, multiply, solve, subBlockMethods inherited from class TopLevelBlock
findMacroBlockMethods inherited from class ComponentBlock
getStartingCol, getStartingRow, newLine, size
-
Constructor Details
-
YBlock
public YBlock(QNModel qnm, CoMoMBasis basis) throws BTFMatrixErrorException, InternalErrorException, InconsistentLinearSystemException -
YBlock
public YBlock(QNModel qnm, CoMoMBasis basis, Position position) throws BTFMatrixErrorException, InternalErrorException, InconsistentLinearSystemException -
YBlock
- Throws:
BTFMatrixErrorException
-
-
Method Details
-
subBlockCopy
protected TopLevelBlock subBlockCopy(int current_class) throws BTFMatrixErrorException, InternalErrorException, InconsistentLinearSystemException Description copied from class:TopLevelBlockFactory Method for sub-block creation This method is to be overridden by subclasses to instantiate a copy of the current block of correct type- Specified by:
subBlockCopyin classTopLevelBlock- Parameters:
current_class- The class for which the copy is created- Returns:
- A shallow copy of calling block, for the current_class. Without macro blocks.
- Throws:
BTFMatrixErrorExceptionInternalErrorExceptionInconsistentLinearSystemException
-
newMacroBlock
protected MacroBlock newMacroBlock(Position block_position, int h) throws InternalErrorException, InconsistentLinearSystemException Description copied from class:TopLevelBlockFactory Method for Macro Blocks To be overridden by subclasses in order to create the appropriate subclass of MacroBlock in the parallel hierarchy. i.e. XBlocks are composed of XMacroBlocks- Specified by:
newMacroBlockin classTopLevelBlock- Parameters:
block_position- Starting position for the new macro blockh- Number of non-zeros associated with the macro block- Throws:
InternalErrorExceptionInconsistentLinearSystemException
-
newSecondaryMacroBlock
protected void newSecondaryMacroBlock(int h, MacroBlock block_1, MacroBlock block_2) throws BTFMatrixErrorException Description copied from class:ATopLevelBlockFactory Method for Secondary Macro Blocks To be overridden by subclasses in order to create the appropriate subclass of SecondaryMacroBlock in the parallel hierarchy.- Specified by:
newSecondaryMacroBlockin classATopLevelBlock- Parameters:
h-block_1-block_2-- Throws:
BTFMatrixErrorException
-
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.- Overrides:
printRow2in classTopLevelBlock- Parameters:
row- The absolute row of the overall matrix to be printed.
-