Class MicroBlock

java.lang.Object
solvers.linearSystem.btf.ComponentBlock
solvers.linearSystem.btf.microBlocks.MicroBlock
Direct Known Subclasses:
B1MicroBlock, B2MicroBlock, CMicroBlock, MatrixMicroBlock

public abstract class MicroBlock extends ComponentBlock
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
  • Constructor Details

    • MicroBlock

      protected MicroBlock(QNModel qnm, CoMoMBasis basis, Position position, int h)
      Constructor - First phase of construction
      Parameters:
      qnm - The Model under study
      basis - The associated basis
      position - The starting position of the block
      h - The number of non-zero elements in the pattern associated to the micro block
    • MicroBlock

      public MicroBlock(MicroBlock micro_block, int current_class)
      Copy Constructor
      Parameters:
      micro_block - Block to be copied
      current_class - The class for which the copy is being created
  • Method Details

    • initialise

      public void initialise() throws InternalErrorException
      Second Phase of construction Computes dimension of the block @see MicroBlock#computeDimensions() computeDimesions() and initialises data structures @see MicroBlock#initialiseDataStructures() initialiseDataStructures()
      Throws:
      InternalErrorException
    • initialiseDataStructures

      protected abstract void initialiseDataStructures() throws InternalErrorException
      Initialise any underlying data structures
      Throws:
      InternalErrorException
    • subBlock

      public MicroBlock subBlock(int current_class)
      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

      protected abstract MicroBlock subBlockCopy(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 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 field size