Description. More...

#include <gdescription.h>

Inheritance diagram for GDescription:
[legend]

List of all members.

Public Member Functions

 GDescription (void)
 GDescription (const GDescription &src)
int Compare (const GDescription &) const
R::RCursor< GVectorGetVectors (void) const
const GVectorGetVector (GConcept *metaconcept) const
GVectorGetVector (GConcept *metaconcept)
GVectorGetInsertVector (GConcept *metaconcept)
void DeleteVector (GConcept *metaconcept)
bool IsDefined (void) const
bool IsIn (const GConcept *concept) const
void Clear (void)
void Normalize (void)
void MultiplyIF (GDescriptionSet &set)
GDescriptionoperator= (const GDescription &desc)
GDescriptionoperator+= (const GDescription &desc)
GDescriptionoperator-= (const GDescription &desc)
GDescriptionoperator*= (const double nb)
GDescriptionoperator/= (const double nb)
virtual ~GDescription (void)

Protected Member Functions

virtual bool LoadVectors (void)
void Copy (GConcept *metaconcept, const R::RContainer< GConceptRef, false, true > &list)
void AddRefs (GSession *session, tObjType ObjType) const
void DelRefs (GSession *session, tObjType ObjType) const

Protected Attributes

R::RContainer< GVector, true,
true > * 
Vectors

Detailed Description

Description.

The GDescription provides a representation for a tensor in the tensor space model. In practice, it is implemented as a set of vectors. Such a tensor is used for computations or to describe objects.

The GDescriptionObject class provides a generic class for an object described as a tensor.

Author:
Pascal Francq

Constructor & Destructor Documentation

GDescription ( void  )

Construct a description.

GDescription ( const GDescription src)

Copy constructor.

Parameters:
srcSource description.
virtual ~GDescription ( void  ) [virtual]

Destruct the object.


Member Function Documentation

virtual bool LoadVectors ( void  ) [protected, virtual]

Load the vectors from the disk. By default, this method does nothing. It must be overloaded by objects that are represented with a description.

Returns:
true if the vectors was loaded.

Reimplemented in GDescriptionObject< C >, GDescriptionObject< GClass >, GDescriptionObject< cGroup >, GDescriptionObject< GDoc >, GDescriptionObject< GProfile >, GDescriptionObject< GTopic >, and GDescriptionObject< GCommunity >.

int Compare ( const GDescription ) const

Compare method used by R::RContainer.

Parameters:
descDescription to compare with.
Returns:
always -1.
R::RCursor<GVector> GetVectors ( void  ) const

Get the vectors associated to the object. The whole description is loaded if necessary.

Returns:
a cursor of GVector.
const GVector* GetVector ( GConcept metaconcept) const

Get the vector associated to a meta-concept. The whole description is loaded if necessary.

Parameters:
metaconceptMeta-concept.
Returns:
a pointer to a GVector (may be null if the meta-concept isn't found).
GVector* GetVector ( GConcept metaconcept)

Get the vector associated to a meta-concept. The whole description is loaded if necessary.

Parameters:
metaconceptMeta-concept.
Returns:
a pointer to a GVector (may be null if the meta-concept isn't found).
GVector* GetInsertVector ( GConcept metaconcept)

Get the vector associated to meta-concept. When not existing, the vector is created. The whole description is loaded if necessary.

Parameters:
metaconceptMeta-concept.
Returns:
a pointer to a GVector.
void DeleteVector ( GConcept metaconcept)

Delete a vector associated to a meta-concept.

Warning:
If it is called for a class inheriting from GDescriptionObject, the references for that given object type are not deleted. The method should therefore never be called in that context.
Parameters:
metaconceptMeta-concept.
bool IsDefined ( void  ) const

Look if the description is defined : at least one of the vectors must be defined.

Returns:
true if defined.

Reimplemented in GDescriptionObject< C >, GDescriptionObject< GClass >, GDescriptionObject< cGroup >, GDescriptionObject< GDoc >, GDescriptionObject< GProfile >, GDescriptionObject< GTopic >, and GDescriptionObject< GCommunity >.

bool IsIn ( const GConcept concept) const

Verify if a given concept is in one of the vectors.

Parameters:
conceptConcept.
Returns:
true if the concept is contained.
void Clear ( void  )

Clear the vectors corresponding to the object.

Reimplemented in GSubject, GGroup< cObj, cGroup, type >, GGroup< GDoc, GTopic, otTopic >, GGroup< GProfile, GCommunity, otCommunity >, and GClass.

void Copy ( GConcept metaconcept,
const R::RContainer< GConceptRef, false, true > &  list 
) [protected]

Copy a list of object references to the object for a given meta-concept.

Parameters:
metaconceptMeta-concept.
listList of concept references.

Reimplemented in GDescriptionObject< C >, GDescriptionObject< GClass >, GDescriptionObject< cGroup >, GDescriptionObject< GDoc >, GDescriptionObject< GProfile >, GDescriptionObject< GTopic >, and GDescriptionObject< GCommunity >.

void AddRefs ( GSession session,
tObjType  ObjType 
) const [protected]

Add the references for the concepts for a given object type. This information is used for the inverse frequency factors.

Parameters:
sessionSession.
ObjTypeObject type.
void DelRefs ( GSession session,
tObjType  ObjType 
) const [protected]

Delete the references for the concepts for a given object type. This information is used for the inverse frequency factors.

Parameters:
sessionSession.
ObjTypeObject type.
void Normalize ( void  )

Normalize the vectors.

void MultiplyIF ( GDescriptionSet set)

Multiply each weight by its inverse frequency factor based on a given set.

Parameters:
setDocument Set.
GDescription& operator= ( const GDescription desc)

Assignment operator for the descriptions.

Parameters:
descDescription to assign.
GDescription& operator+= ( const GDescription desc)

Addition operator for the descriptions.

Parameters:
descDescription to add.
GDescription& operator-= ( const GDescription desc)

Subtraction operator for the descriptions.

Parameters:
descDescription to subtract.
GDescription& operator*= ( const double  nb)

Multiplication operator for the descriptions.

Parameters:
nbNumber to multiply by.
GDescription& operator/= ( const double  nb)

Division operator for the descriptions.

Parameters:
nbNumber to multiply by.

Member Data Documentation

R::RContainer<GVector,true,true>* Vectors [protected]

Vectors.