name: RegressionDecisionTreeNode
synopsis:

>     gcc [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_search.a

>     #include <RegressionDecisionTreeNode.h>

>     ~RegressionDecisionTreeNode();
>     RegressionDecisionTreeNode();
>     RegressionDecisionTreeNode(const RegressionDecisionTreeNode& copy_sym);

quick start:

>     #include <RegressionDecisionTreeNode.h>

>     RegressionDecisionTreeNode rdt_node;
>     Triple<Long, Long, Long> datapoint;
>     SingleLinkedList<datapoint > data;

>     rdt_node.createTransform(Vector& stat_models_a);
>     rdt_node.updateDistribution(Vector& stat_models_a);

description:
The RegressionDecisionTreeNode class is meant to store a collection of information for statistical models in the RegressionDecisionTree class.
dependencies:

- SingleLinkedList
- Triple
- Long
- Boolean
- StatisticalModel
- HashTable
- String

public constants:

- define the class name:

      static const String CLASS_NAME;

- define i/o related constants:

      static const String DEF_PARAM;

      static const String PARAM_DATAPOINTS;

      static const String PARAM_CLUSTER_SCORE;

      static const String PARAM_CLUSTER_ACCUMULATE;

      static const String PARAM_NUMBER_COMPONENTS;

      static const String PARAM_NODE_INDEX;

      static const String PARAM_AVERAGE_COVARIANCE;

      static const String PARAM_SPEECH_FLAG;

      static const String PARAM_SPLIT_FLAG;

      static const String PARAM_PARENT_NODE_INDEX;

      static const String PARAM_TRANSFORM_FLAG;

      static const String PARAM_STAT_MODELS;

      static const String PARAM_W_TRANSFORM;

      static const String PARAM_DBGL;

- define default values and arguments:

      static const long DEF_TYPICAL_INDEX = -1;

      static const long DEF_ACTUAL_INDEX = -1;

      static const bool DEF_FLAG_EXISTS = true;

- other important constants:

      typedef Triple<Long, Long, Long<String, String> > RDataPoint;

      typedef SingleLinkedList<DataPoint> RData;

error codes:

- error code indicating RegressionDecisionTreeNode class general error:

      static const long ERR = 00100600;

      static const long ERR_ADAPT_NO_GAUSSIAN = 00100610;

protected data:

- define structures:

      typedef Triple<Long, Long, Long<String, String> > RDataPoint;

      typedef SingleLinkedList<DataPoint> RData;

- define the list of gaussian components for this node

      RData gaussian_models_d;

- define variables to represent information for this node

      VectorFloat average_mean_d;

      Float cluster_score_d;

      Float cluster_accumulate_d;

      Long number_components_d;

      Long node_index_d;

      MatrixFloat average_covariance_d;

- define a flag indicates if this node is speech/non-speech node

      Boolean speech_flag_d;

- define a flag to indicator if this node is splittable

      Boolean split_flag_d;

- define parent node index, use to search transformation index

      Long parent_node_index_d;

- transformation data enough?

      Boolean transform_flag_d;

- local copy of the statistical model;

      Vector stat_models_d;

- define transformation matrix W (one row for each Gaussian dimension)

      Vector w_transform_d;

- define Z matrix used to create transformation matrix

      MatrixFloat z_glob_d;

- define G matrix used to create transformation matrix

      Vector g_glob_d;

- define a debug level

      DebugLevel debug_level_d;

- define the memory manager:

      static MemoryManager mgr_d;

required public methods:

- static methods:

      static const String& name();

      static boolean diagnose(Integral::DEBUG debug_level);

- debug methods:

      boolean debug(const unichar* message) const;

      static boolean setDebug(Integral::DEBUG debug_level);

- destructor/constructor(s):

      ~RegressionDecisionTreeNode();

      RegressionDecisionTreeNode();

      RegressionDecisionTreeNode(const RegressionDecisionTreeNode& arg);

- assign methods:

      boolean assign(const RegressionDecisionTreeNode& copy_node);

- i/o methods:

      long sofSize() const;

      boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);

      boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;

      boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false) const;

      boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;

- equality methods:

      boolean eq(const RegressionDecisionTreeNode& compare_node) const;

- memory management methods:

      static void* operator new(size_t size);

      static void* operator new[](size_t size);

      static void operator delete(void* ptr);

      static void operator delete[](void* ptr);

      static boolean setGrowSize(long grow_size);

      boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);

class-specific public methods:

- methods to get/set DataPoints

      boolean setDataPoints(Data arg);

      Data getDataPoints();

- methods to get/set average mean

      boolean setAverageMean(VectorFloat&  arg);

      String getAverageMean(VectorFloat&  arg);

- methods to get/set average covariance

      boolean setAverageCov(MatrixFloat&  arg);

      String getAverageCov(MatrixFloat&  arg);

- methods to get/set cluster score

      boolean setClusterScore(Float  arg);

      Float& getClusterScore();

- methods to get/set number of components

      boolean setNumComponents(long  arg);

      Float& getNumComponents();

- methods to get/set speech flag

      boolean setSpeechFlag(Boolean  arg);

      boolean getSpeechFlag(Boolean arg);

- methods to get/set speech flag

      boolean setSplitFlag(Boolean  arg);

      boolean getSplitFlag(Boolean arg);

- methods to get/set transform flag

      boolean setTransformFlag(Boolean  arg);

      Boolean& getTransformFlag());

- methods to get/set parent node index

      boolean setParentNodeIndex(long  arg);

      Long& getParentNodeIndex());

- methods to get/set cluster accumulate

      boolean setClusterAccumulate(Float  arg);

      Float& getClusterAccumulate());

- methods to get/set transformation

      boolean setTransformation(Vector & arg);

      Boolean& getTransformation(Vector & arg));

- methods to get/set typical-index

      boolean setTypicalIndex(Long arg);

      Long getTypicalIndex();

- methods to get/set node index

      boolean setNodeIndex(long  arg);

      Long& getNodeIndex());

- other methods

      boolean createTransform(Vector& stat_models_a);

      boolean updateDistribution(Vector& stat_models_a);

      boolean containModel(long sm_index_a, long gm_index_a);

private methods:

- calculate cluster distribution

      boolean calcClusterDistribution(Vector& stat_models_a);

- compute sum of occupancy

      boolean computeSumOccupancy(Vector& stat_models_a, float& sum_num_occ_a);

- adapt part

      boolean adaptPart(Vector& g_a, MatrixFloat& z_a, GaussianModel& gm_a);

- Node score

      boolean nodeScore(Vector& stat_models_a);

notes:

- The RegressionDecisionTreeNode class is primarily used when using RegressionDecisionTree, i.e., it is used to store the information at a node in the tree.