Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

unifexp::partType< numType > Class Template Reference

An abstract partition type. More...

#include </cur/unifexp/parttype.h>

Inheritance diagram for unifexp::partType< numType >:
unifexp::partCritical< numType > unifexp::partDerivative< numType > unifexp::partSegmented< numType > unifexp::partUniform< numType >

List of all members.

Public Member Functions

 partType ()
 The constructor.
virtual ~partType ()
 The virtual destructor.
virtual std::string name () const =0
 Returns the name of the object.
virtual void create (const mapType< numType > &theMap, int partCount, const numType &delta)=0
 Creates a partition based on the given map, the requested number of elements in the partition, and the width of the critical neighborhood.
int find (const numType &number) const
 Runs the bisection algorithm to find the maximal element in the partition table which is less than or equal to the given number.
const numType & operator[] (int n) const
 Returns the given interval bound from the partition: the left end of the n-th interval, or right end of the (n-1)-th one.
const numType & at (int n) const
 Returns the given interval bound from the partition: the left end of the n-th interval, or right end of the (n-1)-th one.
bool isCritical (int n) const
 Returns true if the given interval is part of a neighborhood of some critical point.
int getCritical (int n=0) const
 Returns the number of the interval which is a neighborhood of a critical point, or throws an exception if 'n' out of scope.

Protected Member Functions

void allocate (int n)
 Allocates the table to store the given number of intervals.
void addCritical (int n)
 Adds a critical interval to the list of critical intervals.
numType & operator[] (int n)
 Returns the given interval bound from the partition: the left end of the n-th interval, or right end of the (n-1)-th one.

Private Member Functions

 partType (const partType< numType > &)
 Copy constructor is not implemented.
partType< numType > & operator= (const partType< numType > &)
 Assignment operator is not implemented.

Private Attributes

numType * intBounds
 The table with the bounds of partition intervals.
int intCount
 The number of intervals in the partition.
std::vector< int > critical
 The list of critical intervals.
chomp::homology::BitField b
 A bit field which stores the information about intervals if they are critical or not.

Detailed Description

template<class numType>
class unifexp::partType< numType >

An abstract partition type.

All the other partition types should inherit from this one.

Definition at line 52 of file parttype.h.


Constructor & Destructor Documentation

template<class numType >
unifexp::partType< numType >::partType (  ) [inline]

The constructor.

Definition at line 146 of file parttype.h.

template<class numType >
unifexp::partType< numType >::~partType (  ) [inline, virtual]

The virtual destructor.

Definition at line 167 of file parttype.h.

template<class numType >
unifexp::partType< numType >::partType ( const partType< numType > &   ) [inline, private]

Copy constructor is not implemented.

Definition at line 152 of file parttype.h.


Member Function Documentation

template<class numType >
void unifexp::partType< numType >::addCritical ( int  n ) [inline, protected]

Adds a critical interval to the list of critical intervals.

Definition at line 237 of file parttype.h.

template<class numType >
void unifexp::partType< numType >::allocate ( int  n ) [inline, protected]

Allocates the table to store the given number of intervals.

It is automatically deallocated by the destructor.

Definition at line 245 of file parttype.h.

template<class numType >
const numType & unifexp::partType< numType >::at ( int  n ) const [inline]

Returns the given interval bound from the partition: the left end of the n-th interval, or right end of the (n-1)-th one.

Verifies the correctness of the index and throws an error message if n is out of range.

Definition at line 190 of file parttype.h.

template<class numType>
virtual void unifexp::partType< numType >::create ( const mapType< numType > &  theMap,
int  partCount,
const numType &  delta 
) [pure virtual]

Creates a partition based on the given map, the requested number of elements in the partition, and the width of the critical neighborhood.

Implemented in unifexp::partCritical< numType >, unifexp::partDerivative< numType >, unifexp::partSegmented< numType >, and unifexp::partUniform< numType >.

template<class numType >
int unifexp::partType< numType >::find ( const numType &  number ) const [inline]

Runs the bisection algorithm to find the maximal element in the partition table which is less than or equal to the given number.

Uses operator < for comparision, operator [] to extract from the table. Returns the number of that element or -1 if the number is below the leftmost limit.

Definition at line 216 of file parttype.h.

template<class numType >
int unifexp::partType< numType >::getCritical ( int  n = 0 ) const [inline]

Returns the number of the interval which is a neighborhood of a critical point, or throws an exception if 'n' out of scope.

See the map class for the actual number of critical points.

Definition at line 206 of file parttype.h.

template<class numType >
bool unifexp::partType< numType >::isCritical ( int  n ) const [inline]

Returns true if the given interval is part of a neighborhood of some critical point.

Returns false otherwise. Note that this function does not verify the correctness of n, so it must be used with caution.

Definition at line 198 of file parttype.h.

template<class numType>
virtual std::string unifexp::partType< numType >::name (  ) const [pure virtual]
template<class numType >
partType< numType > & unifexp::partType< numType >::operator= ( const partType< numType > &   ) [inline, private]

Assignment operator is not implemented.

Definition at line 160 of file parttype.h.

template<class numType >
const numType & unifexp::partType< numType >::operator[] ( int  n ) const [inline]

Returns the given interval bound from the partition: the left end of the n-th interval, or right end of the (n-1)-th one.

Does not verify the correctness of the index. Note that the operator [] which accesses a non-constant object is protected, so it may be necessary to use a const reference to access the data of a non-const object with operator []. In case of any problems, use the function "at" instead (it is also safer, because it verifies the correctness of the index).

Definition at line 178 of file parttype.h.

template<class numType >
numType & unifexp::partType< numType >::operator[] ( int  n ) [inline, protected]

Returns the given interval bound from the partition: the left end of the n-th interval, or right end of the (n-1)-th one.

Does not verify the correctness of the index.

Definition at line 184 of file parttype.h.


Member Data Documentation

template<class numType>
chomp::homology::BitField unifexp::partType< numType >::b [private]

A bit field which stores the information about intervals if they are critical or not.

Definition at line 133 of file parttype.h.

template<class numType>
std::vector<int> unifexp::partType< numType >::critical [private]

The list of critical intervals.

Definition at line 129 of file parttype.h.

template<class numType>
numType* unifexp::partType< numType >::intBounds [private]

The table with the bounds of partition intervals.

Initially this address is set to 0. Use the function "allocate" to (re)allocate this table, and the operator [] and function "at" to access its elements.

Definition at line 122 of file parttype.h.

template<class numType>
int unifexp::partType< numType >::intCount [private]

The number of intervals in the partition.

Initialized to 0, set by the function "allocate".

Definition at line 126 of file parttype.h.


The documentation for this class was generated from the following file: