GClasses
|
#include <GMatrix.h>
Public Member Functions | |
GMixedRelation () | |
Makes an empty relation. | |
GMixedRelation (std::vector< size_t > &attrValues) | |
Construct a mixed relation. attrValues specifies the number of nominal values in each attribute (column), or 0 for continuous attributes. | |
GMixedRelation (GDomNode *pNode) | |
Loads from a DOM. | |
GMixedRelation (GRelation *pCopyMe) | |
Makes a copy of pCopyMe. | |
GMixedRelation (GRelation *pCopyMe, size_t firstAttr, size_t attrCount) | |
Makes a copy of the specified range of pCopyMe. | |
virtual | ~GMixedRelation () |
virtual RelationType | type () |
Returns the type of relation. | |
virtual GDomNode * | serialize (GDom *pDoc) |
Marshalls this object to a DOM, which can be saved to a variety of serial formats. | |
virtual GRelation * | clone () |
Makes a deep copy of this relation. | |
virtual GRelation * | cloneSub (size_t start, size_t count) |
Makes a deep copy of the specified subset of this relation. | |
virtual void | flush () |
Deletes all the attributes. | |
void | addAttr (size_t nValues) |
If nValues is zero, adds a real attribute. If nValues is > 0, adds an attribute with "nValues" nominal values. | |
void | addAttrs (size_t attrCount, size_t valueCount) |
Adds "attrCount" new attributes, each with "valueCount" values. (Use valueCount=0 for continuous attributes.) | |
void | addAttrs (GRelation *pCopyMe, size_t firstAttr=0, size_t attrCount=(size_t)-1) |
Copies the specified attributes and adds them to this relation. If attrCount < 0, then it will copy all attributes from firstAttr to the end. | |
void | copy (GRelation *pCopyMe) |
Flushes this relation and then copies all of the attributes from pCopyMe. | |
virtual void | copyAttr (GRelation *pThat, size_t nAttr) |
Adds a copy of the specified attribute to this relation. | |
virtual size_t | size () |
Returns the total number of attributes in this relation. | |
virtual size_t | valueCount (size_t nAttr) |
Returns the number of nominal values in the specified attribute. | |
virtual void | setAttrValueCount (size_t nAttr, size_t nValues) |
Sets the number of values for this attribute. | |
virtual bool | areContinuous (size_t first, size_t count) |
Returns true of all of the attributes in the specified range are continuous. | |
virtual bool | areNominal (size_t first, size_t count) |
Returns true of all of the attributes in the specified range are nominal. | |
virtual void | swapAttributes (size_t nAttr1, size_t nAttr2) |
Swaps two columns. | |
virtual void | deleteAttribute (size_t nAttr) |
Deletes an attribute. | |
Protected Attributes | |
std::vector< size_t > | m_valueCounts |
GClasses::GMixedRelation::GMixedRelation | ( | ) |
Makes an empty relation.
GClasses::GMixedRelation::GMixedRelation | ( | std::vector< size_t > & | attrValues | ) |
Construct a mixed relation. attrValues specifies the number of nominal values in each attribute (column), or 0 for continuous attributes.
GClasses::GMixedRelation::GMixedRelation | ( | GDomNode * | pNode | ) |
Loads from a DOM.
GClasses::GMixedRelation::GMixedRelation | ( | GRelation * | pCopyMe | ) |
Makes a copy of pCopyMe.
GClasses::GMixedRelation::GMixedRelation | ( | GRelation * | pCopyMe, |
size_t | firstAttr, | ||
size_t | attrCount | ||
) |
Makes a copy of the specified range of pCopyMe.
virtual GClasses::GMixedRelation::~GMixedRelation | ( | ) | [virtual] |
void GClasses::GMixedRelation::addAttr | ( | size_t | nValues | ) |
If nValues is zero, adds a real attribute. If nValues is > 0, adds an attribute with "nValues" nominal values.
void GClasses::GMixedRelation::addAttrs | ( | GRelation * | pCopyMe, |
size_t | firstAttr = 0 , |
||
size_t | attrCount = (size_t)-1 |
||
) |
Copies the specified attributes and adds them to this relation. If attrCount < 0, then it will copy all attributes from firstAttr to the end.
void GClasses::GMixedRelation::addAttrs | ( | size_t | attrCount, |
size_t | valueCount | ||
) |
Adds "attrCount" new attributes, each with "valueCount" values. (Use valueCount=0 for continuous attributes.)
virtual bool GClasses::GMixedRelation::areContinuous | ( | size_t | first, |
size_t | count | ||
) | [virtual] |
Returns true of all of the attributes in the specified range are continuous.
Implements GClasses::GRelation.
virtual bool GClasses::GMixedRelation::areNominal | ( | size_t | first, |
size_t | count | ||
) | [virtual] |
Returns true of all of the attributes in the specified range are nominal.
Implements GClasses::GRelation.
virtual GRelation* GClasses::GMixedRelation::clone | ( | ) | [virtual] |
Makes a deep copy of this relation.
Implements GClasses::GRelation.
Reimplemented in GClasses::GArffRelation.
virtual GRelation* GClasses::GMixedRelation::cloneSub | ( | size_t | start, |
size_t | count | ||
) | [virtual] |
Makes a deep copy of the specified subset of this relation.
Implements GClasses::GRelation.
Reimplemented in GClasses::GArffRelation.
void GClasses::GMixedRelation::copy | ( | GRelation * | pCopyMe | ) |
Flushes this relation and then copies all of the attributes from pCopyMe.
virtual void GClasses::GMixedRelation::copyAttr | ( | GRelation * | pThat, |
size_t | nAttr | ||
) | [virtual] |
Adds a copy of the specified attribute to this relation.
Reimplemented in GClasses::GArffRelation.
virtual void GClasses::GMixedRelation::deleteAttribute | ( | size_t | nAttr | ) | [virtual] |
virtual void GClasses::GMixedRelation::flush | ( | ) | [virtual] |
Deletes all the attributes.
Reimplemented in GClasses::GArffRelation.
Marshalls this object to a DOM, which can be saved to a variety of serial formats.
Implements GClasses::GRelation.
virtual void GClasses::GMixedRelation::setAttrValueCount | ( | size_t | nAttr, |
size_t | nValues | ||
) | [virtual] |
Sets the number of values for this attribute.
Reimplemented in GClasses::GArffRelation.
virtual size_t GClasses::GMixedRelation::size | ( | ) | [inline, virtual] |
Returns the total number of attributes in this relation.
Implements GClasses::GRelation.
virtual void GClasses::GMixedRelation::swapAttributes | ( | size_t | nAttr1, |
size_t | nAttr2 | ||
) | [virtual] |
virtual RelationType GClasses::GMixedRelation::type | ( | ) | [inline, virtual] |
Returns the type of relation.
Implements GClasses::GRelation.
Reimplemented in GClasses::GArffRelation.
virtual size_t GClasses::GMixedRelation::valueCount | ( | size_t | nAttr | ) | [inline, virtual] |
Returns the number of nominal values in the specified attribute.
Implements GClasses::GRelation.
std::vector<size_t> GClasses::GMixedRelation::m_valueCounts [protected] |