Generic Group. More...
#include <galilei.h>
Public Member Functions | |
GGroup (GSession *session, size_t id, size_t blockid, const R::RString &name, const R::RDate &u, const R::RDate &c) | |
GSubjectData< cObj > * | GetData (void) const |
int | Compare (const GGroup &grp) const |
R::RDate | GetUpdated (void) const |
R::RDate | GetComputed (void) const |
virtual GMeasure * | GetSimMeasure (void) const =0 |
bool | IsIn (const cObj *obj) const |
void | DeleteObj (cObj *obj) |
void | InsertObj (cObj *obj) |
void | InsertObjs (R::RCursor< cObj > objs) |
void | InsertPtr (cObj *obj) |
void | DeleteObjs (void) |
R::RCursor< cObj > | GetObjs (void) const |
R::RCursor< cObj > | GetCursor (void) const |
size_t | GetNbObjs (void) const |
cObj * | RelevantObj (void) const |
cObj * | RelevantObj (double &avgsim) const |
double | ComputeSumSim (GMeasure *measure, const cObj *obj) const |
void | Clear (bool disk) |
size_t | GetNbObjs (const GSubject *subject) const |
void | HasUpdate (cObj *obj) |
virtual | ~GGroup (void) |
Public Member Functions inherited from GDescriptionObject< cGroup > | |
GDescriptionObject (GSession *session, size_t id, size_t blockid, tObjType objtype, const R::RString &name) | |
void | ReleaseVectors (void) |
const GDescription & | operator() (void) const |
R::RConstCursor< GVector > | GetVectors (void) const |
const GVector * | GetVector (GConcept *metaconcept) const |
bool | IsIn (const GConcept *concept) const |
bool | IsDefined (void) const |
tObjState | GetState (void) const |
size_t | GetId (void) const |
size_t | GetBlockId (void) const |
virtual | ~GDescriptionObject (void) |
Public Member Functions inherited from GObject | |
GObject (GSession *session, size_t id, const R::RString &name, tObjType type) | |
GObject (const GObject &obj) | |
void | VerifyStatements (tStatementElement what, size_t size) |
int | Compare (const GObject &obj) const |
int | Compare (size_t id) const |
int | Search (const GObject &obj) const |
int | Search (const R::RString &name) const |
virtual R::RCString | GetClassName (void) const |
GSession * | GetSession (void) const |
size_t | GetId (void) const |
void | SetId (size_t id) |
tObjType | GetObjType (void) const |
R::RCursor< GStatement > | GetObjs (const GStatement *obj, tStatementElement what) |
virtual void | HandlerNotFound (const R::RNotification ¬ification) |
virtual | ~GObject (void) |
Public Member Functions inherited from RObject | |
RObject (const RString &name=RString::Null) | |
int | Compare (const RObject &obj) const |
RString | GetName (void) const |
void | PostNotification (const hNotification handle) |
void | PostNotification (const RCString &name) |
void | PostNotification (const hNotification handle, T data) |
void | PostNotification (const RCString &name, T data) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const RCString &name, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle) |
void | InsertObserver (tNotificationHandler handler, const RCString &name) |
void | InsertObserver (tNotificationHandler handler, RObject *object) |
void | InsertObserver (tNotificationHandler handler) |
void | DeleteObserver (void) |
void | DeleteObserver (const hNotification handle, RObject *object) |
void | DeleteObserver (const RCString &name, RObject *object) |
hNotification | GetNotificationHandle (const RCString &name) const |
RCString | GetNotificationName (const hNotification handle) const |
virtual | ~RObject (void) |
Protected Attributes | |
R::RDate | Updated |
R::RDate | Computed |
GSubjectData< cObj > * | Data |
Protected Attributes inherited from iRContainer< C > | |
C ** | Tab |
size_t | NbPtr |
size_t | MaxPtr |
size_t | LastPtr |
size_t | IncPtr |
Protected Attributes inherited from GDescriptionObject< cGroup > | |
tObjState | State |
Protected Attributes inherited from GObject | |
GSession * | Session |
size_t | Id |
tObjType | ObjType |
R::RContainer< GStatement, false, true > * | Subjects |
R::RContainer< GStatement, false, false > * | Predicates |
R::RContainer< GStatement, false, false > * | Values |
Protected Attributes inherited from RObject | |
RString | Name |
Additional Inherited Members | |
Static Public Member Functions inherited from GDescriptionObject< cGroup > | |
static bool | HasDesc (void) |
Static Public Member Functions inherited from GObject | |
static bool | HasDesc (void) |
static bool | HasTree (void) |
Protected Member Functions inherited from RContainer< cObj, false, true > | |
RContainer (size_t m, size_t i=0) | |
RContainer (const RContainer< cObj, true, true > &src) | |
RContainer (const RContainer< cObj, false, true > &src) | |
int | Compare (const RContainer< cObj, false, true > &) const |
size_t | GetNb (void) const |
size_t | GetMaxPos (void) const |
size_t | GetMaxNb (void) const |
size_t | GetIncNb (void) const |
bool | VerifyIndex (size_t idx) const |
void | VerifyTab (size_t max=0) |
void | Clear (size_t m=0, size_t i=0, bool force=false) |
void | ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max) |
void | ReOrder (int sortOrder(const void *, const void *)) |
void | ReOrder (void) |
void | Exchange (size_t pos1, size_t pos2) |
void | Shift (size_t idx, bool reverse) |
void | Transfer (RContainer< cObj, a, o > &src) |
RContainer & | operator= (const RContainer< cObj, true, true > &src) |
RContainer & | operator= (const RContainer< cObj, false, true > &src) |
void | Copy (const RContainer< cObj, a, true > &src) |
RContainer & | operator+= (const RContainer< cObj, a, o > &src) |
size_t | GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, size_t min=0, size_t max=0) const |
const cObj * | operator[] (size_t idx) const |
cObj * | operator[] (size_t idx) |
const cObj * | GetPtrAt (size_t idx) const |
cObj * | GetPtrAt (size_t idx) |
cObj * | GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
cObj * | GetPtr (const TUse &tag, size_t min=0, size_t max=0) const |
cObj * | GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
cObj * | GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0) |
cObj * | GetInsertPtrAt (const TUse &tag, size_t pos) |
RContainer< cObj, false, true > * | GetPtrs (const TUse &tag, size_t min=0, size_t max=0) const |
size_t | GetTab (const void **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (void **tab, size_t min=0, size_t max=0) |
size_t | GetTab (const cObj **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (cObj **tab, size_t min=0, size_t max=0) |
void | InsertPtrAt (cObj *ins, size_t pos, bool del) |
void | InsertPtrAt (cObj *ins, size_t pos) |
void | InsertPtr (cObj *ins, bool del=false, size_t min=0, size_t max=0) |
void | DeletePtrAt (size_t pos, bool shift, bool del) |
void | DeletePtrAt (size_t pos, bool shift) |
void | DeletePtrAt (size_t pos) |
void | DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, size_t min=0, size_t max=0) |
void | Inter (const iRContainer< cObj > &src1, const iRContainer< cObj > &src2) |
void | Union (const iRContainer< cObj > &src1, const iRContainer< cObj > &src2) |
virtual | ~RContainer (void) |
Protected Member Functions inherited from iRContainer< C > | |
void | Create (const iRContainer< C > &src) |
iRContainer & | NormalCopy (const iRContainer< C > &src) |
void | DeepCopy (const iRContainer< C > &src) |
iRContainer & | Add (const iRContainer< C > &src) |
size_t | GetNb (void) const |
size_t | GetMaxPos (void) const |
size_t | GetMaxNb (void) const |
size_t | GetIncNb (void) const |
bool | VerifyIndex (size_t idx) const |
void | VerifyTab (size_t max=0) |
void | Clear (size_t m=0, size_t i=0, bool force=false) |
void | ReOrder (int sortOrder(const void *, const void *), size_t min, size_t max) |
void | ReOrder (int sortOrder(const void *, const void *)) |
void | ReOrder (void) |
void | Exchange (size_t pos1, size_t pos2) |
void | Shift (size_t idx, bool reverse) |
void | Transfer (iRContainer< C > &src) |
iRContainer & | operator= (const iRContainer< C > &src) |
void | Copy (const iRContainer< C > &src) |
iRContainer & | operator+= (const iRContainer< C > &src) |
size_t | GetIndex (bool order, const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
size_t | GetIndex (const TUse &tag, bool &find, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
bool | IsIn (const TUse &tag, size_t min=0, size_t max=0) const |
const C * | operator[] (size_t idx) const |
C * | operator[] (size_t idx) |
const C * | GetPtrAt (size_t idx) const |
C * | GetPtrAt (size_t idx) |
C * | GetPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) const |
C * | GetPtr (const TUse &tag, size_t min=0, size_t max=0) const |
C * | GetInsertPtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
C * | GetInsertPtr (const TUse &tag, size_t min=0, size_t max=0) |
C * | GetInsertPtrAt (const TUse &tag, size_t pos) |
size_t | GetTab (const void **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (void **tab, size_t min=0, size_t max=0) |
size_t | GetTab (const C **tab, size_t min=0, size_t max=0) const |
size_t | GetTab (C **tab, size_t min=0, size_t max=0) |
void | InsertPtrAt (C *ins, size_t pos, bool del) |
void | InsertPtrAt (C *ins, size_t pos) |
void | InsertPtr (C *ins, bool del=false, size_t min=0, size_t max=0) |
void | DeletePtrAt (size_t pos, bool shift, bool del) |
void | DeletePtrAt (size_t pos, bool shift) |
void | DeletePtrAt (size_t pos) |
void | DeletePtr (const TUse &tag, bool sortkey, bool del, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, bool sortkey, size_t min=0, size_t max=0) |
void | DeletePtr (const TUse &tag, size_t min=0, size_t max=0) |
void | Inter (const iRContainer< C > &src1, const iRContainer< C > &src2) |
void | Union (const iRContainer< C > &src1, const iRContainer< C > &src2) |
virtual | ~iRContainer (void) |
Protected Member Functions inherited from GDescriptionObject< cGroup > | |
virtual bool | LoadVectors (void) |
GDescriptionObject (GSession *session, size_t id, size_t blockid, tObjType objtype, const R::RString &name) | |
void | ReleaseVectors (void) |
const GDescription & | operator() (void) const |
R::RConstCursor< GVector > | GetVectors (void) const |
const GVector * | GetVector (GConcept *metaconcept) const |
bool | IsIn (const GConcept *concept) const |
bool | IsDefined (void) const |
tObjState | GetState (void) const |
size_t | GetId (void) const |
size_t | GetBlockId (void) const |
virtual | ~GDescriptionObject (void) |
Protected Member Functions inherited from GObject | |
GObject (GSession *session, size_t id, const R::RString &name, tObjType type) | |
GObject (const GObject &obj) | |
void | VerifyStatements (tStatementElement what, size_t size) |
int | Compare (const GObject &obj) const |
int | Compare (size_t id) const |
int | Search (const GObject &obj) const |
int | Search (const R::RString &name) const |
virtual R::RCString | GetClassName (void) const |
GSession * | GetSession (void) const |
size_t | GetId (void) const |
void | SetId (size_t id) |
tObjType | GetObjType (void) const |
R::RCursor< GStatement > | GetObjs (const GStatement *obj, tStatementElement what) |
virtual void | HandlerNotFound (const R::RNotification ¬ification) |
virtual | ~GObject (void) |
Protected Member Functions inherited from RObject | |
RObject (const RString &name=RString::Null) | |
int | Compare (const RObject &obj) const |
RString | GetName (void) const |
void | PostNotification (const hNotification handle) |
void | PostNotification (const RCString &name) |
void | PostNotification (const hNotification handle, T data) |
void | PostNotification (const RCString &name, T data) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const RCString &name, RObject *object) |
void | InsertObserver (tNotificationHandler handler, const hNotification handle) |
void | InsertObserver (tNotificationHandler handler, const RCString &name) |
void | InsertObserver (tNotificationHandler handler, RObject *object) |
void | InsertObserver (tNotificationHandler handler) |
void | DeleteObserver (void) |
void | DeleteObserver (const hNotification handle, RObject *object) |
void | DeleteObserver (const RCString &name, RObject *object) |
hNotification | GetNotificationHandle (const RCString &name) const |
RCString | GetNotificationName (const hNotification handle) const |
virtual | ~RObject (void) |
Static Protected Member Functions inherited from RContainer< cObj, false, true > | |
static int | SortOrder (const void *a, const void *b) |
Static Protected Member Functions inherited from iRContainer< C > | |
static int | SortOrder (const void *a, const void *b) |
Static Protected Member Functions inherited from GDescriptionObject< cGroup > | |
static bool | HasDesc (void) |
Static Protected Member Functions inherited from GObject | |
static bool | HasDesc (void) |
static bool | HasTree (void) |
Detailed Description
template<class cObj, class cGroup, tObjType type>
singleton GALILEI::GGroup< cObj, cGroup, type >
Generic Group.
This class represent a generic group of objects represented by GWeightInfos.
- Template Parameters
-
cObj Object contained. cGroup Group. type Type of the object.
Constructor & Destructor Documentation
GGroup | ( | GSession * | session, |
size_t | id, | ||
size_t | blockid, | ||
const R::RString & | name, | ||
const R::RDate & | u, | ||
const R::RDate & | c | ||
) |
Construct a group with a specific identifier.
- Parameters
-
session Session. id Identifier. blockid Identifier of the block. name Name of the group. u Date of the last updated. c Date of the last computation.
|
virtual |
Destruct the group.
Member Function Documentation
GSubjectData<cObj>* GetData | ( | void | ) | const |
Get the data associated to the corresponding ideal subject.
- Returns
int Compare | ( | const GGroup< cObj, cGroup, type > & | grp | ) | const |
Compare two groups by comparing their identifier.
- See also
- R::RContainer
- Parameters
-
grp Group.
- Returns
- int
R::RDate GetComputed | ( | void | ) | const |
Get the date of the last analysis of the objects.
- Returns
- R::RDate.
|
pure virtual |
Get the similarity measure that must be used when computing the similarity between the objects grouped. An example for profiles:
Implemented in GCommunity, and GTopic.
bool IsIn | ( | const cObj * | obj | ) | const |
Look if a given object is in the group.
- Parameters
-
obj Object.
void DeleteObj | ( | cObj * | obj | ) |
Delete an object from the group. If the group is a Group, the method modifies the assignment of the object (the 'Group' pointer). of the object is set to null).
- Parameters
-
obj Object to delete.
void InsertObj | ( | cObj * | obj | ) |
Insert a object in the group. If the group is a Group, the method modifies the assignment of the object (the 'Group' pointer). of the object is set to null).
- Parameters
-
obj Object to insert.
void InsertObjs | ( | R::RCursor< cObj > | objs | ) |
Insert a set of objects in the group. If the group is a Group, the method modifies the assignment of the object (the 'Group' pointer). of the object is set to null).
- Parameters
-
objs Objects to insert.
void InsertPtr | ( | cObj * | obj | ) |
Insert a object in the group. This signature is needed by a generic k-Means.
- Parameters
-
obj Object to insert.
- See also
- R::RGroupingKMeans.
void DeleteObjs | ( | void | ) |
Delete all objects.
R::RCursor<cObj> GetObjs | ( | void | ) | const |
Get a cursor over the objects.
R::RCursor<cObj> GetCursor | ( | void | ) | const |
Get a cursor over the objects. This signature is needed by a generic k-Means.
- See also
- R::RGroupingKMeans.
size_t GetNbObjs | ( | void | ) | const |
Get the number of objects in the group.
cObj* RelevantObj | ( | void | ) | const |
Compute the relevant object, i.e. the object with the highest average similarity with all the other objects.
- Returns
- Pointer to cObj representing the relevant one.
cObj* RelevantObj | ( | double & | avgsim | ) | const |
Compute the relevant object, i.e. the object with the highest average similarity with all the other objects.
- Parameters
-
avgsim Variable that will contain the average similarity of the objects with the centroid.
- Returns
- Pointer to cObj representing the relevant one.
double ComputeSumSim | ( | GMeasure * | measure, |
const cObj * | obj | ||
) | const |
Compute the sum of the similarities of a given object to all the others.
- Parameters
-
measure The measure used to compute the similarities. obj Object used as reference.
- Returns
- result.
void Clear | ( | bool | disk | ) |
Clear the vector representing the group.
- Parameters
-
disk Clear the reference to the corresponding block on disk.
size_t GetNbObjs | ( | const GSubject * | subject | ) | const |
Compute the number of objects of a given group that are also in a subject.
- Parameters
-
subject Subject.
void HasUpdate | ( | cObj * | obj | ) |
This method is call by a object when it was modified.
- Parameters
-
obj Object modified.
Member Data Documentation
|
protected |
Date of the update (objects have changed).
|
protected |
Date of last objects computing.
|
protected |
Data associated to the corresponding ideal subject.