Description. More...
#include <gdescription.h>
Public Member Functions | |
GDescription (void) | |
GDescription (const GDescription &src) | |
int | Compare (const GDescription &) const |
void | ReleaseVectors (void) |
R::RConstCursor< GVector > | GetVectors (void) const |
R::RCursor< GVector > | GetVectors (void) |
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) |
template<class S > | |
void | Print (S &stream, const R::RString &name, const char *format="%E", size_t colsize=12) const |
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) |
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 |
Destruct the object.
Member Function Documentation
|
protectedvirtual |
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 >, and GDescriptionObject< GProfile >.
int Compare | ( | const GDescription & | ) | const |
void ReleaseVectors | ( | void | ) |
Release the vectors from memory.
R::RConstCursor<GVector> GetVectors | ( | void | ) | const |
Get the vectors associated to the object. The whole description is loaded if necessary.
- Returns
- a cursor of GVector.
R::RCursor<GVector> GetVectors | ( | void | ) |
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).
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.
bool IsIn | ( | const GConcept * | concept | ) | const |
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.
|
protected |
Copy a list of object references to the object for a given meta-concept.
- Parameters
-
metaconcept Meta-concept. list List of concept references.
void Normalize | ( | void | ) |
Normalize the vectors.
void Print | ( | S & | stream, |
const R::RString & | name, | ||
const char * | format = "%E" , |
||
size_t | colsize = 12 |
||
) | const |
Print the content of the description.
- Template Parameters
-
S Stream class that implements the << operator.
- Parameters
-
stream Stream. name Name of the vector. format Format used to print the number. By default, it is "%E". colsize Size of a column. By default, it is 12.
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
|
protected |
Vectors.