Description. More...
#include <gdescription.h>
Public Member Functions | |
| GDescription (void) | |
| GDescription (const GDescription &src) | |
| int | Compare (const GDescription &) const |
| R::RCursor< GVector > | GetVectors (void) const |
| const GVector * | GetVector (GConcept *metaconcept) const |
| GVector * | GetVector (GConcept *metaconcept) |
| GVector * | GetInsertVector (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) |
| GDescription & | operator= (const GDescription &desc) |
| GDescription & | operator+= (const GDescription &desc) |
| GDescription & | operator-= (const GDescription &desc) |
| GDescription & | operator*= (const double nb) |
| GDescription & | operator/= (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.
Constructor & Destructor Documentation
| GDescription | ( | void | ) |
Construct a description.
| GDescription | ( | const GDescription & | src | ) |
Copy constructor.
- Parameters:
-
src Source 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:
-
desc Description 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.
Get the vector associated to a meta-concept. The whole description is loaded if necessary.
- Parameters:
-
metaconcept Meta-concept.
- Returns:
- a pointer to a GVector (may be null if the meta-concept isn't found).
Get the vector associated to a meta-concept. The whole description is loaded if necessary.
- Parameters:
-
metaconcept Meta-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:
-
metaconcept Meta-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:
-
metaconcept Meta-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 >.
Verify if a given concept is in one of the vectors.
- Parameters:
-
concept Concept.
- 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:
-
metaconcept Meta-concept. list List of concept references.
Reimplemented in GDescriptionObject< C >, GDescriptionObject< GClass >, GDescriptionObject< cGroup >, GDescriptionObject< GDoc >, GDescriptionObject< GProfile >, GDescriptionObject< GTopic >, and GDescriptionObject< GCommunity >.
Add the references for the concepts for a given object type. This information is used for the inverse frequency factors.
- Parameters:
-
session Session. ObjType Object type.
Delete the references for the concepts for a given object type. This information is used for the inverse frequency factors.
- Parameters:
-
session Session. ObjType Object 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:
-
set Document Set.
| GDescription& operator= | ( | const GDescription & | desc | ) |
Assignment operator for the descriptions.
- Parameters:
-
desc Description to assign.
| GDescription& operator+= | ( | const GDescription & | desc | ) |
Addition operator for the descriptions.
- Parameters:
-
desc Description to add.
| GDescription& operator-= | ( | const GDescription & | desc | ) |
Subtraction operator for the descriptions.
- Parameters:
-
desc Description to subtract.
| GDescription& operator*= | ( | const double | nb | ) |
Multiplication operator for the descriptions.
- Parameters:
-
nb Number to multiply by.
| GDescription& operator/= | ( | const double | nb | ) |
Division operator for the descriptions.
- Parameters:
-
nb Number to multiply by.
Member Data Documentation
R::RContainer<GVector,true,true>* Vectors [protected] |
Vectors.