DDD 1.9.0.20250409152518
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
MLHom Class Reference

#include <MLHom.h>

Collaboration diagram for MLHom:
Collaboration graph

Public Member Functions

 MLHom ()
 Default public constructor.
 
 MLHom (const GHom &h)
 
 MLHom (const GHom &up, const MLHom &down)
 
 MLHom (const _MLHom &)
 
 MLHom (_MLHom *)
 
 MLHom (const _MLHom *)
 
 MLHom (int var, int val, const MLHom &h=MLHom::id)
 Create variable/value pair and left concatenate to a homomorphism.
 
virtual ~MLHom ()
 
bool operator< (const MLHom &h) const
 
bool operator== (const MLHom &h) const
 
size_t hash () const
 Hash key computation.
 
HomNodeMap eval (const GDDD &d) const
 The computation function responsible for evaluation over a node.
 
HomNodeMap operator() (const GDDD &) const
 cache calls to eval
 

Static Public Member Functions

static void garbage ()
 Collects and destroys unused homomorphisms.
 

Static Public Attributes

static const MLHom id
 Elementary homomorphism Identity, defined as a constant.
 

Private Attributes

const _MLHomconcret
 The real implementation class.
 

Friends

MLHom operator+ (const MLHom &, const MLHom &)
 By definition, as homomorphism are linear, (h+g) (d) = h(d) + g(d) ;.
 

Constructor & Destructor Documentation

◆ MLHom() [1/7]

MLHom::MLHom ( )
inline

Default public constructor.

Builds Identity homomorphism : forall d in DDD, id(d) = d

◆ MLHom() [2/7]

MLHom::MLHom ( const GHom h)

◆ MLHom() [3/7]

MLHom::MLHom ( const GHom up,
const MLHom down 
)

◆ MLHom() [4/7]

MLHom::MLHom ( const _MLHom h)

◆ MLHom() [5/7]

MLHom::MLHom ( _MLHom )

◆ MLHom() [6/7]

MLHom::MLHom ( const _MLHom h)

◆ MLHom() [7/7]

MLHom::MLHom ( int  var,
int  val,
const MLHom h = MLHom::id 
)

Create variable/value pair and left concatenate to a homomorphism.

h(var,val,g) (d) = DDD(var,val) ^ g(d). In other words : var – val -> g

Parameters
varthe variable index
valthe value associated to the variable
hthe homomorphism to apply on successor node. Default is identity, so is equivalent to a left concatenation of a DDD(var,val).

◆ ~MLHom()

MLHom::~MLHom ( )
virtual

Member Function Documentation

◆ eval()

HomNodeMap MLHom::eval ( const GDDD d) const

The computation function responsible for evaluation over a node.

Users should not directly use this. Normal behavior is to use operator() that encapsulates this call with operation caching.

References concret, and _MLHom::eval().

◆ garbage()

void MLHom::garbage ( )
static

Collects and destroys unused homomorphisms.

Do not call this directly but through MemoryManager::garbage() as order of calls (among GSDD::garbage(), GShom::garbage(), SDED::garbage()) is important.

References canonical, MLCache< MLHomType, NodeType, HomNodeMapType >::clear(), _MLHom::marking, and nsMLHom::mlcache.

Referenced by MemoryManager::garbage().

◆ hash()

size_t MLHom::hash ( ) const
inline

Hash key computation.

It is essential for good hash table operation that the spread of the keys be as good as possible. Also, fast hash key computation is a good design goal. Note that bad hash functions will yield more collisions, thus equality comparisons which may be quite costly.

References concret, and ddd::knuth32_hash().

Referenced by MLHomAdapter::hash(), nsMLHom::ConstantUp::hash(), and nsMLHom::LeftConcat::hash().

◆ operator()()

HomNodeMap MLHom::operator() ( const GDDD d) const

◆ operator<()

bool MLHom::operator< ( const MLHom h) const
inline

References concret.

◆ operator==()

bool MLHom::operator== ( const MLHom h) const
inline

References concret.

Friends And Related Symbol Documentation

◆ operator+

MLHom operator+ ( const MLHom ,
const MLHom  
)
friend

By definition, as homomorphism are linear, (h+g) (d) = h(d) + g(d) ;.

Where g,h are homomorphisms and d is a DDD.

This commutative operation computes a homomorphism that evaluates as the sum of two homomorphism.

Semantics : (h1 + h2) (d) = h1(d) + h2(d).

Member Data Documentation

◆ concret

const _MLHom* MLHom::concret
private

The real implementation class.

All true operations are delagated on this pointer. Construction/destruction take care of ensuring concret is only instantiated once in memory.

Referenced by eval(), hash(), operator<(), and operator==().

◆ id

const MLHom MLHom::id
static

Elementary homomorphism Identity, defined as a constant.

id(d) = <id, d>


The documentation for this class was generated from the following files:

Please comment this page and report errors about it on the RefDocComments page.
Generated on Wed Apr 9 2025 15:27:42 for DDD by doxygen 1.9.8