Class MicroBlock
java.lang.Object
solvers.linearSystem.btf.ComponentBlock
solvers.linearSystem.btf.microBlocks.MicroBlock
- Direct Known Subclasses:
B1MicroBlock, B2MicroBlock, CMicroBlock, MatrixMicroBlock
This class is an abstract class that is extended by the Micro Blocks of the linear system.
It provides the interface that the MacroBlock class use to handle all types of Micro Block in a consistent way.
Sub-classes must implement ComputeDimensions and InitialiseDataStructures to initialise them selves in the correct manner.
They must also implement the subBlockCopy factory method to return the appropriate type of block.
- Author:
- Jack Bradshaw
-
Field Summary
Fields inherited from class ComponentBlock
basis, cols_printed, current_class, position, qnm, size -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMicroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h) Constructor - First phase of constructionMicroBlock(MicroBlock micro_block, int current_class) Copy Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidComputes the dimensions of block and stores them in the member fieldsizevoidSecond Phase of construction Computes dimension of the block @see MicroBlock#computeDimensions() computeDimesions() and initialises data structures @see MicroBlock#initialiseDataStructures() initialiseDataStructures()protected abstract voidInitialise any underlying data structuressubBlock(int current_class) Builder method that encapsulates the creation of copy MicroBlocksprotected abstract 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 ComponentBlock
addCE, addPC, getStartingCol, getStartingRow, multiply, newLine, printRow2, size, solve
-
Constructor Details
-
MicroBlock
Constructor - First phase of construction- Parameters:
qnm- The Model under studybasis- The associated basisposition- The starting position of the blockh- The number of non-zero elements in the pattern associated to the micro block
-
MicroBlock
Copy Constructor- Parameters:
micro_block- Block to be copiedcurrent_class- The class for which the copy is being created
-
-
Method Details
-
initialise
Second Phase of construction Computes dimension of the block @see MicroBlock#computeDimensions() computeDimesions() and initialises data structures @see MicroBlock#initialiseDataStructures() initialiseDataStructures()- Throws:
InternalErrorException
-
initialiseDataStructures
Initialise any underlying data structures- Throws:
InternalErrorException
-
subBlock
Builder method that encapsulates the creation of copy MicroBlocks- Parameters:
current_class- The class for which the copy is being created- Returns:
- A shallow copy of calling block, for the current class
-
subBlockCopy
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 XMicroBlock- 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 abstract void computeDimensions()Computes the dimensions of block and stores them in the member fieldsize
-