Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions

chomp::homengin::engine Class Reference

An abstract class that is inherited by all the homology engines. More...

#include <engines.h>

Inheritance diagram for chomp::homengin::engine:
chomp::homengin::BKengine chomp::homengin::MMengine chomp::homengin::PPengine chomp::homengin::BK_LTengine chomp::homengin::MM_ARengine chomp::homengin::MM_ASLTengine chomp::homengin::MM_CRengine

List of all members.

Public Types

typedef std::vector< const
engine * > 
enginelist
 The type of a list of engines.

Public Member Functions

virtual int speed () const
 The speed of the engine: The higher the number, the better.
virtual bool dimsupported (int dim) const
 Is this dimension supported by this engine?
virtual int memory (const cubfile &X) const
 Rough memory usage estimate for a single set of cubes.
virtual bool relative () const
 Does this engine compute relative homology?
virtual bool elementary () const
 Is this engine capable of processing elementary cubes?
virtual bool spacewrapping () const
 Does this engine support space wrapping?
virtual void homology (const cubfile &x, algstruct< chomp::homology::integer > &h) const
 Compute the homology of the given set of cubes.
virtual void homology (const cubfile &x, const cubfile &y, algstruct< chomp::homology::integer > &h) const
 Compute the relative homology of the given pair of sets of cubes.
virtual const char * name () const
 The name of the engine to be used in the command line.
virtual std::ostream & describe (std::ostream &out) const
 Describes this particular engine.

Static Public Member Functions

static std::ostream & showlist (std::ostream &out, const engine::enginelist &elist=engine::engines)
 Shows a list of available homology engines with descriptions.
static const enginefind (const cubfile *X, const cubfile *Y, const engine::enginelist &elist=engine::engines)
 Finds the most appropriate homology engine.
static const enginefind (const cubfile *X, const engine::enginelist &elist=engine::engines)
 Finds the most appropriate homology engine for just one set.
static const enginefind (const char *name, const engine::enginelist &elist=engine::engines)
 Finds a homology engine with the given name.

Static Public Attributes

static enginelist engines
 A list of all the engines that have been defined so far.

Protected Member Functions

 engine ()
 The default constructor: Add the engine to the list.
virtual ~engine ()
 The destructor: Remove the engine from the list.

Detailed Description

An abstract class that is inherited by all the homology engines.

Definition at line 79 of file engines.h.


Member Typedef Documentation

typedef std::vector<const engine *> chomp::homengin::engine::enginelist

The type of a list of engines.

Definition at line 83 of file engines.h.


Constructor & Destructor Documentation

chomp::homengin::engine::engine (  )  [inline, protected]

The default constructor: Add the engine to the list.

Definition at line 90 of file engines.h.

References engines.

        {
                engines. push_back (this);
                return;
        }

virtual chomp::homengin::engine::~engine (  )  [inline, protected, virtual]

The destructor: Remove the engine from the list.

Definition at line 97 of file engines.h.

References engines, and find().

        {
                enginelist::iterator it = std::find (engines. begin (),
                        engines. end (), this);
                if (it != engines. end ())
                        engines. erase (it);
                return;
        }


Member Function Documentation

virtual std::ostream& chomp::homengin::engine::describe ( std::ostream &  out  )  const [inline, virtual]

Describes this particular engine.

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, chomp::homengin::BK_LTengine, chomp::homengin::MMengine, chomp::homengin::MM_CRengine, chomp::homengin::MM_ARengine, and chomp::homengin::MM_ASLTengine.

Definition at line 165 of file engines.h.

        {
                out << "This is an unknown homology engine.\n";
                return out;
        }

virtual bool chomp::homengin::engine::dimsupported ( int  dim  )  const [inline, virtual]

Is this dimension supported by this engine?

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, chomp::homengin::MMengine, chomp::homengin::MM_CRengine, and chomp::homengin::MM_ARengine.

Definition at line 114 of file engines.h.

        {
                return false;
        }

virtual bool chomp::homengin::engine::elementary (  )  const [inline, virtual]

Is this engine capable of processing elementary cubes?

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, and chomp::homengin::MMengine.

Definition at line 133 of file engines.h.

        {
                return false;
        }

static const engine* chomp::homengin::engine::find ( const cubfile X,
const cubfile Y,
const engine::enginelist elist = engine::engines 
) [static]

Finds the most appropriate homology engine.

Throws an exception if none can be found.

Referenced by ComputeBettiNumbers(), find(), and ~engine().

static const engine* chomp::homengin::engine::find ( const cubfile X,
const engine::enginelist elist = engine::engines 
) [inline, static]

Finds the most appropriate homology engine for just one set.

Throws an exception if none can be found.

Definition at line 182 of file engines.h.

References find().

        {
                return find (X, 0, elist);
        }

static const engine* chomp::homengin::engine::find ( const char *  name,
const engine::enginelist elist = engine::engines 
) [static]

Finds a homology engine with the given name.

Throws an exception if none can be found.

virtual void chomp::homengin::engine::homology ( const cubfile x,
algstruct< chomp::homology::integer > &  h 
) const [inline, virtual]

Compute the homology of the given set of cubes.

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, chomp::homengin::MMengine, chomp::homengin::MM_CRengine, chomp::homengin::MM_ARengine, and chomp::homengin::MM_ASLTengine.

Definition at line 145 of file engines.h.

        {
                throw "Homology computation not supported.";
        }

virtual void chomp::homengin::engine::homology ( const cubfile x,
const cubfile y,
algstruct< chomp::homology::integer > &  h 
) const [inline, virtual]

Compute the relative homology of the given pair of sets of cubes.

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, and chomp::homengin::MMengine.

Definition at line 152 of file engines.h.

        {
                throw "Relative homology computation not supported.";
        }

virtual int chomp::homengin::engine::memory ( const cubfile X  )  const [inline, virtual]

Rough memory usage estimate for a single set of cubes.

Returns 0 if unknown, -1 if not enough memory.

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, and chomp::homengin::MMengine.

Definition at line 121 of file engines.h.

        {
                return 0;
        }

virtual const char* chomp::homengin::engine::name (  )  const [inline, virtual]

The name of the engine to be used in the command line.

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, chomp::homengin::BK_LTengine, chomp::homengin::MMengine, chomp::homengin::MM_CRengine, chomp::homengin::MM_ARengine, and chomp::homengin::MM_ASLTengine.

Definition at line 159 of file engines.h.

        {
                return "";
        }

virtual bool chomp::homengin::engine::relative (  )  const [inline, virtual]

Does this engine compute relative homology?

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, and chomp::homengin::MMengine.

Definition at line 127 of file engines.h.

        {
                return false;
        }

static std::ostream& chomp::homengin::engine::showlist ( std::ostream &  out,
const engine::enginelist elist = engine::engines 
) [static]

Shows a list of available homology engines with descriptions.

virtual bool chomp::homengin::engine::spacewrapping (  )  const [inline, virtual]

Does this engine support space wrapping?

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, and chomp::homengin::MMengine.

Definition at line 139 of file engines.h.

        {
                return false;
        }

virtual int chomp::homengin::engine::speed (  )  const [inline, virtual]

The speed of the engine: The higher the number, the better.

Reimplemented in chomp::homengin::PPengine, chomp::homengin::BKengine, chomp::homengin::BK_LTengine, chomp::homengin::MMengine, chomp::homengin::MM_CRengine, chomp::homengin::MM_ARengine, and chomp::homengin::MM_ASLTengine.

Definition at line 108 of file engines.h.

        {
                return 0;
        }


Member Data Documentation

A list of all the engines that have been defined so far.

Definition at line 86 of file engines.h.

Referenced by engine(), and ~engine().


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