Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

costthresh Class Reference

The costthresh class implements a wavelet packet transform cost function which counts the values in the data set that are greater than a threshold value. More...

#include <costthresh.h>

Inheritance diagram for costthresh::

costbase List of all members.

Public Methods

 costthresh (packnode< double > *node, double t)
 class constructor: calculate the wavelet packet cost function using a simple threshold, t. More...


Protected Methods

double costCalc (packnode< double > *node)
 This is a simple threshold calculation. More...


Private Methods

double abs (const double x)
 absolute value. More...


Private Attributes

double thresh
 cost threshold. More...


Detailed Description

The costthresh class implements a wavelet packet transform cost function which counts the values in the data set that are greater than a threshold value.

This threshold value is initialized in the constructor.

The costbase class provides the wavelet packet tree traversal function which calls the subclass's cost function.

Author:
Ian Kaplan

Definition at line 54 of file costthresh.h.


Constructor & Destructor Documentation

costthresh::costthresh ( packnode< double > * node,
double t ) [inline]
 

class constructor: calculate the wavelet packet cost function using a simple threshold, t.

Definition at line 93 of file costthresh.h.

00094   { 
00095     thresh = t; 
00096     traverse( node );
00097   }


Member Function Documentation

double costthresh::abs ( const double x ) [inline, private]
 

absolute value.

Definition at line 61 of file costthresh.h.

Referenced by costCalc().

00062   {
00063     double retval = x;
00064     if (retval < 0.0)
00065       retval = -retval;
00066     return retval;
00067   } // abs

double costthresh::costCalc ( packnode< double > * node ) [inline, protected, virtual]
 

This is a simple threshold calculation.

The costCalc function returns the number of node data values whose absolute value is greater than the threshold.

Reimplemented from costbase.

Definition at line 76 of file costthresh.h.

00077   {
00078     double count = 0.0;
00079     if (node != 0) {
00080       size_t len = node->length();
00081       for (int i = 0; i < len; i++) {
00082         if (abs((*node)[i]) > thresh) {
00083           count = count + 1.0;
00084         }
00085       }
00086     }
00087     return count;
00088   } // costCalc


Member Data Documentation

double costthresh::thresh [private]
 

cost threshold.

Definition at line 58 of file costthresh.h.


The documentation for this class was generated from the following file:
Generated at Tue May 27 21:56:17 2003 for Wavelet compression, determinism and time series forecasting by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001