Module logicng

Class BDDCache


  • public class BDDCache
    extends Object
    BDD Cache.
    Since:
    1.4.0
    Version:
    2.0.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.logicng.knowledgecompilation.bdds.jbuddy.BDDCacheEntry[] table  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BDDCache​(int cs)
      Constructs a new BDD cache of a given size (number of entries in the cache).
    • Field Detail

      • table

        protected org.logicng.knowledgecompilation.bdds.jbuddy.BDDCacheEntry[] table
    • Constructor Detail

      • BDDCache

        protected BDDCache​(int cs)
        Constructs a new BDD cache of a given size (number of entries in the cache).
        Parameters:
        cs - the cache size
    • Method Detail

      • resize

        protected void resize​(int ns)
        Resizes the cache to a new number of entries. The old cache entries are removed in this process.
        Parameters:
        ns - the new number of entries
      • reset

        protected void reset()
        Resets (clears) the cache.
      • lookup

        protected org.logicng.knowledgecompilation.bdds.jbuddy.BDDCacheEntry lookup​(int hash)
        Looks up a given hash value in the cache and returns the respective cache entry.

        The return value is guaranteed to be non-null since every entry in the cache is always a BDDCacheEntry object.

        Parameters:
        hash - the hash value.
        Returns:
        the respective entry in the cache