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

packcontainer_int Class Reference

A container for use when calculating a packet wavelet tree. More...

#include <packcontainer_int.h>

List of all members.

Public Methods

 packcontainer_int (packnode< int > *node)
 This version of the packcontainer object is used as a container in calculating the forward wavelet packet transform for an integer data set. More...

 packcontainer_int (size_t n)
 This version is used when calculating the inverse wavelet packet transform. More...

void* operator new (unsigned int num_bytes)
 This is a local implementation of new. More...

int& operator[] (const size_t i)
 LHS [] operator. More...

int operator[] (const size_t i) const
 RHS [] operator. More...

int* lhsData ()
 return the left hand size array. More...

int* rhsData ()
 return the right hand size array. More...

void lhsData (int *l)
 set the left hand size array. More...

void rhsData (int *r)
 set the right hand size array. More...

size_t length ()
 return the length of the data in the packet container. More...


Private Methods

 packcontainer_int (const packcontainer_int &rhs)
 disallow the copy constructor. More...

 packcontainer_int ()
 disallow default constructor. More...


Private Attributes

size_t N
 number of elements at this packet tree level. More...

int* lhs
 left (low pass) half of the packcontainer_int data. More...

int* rhs
 right (high pass) half of the packnode data. More...


Detailed Description

A container for use when calculating a packet wavelet tree.

By overriding the LHS and RHS versions of the [] operator, packcontainer class allows a block of data to be treated as an array while a wavelet transform step is being calculated. After the wavelet transform step the data can be referenced as a left hand side half (the result of the wavelet scaling function) and a right hand side half (the result of the wavelet function). By allowing the two halves of the array to be referenced, copying is avoided.

Definition at line 52 of file packcontainer_int.h.


Constructor & Destructor Documentation

packcontainer_int::packcontainer_int ( const packcontainer_int & rhs ) [inline, private]
 

disallow the copy constructor.

Definition at line 63 of file packcontainer_int.h.

00063 {};

packcontainer_int::packcontainer_int ( ) [inline, private]
 

disallow default constructor.

Definition at line 65 of file packcontainer_int.h.

00065 {};

packcontainer_int::packcontainer_int ( packnode< int > * node ) [inline]
 

This version of the packcontainer object is used as a container in calculating the forward wavelet packet transform for an integer data set.

The packcontainer_int constructor is passed a pointer to a packnode object. As the wavelet packet tree is being built this packnode object contain the data from the previous level.

The length of the packnode object is N. The constructor will dynamically allocate two vectors (lhs and rhs), each with N/2 elements. After the wavelet transform step has been calculated on the packcontainer_int object, the lhs vector will contain the wavelet scaling function, or low pass, result. The rhs vector will contain the wavelet function, or high pass, result. These will be used to construct two new packnode objects which will be children of the object passed to the constructor.

Definition at line 89 of file packcontainer_int.h.

00090   {
00091     assert( node != 0 );
00092     N = node->length();
00093     assert( N > 1 );
00094 
00095     size_t half = N >> 1;
00096     block_pool mem_pool;
00097     size_t num_bytes = half * sizeof(int);
00098 
00099     lhs = (int *)mem_pool.pool_alloc( num_bytes );
00100     rhs = (int *)mem_pool.pool_alloc( num_bytes );
00101 
00102     for (size_t i = 0; i < N; i++) {
00103       (*this)[i] = (*node)[i];
00104     }
00105   } // packcontainer_int

packcontainer_int::packcontainer_int ( size_t n ) [inline]
 

This version is used when calculating the inverse wavelet packet transform.

The constructor is passed the size of the container (or at least the size that the container will be, when the left and right hand size arrays are initialized). The lhs and rhs arrays are then initialized and the inverse transform step is calculated.

Definition at line 118 of file packcontainer_int.h.

00119   {
00120     N = n;
00121     lhs = 0;
00122     rhs = 0;
00123   }


Member Function Documentation

size_t packcontainer_int::length ( void ) [inline]
 

return the length of the data in the packet container.

Note that this length is the length of the rhs plus the length of the lhs arrays.

Definition at line 181 of file packcontainer_int.h.

Referenced by invpacktree_int::add_elem(), invpacktree_int::invpacktree_int(), and invpacktree_int::reduce().

00181 { return N; }

void packcontainer_int::lhsData ( int * l ) [inline]
 

set the left hand size array.

Definition at line 172 of file packcontainer_int.h.

00172 { lhs = l; }

int * packcontainer_int::lhsData ( ) [inline]
 

return the left hand size array.

Definition at line 167 of file packcontainer_int.h.

Referenced by invpacktree_int::invpacktree_int(), packtree_base_int::newLevel(), invpacktree_int::new_level(), and invpacktree_int::reduce().

00167 { return lhs; }

void * packcontainer_int::operator new ( unsigned int num_bytes ) [inline]
 

This is a local implementation of new.

When new is applied to a packcontainer_int object, memory will be allocated from a memory pool, rather than from the system memory pool.

Definition at line 131 of file packcontainer_int.h.

00132   {
00133     block_pool mem_pool;
00134 
00135     void *mem_addr = mem_pool.pool_alloc( num_bytes );
00136     return mem_addr;
00137   } // new

int packcontainer_int::operator[] ( const size_t i ) const [inline]
 

RHS [] operator.

Definition at line 154 of file packcontainer_int.h.

00155   {
00156     assert( i < N );
00157     size_t half = N >> 1;
00158 
00159     if (i < half)
00160       return lhs[i];
00161     else {
00162       return rhs[i-half];
00163     }
00164   }

int & packcontainer_int::operator[] ( const size_t i ) [inline]
 

LHS [] operator.

Definition at line 141 of file packcontainer_int.h.

00142   {
00143     assert( i < N );
00144     size_t half = N >> 1;
00145 
00146     if (i < half)
00147       return lhs[i];
00148     else {
00149       return rhs[i-half];
00150     }
00151   }

void packcontainer_int::rhsData ( int * r ) [inline]
 

set the right hand size array.

Definition at line 174 of file packcontainer_int.h.

00174 { rhs = r; }

int * packcontainer_int::rhsData ( ) [inline]
 

return the right hand size array.

Definition at line 169 of file packcontainer_int.h.

Referenced by invpacktree_int::add_elem(), packtree_base_int::newLevel(), and invpacktree_int::reduce().

00169 { return rhs; }


Member Data Documentation

size_t packcontainer_int::N [private]
 

number of elements at this packet tree level.

Definition at line 55 of file packcontainer_int.h.

int * packcontainer_int::lhs [private]
 

left (low pass) half of the packcontainer_int data.

Definition at line 57 of file packcontainer_int.h.

int * packcontainer_int::rhs [private]
 

right (high pass) half of the packnode data.

Definition at line 59 of file packcontainer_int.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