Class B2MacroBlock
java.lang.Object
solvers.linearSystem.btf.ComponentBlock
solvers.linearSystem.btf.macroBlocks.MacroBlock
solvers.linearSystem.btf.macroBlocks.B2MacroBlock
This class implements the Macro Blocks of the B2 Block of the B matrix.
The Factory Methods newMicroBlock and subBlockCopy are implemented to return the correct
block type in the parallel hierarchy.
Type 1 Micro Blocks are selected for lower class linear systems
- Author:
- Jack Bradshaw
-
Field Summary
Fields inherited from class MacroBlock
h, micro_blocks, selection_policyFields inherited from class ComponentBlock
basis, cols_printed, current_class, position, qnm, size -
Constructor Summary
ConstructorsConstructorDescriptionB2MacroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h) B2MacroBlock(MacroBlock full_block, int current_class) -
Method Summary
Modifier and TypeMethodDescriptionprotected MicroBlocknewMicroBlock(Position block_position, int h) Factory Method for Micro Blocks To be overridden by subclasses in order to create the appropriate subclass of MacroBlock in the parallel hierarchy.protected MacroBlocksubBlockCopy(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 XMacroBlocks needs to be a XMacroBlockvoidupdate(int current_class_population) Methods inherited from class MacroBlock
addCE, addPC, initialise, multiply, numberOfMicroBlocks, printRow2, solve, subBlockMethods inherited from class ComponentBlock
getStartingCol, getStartingRow, newLine, size
-
Constructor Details
-
B2MacroBlock
public B2MacroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h) throws InternalErrorException, InconsistentLinearSystemException -
B2MacroBlock
-
-
Method Details
-
subBlockCopy
Description copied from class:MacroBlockFactory 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 XMacroBlocks needs to be a XMacroBlock- Specified by:
subBlockCopyin classMacroBlock- 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.
-
newMicroBlock
Description copied from class:MacroBlockFactory Method for Micro Blocks To be overridden by subclasses in order to create the appropriate subclass of MacroBlock in the parallel hierarchy. i.e. XMacroBlocks are composed of XMicroBlocks- Specified by:
newMicroBlockin classMacroBlock- Parameters:
block_position- Starting position for the new macro blockh- Number of non-zeros associated with the macro block
-
update
public void update(int current_class_population)
-