The Original CHomP Software
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
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

Public Types

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

Public Member Functions

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

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. More...
 
static const enginefind (const cubfile *X, const cubfile *Y, const engine::enginelist &elist=engine::engines)
 Finds the most appropriate homology engine. More...
 
static const enginefind (const cubfile *X, const engine::enginelist &elist=engine::engines)
 Finds the most appropriate homology engine for just one set. More...
 
static const enginefind (const char *name, const engine::enginelist &elist=engine::engines)
 Finds a homology engine with the given name. More...
 

Static Public Attributes

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

Protected Member Functions

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

Detailed Description

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

Definition at line 78 of file engines.h.

Member Typedef Documentation

◆ enginelist

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

The type of a list of engines.

Definition at line 82 of file engines.h.

Constructor & Destructor Documentation

◆ engine()

chomp::homengin::engine::engine ( )
inlineprotected

The default constructor: Add the engine to the list.

Definition at line 89 of file engines.h.

90 {
91 engines. push_back (this);
92 return;
93 }
static enginelist engines
A list of all the engines that have been defined so far.
Definition: engines.h:85

References engines.

◆ ~engine()

virtual chomp::homengin::engine::~engine ( )
inlineprotectedvirtual

The destructor: Remove the engine from the list.

Definition at line 96 of file engines.h.

97 {
98 enginelist::iterator it = std::find (engines. begin (),
99 engines. end (), this);
100 if (it != engines. end ())
101 engines. erase (it);
102 return;
103 }

References engines.

Member Function Documentation

◆ describe()

virtual std::ostream & chomp::homengin::engine::describe ( std::ostream &  out) const
inlinevirtual

Describes this particular engine.

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

Definition at line 164 of file engines.h.

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

◆ dimsupported()

virtual bool chomp::homengin::engine::dimsupported ( int  dim) const
inlinevirtual

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 113 of file engines.h.

114 {
115 return false;
116 }

◆ elementary()

virtual bool chomp::homengin::engine::elementary ( ) const
inlinevirtual

Is this engine capable of processing elementary cubes?

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

Definition at line 132 of file engines.h.

133 {
134 return false;
135 }

◆ find() [1/3]

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.

◆ find() [2/3]

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(), and find().

◆ find() [3/3]

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

Finds the most appropriate homology engine for just one set.

Throws an exception if none can be found.

Definition at line 181 of file engines.h.

183 {
184 return find (X, 0, elist);
185 }
static const engine * find(const cubfile *X, const cubfile *Y, const engine::enginelist &elist=engine::engines)
Finds the most appropriate homology engine.

References find().

◆ homology() [1/2]

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

Compute the homology of the given set of cubes.

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

Definition at line 144 of file engines.h.

146 {
147 throw "Homology computation not supported.";
148 }

◆ homology() [2/2]

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

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 151 of file engines.h.

153 {
154 throw "Relative homology computation not supported.";
155 }

◆ memory()

virtual int chomp::homengin::engine::memory ( const cubfile X) const
inlinevirtual

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 120 of file engines.h.

121 {
122 return 0;
123 }

◆ name()

virtual const char * chomp::homengin::engine::name ( ) const
inlinevirtual

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::MM_CRengine, chomp::homengin::MM_ARengine, chomp::homengin::MM_ASLTengine, and chomp::homengin::MMengine.

Definition at line 158 of file engines.h.

159 {
160 return "";
161 }

◆ relative()

virtual bool chomp::homengin::engine::relative ( ) const
inlinevirtual

Does this engine compute relative homology?

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

Definition at line 126 of file engines.h.

127 {
128 return false;
129 }

◆ showlist()

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.

◆ spacewrapping()

virtual bool chomp::homengin::engine::spacewrapping ( ) const
inlinevirtual

Does this engine support space wrapping?

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

Definition at line 138 of file engines.h.

139 {
140 return false;
141 }

◆ speed()

virtual int chomp::homengin::engine::speed ( ) const
inlinevirtual

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::MM_CRengine, chomp::homengin::MM_ARengine, chomp::homengin::MM_ASLTengine, and chomp::homengin::MMengine.

Definition at line 107 of file engines.h.

108 {
109 return 0;
110 }

Member Data Documentation

◆ engines

enginelist chomp::homengin::engine::engines
static

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

Definition at line 85 of file engines.h.

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


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