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

#include <MLSHom.h>

Collaboration diagram for MLShom:
Collaboration graph

Public Member Functions

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

Static Public Member Functions

static void garbage ()
 Collects and destroys unused homomorphisms.
 

Static Public Attributes

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

Private Attributes

const _MLShomconcret
 The real implementation class.
 

Friends

MLShom operator+ (const MLShom &, const MLShom &)
 By definition, as homomorphism are linear, (h+g) (d) = h(d) + g(d) ; Where g,h are homomorphisms and d is a SDDD.
 

Constructor & Destructor Documentation

◆ MLShom() [1/7]

MLShom::MLShom ( )
inline

Default public constructor.

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

◆ MLShom() [2/7]

MLShom::MLShom ( const GShom h)

◆ MLShom() [3/7]

MLShom::MLShom ( const GShom up,
const MLShom down 
)

◆ MLShom() [4/7]

MLShom::MLShom ( const _MLShom h)

◆ MLShom() [5/7]

MLShom::MLShom ( _MLShom )

◆ MLShom() [6/7]

MLShom::MLShom ( const _MLShom h)

◆ MLShom() [7/7]

MLShom::MLShom ( int  var,
const DataSet val,
const MLShom h = MLShom::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).

◆ ~MLShom()

MLShom::~MLShom ( )
virtual

Member Function Documentation

◆ eval()

SHomNodeMap MLShom::eval ( const GSDD ) 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.

◆ garbage()

void MLShom::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, and _MLShom::marking.

◆ hash()

size_t MLShom::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 nsMLShom::ConstantUp::hash(), nsMLShom::LeftConcat::hash(), and sns::MLShomAdapter::hash().

◆ operator()()

SHomNodeMap MLShom::operator() ( const GSDD d) const

cache calls to eval

References concret, and _MLShom::eval().

◆ operator<()

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

References concret.

◆ operator==()

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

References concret.

Friends And Related Symbol Documentation

◆ operator+

MLShom operator+ ( const MLShom ,
const MLShom  
)
friend

By definition, as homomorphism are linear, (h+g) (d) = h(d) + g(d) ; Where g,h are homomorphisms and d is a SDDD.

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 _MLShom* MLShom::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 hash(), operator()(), operator<(), and operator==().

◆ id

const MLShom MLShom::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