Main Page | Modules | Data Structures | File List | Globals | Related Pages

AttributeTracker.h File Reference


Detailed Description

Keep a record of which attributes are active.

Sometimes you need to keep track of which attributes you have already considered, and which are still available for consideration. The attribute tracker interface helps you efficiently acomplish this task; you can think of it as a wrapper around a bit field.

For example, when learning a decision tree, each split on a discrete attribute deactivates an attribute from further consideration. In this situation you would deactivate the attribute, and then make one clone for each child.

Go to the source code of this file.

Functions

AttributeTrackerPtr AttributeTrackerNew (int numAttributes)
 Allocates memory for a new AttributeTracker structure.

void AttributeTrackerFree (AttributeTrackerPtr at)
 Frees the memory associated with the attribute tracker.

AttributeTrackerPtr AttributeTrackerInitial (ExampleSpecPtr es)
 Respects 'ignore's in the ExampleSpec.

AttributeTrackerPtr AttributeTrackerClone (AttributeTrackerPtr at)
 Creates a copy of the passed AttributeTracker and returns the copy.

void AttributeTrackerMarkActive (AttributeTrackerPtr at, int attNum)
 Marks the specified attribute as active.

void AttributeTrackerMarkInactive (AttributeTrackerPtr at, int attNum)
 Marks the specified attribute as inactive.

int AttributeTrackerIsActive (AttributeTrackerPtr at, int attNum)
 Returns 1 if the specified attribute is active.

int AttributeTrackerAreAllInactive (AttributeTrackerPtr at)
 Returns 1 if none of the attributes are active.

int AttributeTrackerNumActive (AttributeTrackerPtr at)
 Returns a count of at's active attributes.


Function Documentation

int AttributeTrackerAreAllInactive AttributeTrackerPtr  at  ) 
 

Returns 1 if none of the attributes are active.

This is a constant time operation (it does not depend on the number of attributes).

AttributeTrackerPtr AttributeTrackerClone AttributeTrackerPtr  at  ) 
 

Creates a copy of the passed AttributeTracker and returns the copy.

void AttributeTrackerFree AttributeTrackerPtr  at  ) 
 

Frees the memory associated with the attribute tracker.

AttributeTrackerPtr AttributeTrackerInitial ExampleSpecPtr  es  ) 
 

Respects 'ignore's in the ExampleSpec.

Creates an attribute tracker to track the attributes in the passed ExampleSpec. Any of es's attributes marked as ignore will be initially set to inactive.

int AttributeTrackerIsActive AttributeTrackerPtr  at,
int  attNum
 

Returns 1 if the specified attribute is active.

void AttributeTrackerMarkActive AttributeTrackerPtr  at,
int  attNum
 

Marks the specified attribute as active.

void AttributeTrackerMarkInactive AttributeTrackerPtr  at,
int  attNum
 

Marks the specified attribute as inactive.

AttributeTrackerPtr AttributeTrackerNew int  numAttributes  ) 
 

Allocates memory for a new AttributeTracker structure.

Creates a new attribute tracker with one bit for each of numAttributes. All the attributes are initially marked as active.

int AttributeTrackerNumActive AttributeTrackerPtr  at  ) 
 

Returns a count of at's active attributes.

This is a constant time operation (it does not depend on the number of attributes).


Generated for VFML by doxygen hosted by SourceForge.net Logo