Concept Vector. More...
#include <gvector.h>
Public Member Functions | |
| GVector (GConcept *metaconcept) | |
| GVector (GConcept *metaconcept, size_t max) | |
| GVector (const GVector &vector) | |
| int | Compare (const GVector &vector) const |
| int | Compare (const GConcept &metaconcept) const |
| int | Compare (const GConcept *metaconcept) const |
| R::RCursor< GConceptRef > | GetRefs (void) const |
| GConcept * | GetMetaConcept (void) const |
| size_t | GetMetaConceptId (void) const |
| GConceptRef * | GetRef (const GConceptRef *ref) |
| GConceptRef * | GetRef (GConcept *concept) |
| void | InsertRef (GConceptRef *ref) |
| void | DeleteRef (GConceptRef *ref) |
| void | DeleteRef (const GConcept *concept) |
| bool | IsIn (const GConcept *concept) const |
| size_t | GetTab (const GConceptRef **tab) const |
| void | Clear (size_t size=0) |
| size_t | GetNb (void) const |
| bool | IsDefined (void) const |
| double | GetMaxWeight (void) const |
| double | GetMaxAbsWeight (void) const |
| void | Extract (GVector &vector, const GConceptType *type) |
| void | ComputeTfIdf (tObjType ObjType) |
| void | Print (R::RString msg) |
| void | Intersection (const GVector &vector) |
| GVector & | operator= (const GVector &vector) |
| GVector & | operator+= (const GVector &vector) |
| GVector & | operator-= (const GVector &vector) |
| GVector & | operator*= (const double nb) |
| GVector & | operator/= (const double nb) |
| virtual | ~GVector (void) |
Static Public Member Functions | |
| static int | SortOrder (const void *a, const void *b) |
Protected Member Functions | |
| void | Copy (const R::RContainer< GConceptRef, false, true > &vector) |
Detailed Description
Concept Vector.
The GVector provides a representation for a (sparse) vector of concept references associated with a given meta-concept. Each element of the vector is represented by a GConceptRef class.
In practice, several vectors are used to describe the object (document, profile, community or class) in the tensor space model.
Constructor & Destructor Documentation
Constructor of a vector.
- Parameters:
-
metaconcept Meta-concept associated with the vector.
Constructor of a vector.
- Parameters:
-
metaconcept Meta-concept associated with the vector. max Initial number of maximal references.
| virtual ~GVector | ( | void | ) | [virtual] |
Destruct the vector.
Member Function Documentation
| static int SortOrder | ( | const void * | a, |
| const void * | b | ||
| ) | [static] |
Static function used to order the concept weights.
- Parameters:
-
a Pointer to the first object. b Pointer to the second object.
Reimplemented from RContainer< GConceptRef, true, true >.
| void Copy | ( | const R::RContainer< GConceptRef, false, true > & | vector | ) | [protected] |
Copy method for the vectors.
- Parameters:
-
vector Source vector.
Compare two vectors using to their meta-concept.
- See also:
- R::RContainer
- Parameters:
-
vector Vector.
- Returns:
- int
Compare a vector and a meta-concept.
- See also:
- R::RContainer
- Parameters:
-
metaconcept Meta-concept.
- Returns:
- int
Compare a vector and a meta-concept.
- See also:
- R::RContainer
- Parameters:
-
metaconcept Meta-concept.
- Returns:
- int
| R::RCursor<GConceptRef> GetRefs | ( | void | ) | const |
Get a cursor on the concept references.
- Returns:
- a cursor of GConceptRef.
| GConcept* GetMetaConcept | ( | void | ) | const |
Get the meta-concept associated with the vector.
- Returns:
- a pointer to a GConcept.
| size_t GetMetaConceptId | ( | void | ) | const |
- Returns:
- the meta-concept identifier associated with the vector.
| GConceptRef* GetRef | ( | const GConceptRef * | ref | ) |
Get a concept reference based on a given one. If it is not found, it is created with a null weight.
- Parameters:
-
ref Concept reference.
- Returns:
- a pointer to a GConceptRef.
| GConceptRef* GetRef | ( | GConcept * | concept | ) |
Get a pointer to a concept reference based on a given concept. If it is not found, it is created with a null weight.
- Parameters:
-
concept Concept.
- Returns:
- a pointer to a GConceptRef.
| void InsertRef | ( | GConceptRef * | ref | ) |
Insert a concept reference.
- Parameters:
-
ref Concept reference.
| void DeleteRef | ( | GConceptRef * | ref | ) |
Delete a concept reference.
- Parameters:
-
ref Concept reference.
Delete an reference to a given concept.
- Parameters:
-
concept Concept.
Verify if a given concept is in the vector.
- Parameters:
-
concept Concept.
- Returns:
- true if the concept is contained.
| size_t GetTab | ( | const GConceptRef ** | tab | ) | const |
Fill an array with the concept references.
- Parameters:
-
tab Array to fill.
- Returns:
- the number of elements copied.
| void Clear | ( | size_t | size = 0 | ) |
Clear the vector and extend it if necessary.
- Parameters:
-
size Expected size of the vector.
| size_t GetNb | ( | void | ) | const |
- Returns:
- the number of elements in the container.
Reimplemented from RContainer< GConceptRef, true, true >.
| bool IsDefined | ( | void | ) | const |
Verifies if the vector is defined, i.e. if it has at least one element.
- Returns:
- true if the vector is defined.
| double GetMaxWeight | ( | void | ) | const |
Compute the maximal weight of the concept references in the vector.
- Returns:
- double.
| double GetMaxAbsWeight | ( | void | ) | const |
Compute the maximal absolute weight of the concept references in the vector.
- Returns:
- double.
| void Extract | ( | GVector & | vector, |
| const GConceptType * | type | ||
| ) |
Extract all concepts related to a given type an put them into a given vector that will be emptied.
- Parameters:
-
vector Destination vectors. type Type selected.
| void ComputeTfIdf | ( | tObjType | ObjType | ) |
Compute the Tf*Idf weights for all the elements of the vector.
- Parameters:
-
ObjType Type of the reference (documents, profiles, etc.).
| void Print | ( | R::RString | msg | ) |
Print the vector to the standard output.
- Parameters:
-
msg Header message.
| void Intersection | ( | const GVector & | vector | ) |
Build the intersection two vectors. In practice, the weight of the concept references in both vectors are added, the rest is deleted.
- Parameters:
-
vector Vector to search for the intersection.
- Warning:
- Only vectors associated with the same meta-concept can be compared.
Assignment operator for the vectors.
- Parameters:
-
vector Vector to assign.
Addition operator for the vectors.
- Parameters:
-
vector Vector to add.
- Warning:
- Only vectors associated with the same meta-concept can be added.
Subtraction operator for the vectors.
- Parameters:
-
vector Vector to subtract.
- Warning:
- Only vectors associated with the same meta-concept can be subtracted.
| GVector& operator*= | ( | const double | nb | ) |
Multiplication operator for the vectors.
- Parameters:
-
nb Number to multiply by.
| GVector& operator/= | ( | const double | nb | ) |
Division operator for the vectors.
- Parameters:
-
nb Number to multiply by.