Public Member Functions | Private Member Functions | Private Attributes

chomp::multiwork::mwIniProbes< dim, coord > Class Template Reference

This is a helper class for producing an initial set of probes to test the interior of the requested area of parameters. More...

#include <mwsubdiv.h>

List of all members.

Public Member Functions

 mwIniProbes (int level=2)
 The only constructor allowed.
 ~mwIniProbes ()
 The destructor.
tCubeFix< dim, coord > get ()
 Returns the next available probe or throws an error message if all the probes have already been taken.
bool available () const
 Returns true iff there is at least one more probe available.

Private Member Functions

 mwIniProbes (const mwIniProbes< dim, coord > &)
 The copy constructor is not allowed.
mwIniProbes< dim, coord > & operator= (const mwIniProbes< dim, coord > &)
 The assignment operator is not allowed.

Private Attributes

coord left [dim]
 The coordinates of the leftmost corner of the iterated area.
coord right [dim]
 The coordinates of the rightmost corner of the iterated area.
tRectangle< coord > rect
 The actual probe iterator.
const coord * next
 The next coordinates to return or 0 if none.

Detailed Description

template<int dim, class coord>
class chomp::multiwork::mwIniProbes< dim, coord >

This is a helper class for producing an initial set of probes to test the interior of the requested area of parameters.

Definition at line 236 of file mwsubdiv.h.


Constructor & Destructor Documentation

template<int dim, class coord >
chomp::multiwork::mwIniProbes< dim, coord >::mwIniProbes ( int  level = 2  )  [inline]

The only constructor allowed.

Definition at line 276 of file mwsubdiv.h.

References chomp::multiwork::mwIniProbes< dim, coord >::left, chomp::multiwork::mwIniProbes< dim, coord >::next, chomp::multiwork::mwIniProbes< dim, coord >::rect, and chomp::multiwork::mwIniProbes< dim, coord >::right.

{
        if (level < 2)
                throw "Too low initial level. Should be at least 2.";
        for (int i = 0; i < dim; ++ i)
        {
                this -> left [i] = 1;
                this -> right [i] = 1 << level;
        }
        this -> rect = tRectangle<coord> (this -> left, this -> right, dim);
        this -> next = this -> rect. get ();
        return;
} /* mwIniProbes::mwIniProbes */

template<int dim, class coord >
chomp::multiwork::mwIniProbes< dim, coord >::~mwIniProbes (  )  [inline]

The destructor.

Definition at line 304 of file mwsubdiv.h.

{
        return;
} /* mwIniProbes::~mwIniProbes */

template<int dim, class coord >
chomp::multiwork::mwIniProbes< dim, coord >::mwIniProbes ( const mwIniProbes< dim, coord > &   )  [inline, private]

The copy constructor is not allowed.

Definition at line 291 of file mwsubdiv.h.

{
        return;
} /* mwIniProbes::mwIniProbes */


Member Function Documentation

template<int dim, class coord >
bool chomp::multiwork::mwIniProbes< dim, coord >::available (  )  const [inline]

Returns true iff there is at least one more probe available.

Definition at line 318 of file mwsubdiv.h.

References chomp::multiwork::mwIniProbes< dim, coord >::next.

{
        return !!(this -> next);
} /* mwIniProbes::available */

template<int dim, class coord >
tCubeFix< dim, coord > chomp::multiwork::mwIniProbes< dim, coord >::get (  )  [inline]

Returns the next available probe or throws an error message if all the probes have already been taken.

Definition at line 310 of file mwsubdiv.h.

References chomp::multiwork::mwIniProbes< dim, coord >::next, and chomp::multiwork::mwIniProbes< dim, coord >::rect.

{
        tCubeFix<dim,coord> q (this -> next, dim);
        this -> next = this -> rect. get ();
        return q;
} /* mwIniProbes::get */

template<int dim, class coord >
mwIniProbes< dim, coord > & chomp::multiwork::mwIniProbes< dim, coord >::operator= ( const mwIniProbes< dim, coord > &   )  [inline, private]

The assignment operator is not allowed.

Definition at line 298 of file mwsubdiv.h.

{
        return *this;
} /* mwIniProbes::operator = */


Member Data Documentation

template<int dim, class coord>
coord chomp::multiwork::mwIniProbes< dim, coord >::left[dim] [private]

The coordinates of the leftmost corner of the iterated area.

Definition at line 260 of file mwsubdiv.h.

Referenced by chomp::multiwork::mwIniProbes< dim, coord >::mwIniProbes().

template<int dim, class coord>
const coord* chomp::multiwork::mwIniProbes< dim, coord >::next [private]
template<int dim, class coord>
tRectangle<coord> chomp::multiwork::mwIniProbes< dim, coord >::rect [private]
template<int dim, class coord>
coord chomp::multiwork::mwIniProbes< dim, coord >::right[dim] [private]

The coordinates of the rightmost corner of the iterated area.

Definition at line 263 of file mwsubdiv.h.

Referenced by chomp::multiwork::mwIniProbes< dim, coord >::mwIniProbes().


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