Class AssociateDescriptionHashSets<Desc>

All Implemented Interfaces:
Associate<Desc>

public class AssociateDescriptionHashSets<Desc>
extends BaseAssociateDescriptionSets<Desc>
Feature set aware association algorithm for use when there is a large sparse set of unique set ID's. Internally a HashMap is used to look up the set ID's to the actual set. Internally it has an array 'sets' which stores the actual data for each set. The set index does not correspond to the set ID, you need to use the map to go from set ID to set index.
  • Field Details

    • createNewSetsFromSource

      public boolean createNewSetsFromSource
      If true then source features can create new sets.
    • createNewSetsFromDestination

      public boolean createNewSetsFromDestination
      If true then source features can create new sets.
    • setsAddedBySrc

      public final DogArray_I32 setsAddedBySrc
    • setsAddedByDst

      public final DogArray_I32 setsAddedByDst
  • Constructor Details

    • AssociateDescriptionHashSets

      public AssociateDescriptionHashSets​(AssociateDescription<Desc> associator)
      Provides the association algorithm and the descriptor type
      Parameters:
      associator - Association algorithm
  • Method Details

    • initialize

      public void initialize​(int numberOfSets)
      Override the default behavior which assumes there's a one-to-one match between index and set ID
      Specified by:
      initialize in class BaseAssociateDescriptionSets<Desc>
    • addSource

      public void addSource​(Desc description, int set)
      Adds a new descriptor and its set to the list. The order that descriptors are added is important and saved.
      Specified by:
      addSource in class BaseAssociateDescriptionSets<Desc>
      Parameters:
      description - The feature's description. This reference is saved internally.
      set - The set the feature belongs to.
    • addDestination

      public void addDestination​(Desc description, int set)
      Adds a new descriptor and its set to the list. The order that descriptors are added is important and saved.
      Specified by:
      addDestination in class BaseAssociateDescriptionSets<Desc>
      Parameters:
      description - The feature's description. This reference is saved internally.
      set - The set the feature belongs to.
    • clearSource

      public void clearSource()
      Description copied from class: BaseAssociateSets
      Removes all data for the source descriptors.
      Overrides:
      clearSource in class BaseAssociateSets<Desc>
    • clearDestination

      public void clearDestination()
      Description copied from class: BaseAssociateSets
      Removes all data for the destination descriptors.
      Overrides:
      clearDestination in class BaseAssociateSets<Desc>
    • associate

      public void associate()
      Associates each set of features independently then puts them back into a single list for output