Description. More...

#include <gdescription.h>

Inheritance diagram for GDescription:
[legend]

Public Member Functions

 GDescription (void)
 
 GDescription (const GDescription &src)
 
int Compare (const GDescription &) const
 
void ReleaseVectors (void)
 
R::RConstCursor< GVectorGetVectors (void) const
 
R::RCursor< GVectorGetVectors (void)
 
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)
 
template<class S >
void Print (S &stream, const R::RString &name, const char *format="%E", size_t colsize=12) const
 
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)
 

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
srcSource description.
virtual ~GDescription ( void  )
virtual

Destruct the object.

Member Function Documentation

virtual bool LoadVectors ( void  )
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

Compare method used by R::RContainer.

Parameters
descDescription to compare with.
Returns
always -1.
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.
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.
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.

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.
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
SStream class that implements the << operator.
Parameters
streamStream.
nameName of the vector.
formatFormat used to print the number. By default, it is "%E".
colsizeSize of a column. By default, it is 12.
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.