a GMatrix with relation content set by setRation() function already. but i
want to only change the relation name or certain name of attribute. how to do?
You seem to have CSS turned off.
Please don't fill out this field.
1- call "GMatrix::relation()" to obtain a smart_ptr (see GHolders.h) that
references the relation.
2- call "smart_ptr::get()" to obtain a pointer to the relation (GRelation*).
3- call "GRelation::type()" to make sure that it is ARFF.
4- cast to GArffRelation.
5- call "setName" or "setAttrValueCount", etc. (Hmm, it looks like I have not
provided a "setAttrName" method. Perhaps that should be added.)
GRelation* pRel = mymatrix.relation().get();
if(pRel->type() != GRelation::ARFF)
ThrowError("Expected a GArffRelation. Got something else.");
GArffRelation pArffRel = (GArffRelation)pRel;
(disclaimer: I did not compile this.)
(It seems that my use of smart pointers is what is causing the confusion. It
might help to examine the "smart_ptr" class in GHolders.h, or read about smart
Sign up for the SourceForge newsletter: