The ChainCon Software (Release 0.03)
Public Types | Public Member Functions | Private Attributes | List of all members
tChain< CellT, CoefT > Class Template Reference

A chain with coefficients in an arbitrary ring. More...

#include <chain.h>

Public Types

typedef CellT CellType
 The type of cells in the chain. More...
 
typedef CoefT CoefType
 The type of coefficients in the chain. More...
 

Public Member Functions

 tChain ()
 The default constructor of an empty chain. More...
 
int_t size () const
 Returns the number of elements in the chain. More...
 
bool empty () const
 Returns true if and only if the chain is zero. More...
 
const CellT & getCell (int_t n) const
 Returns the n-th cell of the chain. More...
 
const CoefT & getCoef (int_t n) const
 Returns the coefficient at the n-th cell of the chain. More...
 
int_t position (const CellT &c) const
 Returns the position of the given cell in the chain or -1 if the cell is not there. More...
 
void add (const CellT &cell, const CoefT &coef)
 Adds a given cell to the chain with the given coefficient. More...
 
tChain< CellT, CoefT > & operator+= (const tChain< CellT, CoefT > &ch)
 Adds a given chain to the chain. More...
 
tChain< CellT, CoefT > & negate ()
 Negates all the coefficients in the chain. More...
 
tChain< CellT, CoefT > & operator*= (const CoefT &coef)
 Multiples the chain by a given coefficient. More...
 
bool operator== (const tChain< CellT, CoefT > &ch) const
 Compares if the two chains are equal. More...
 
void swap (tChain< CellT, CoefT > &ch)
 Swaps the data with another chain. More...
 

Private Attributes

chomp::homology::hashedset< CellT > cells
 The set of elements in the chain. More...
 
extarray< CoefT > coefs
 The coefficients that appear at the cells in the chain. More...
 

Detailed Description

template<class CellT, class CoefT>
class tChain< CellT, CoefT >

A chain with coefficients in an arbitrary ring.

Definition at line 50 of file chain.h.

Member Typedef Documentation

◆ CellType

template<class CellT, class CoefT>
typedef CellT tChain< CellT, CoefT >::CellType

The type of cells in the chain.

Definition at line 54 of file chain.h.

◆ CoefType

template<class CellT, class CoefT>
typedef CoefT tChain< CellT, CoefT >::CoefType

The type of coefficients in the chain.

Definition at line 57 of file chain.h.

Constructor & Destructor Documentation

◆ tChain()

template<class CellT , class CoefT >
tChain< CellT, CoefT >::tChain ( )
inline

The default constructor of an empty chain.

Definition at line 108 of file chain.h.

Member Function Documentation

◆ add()

template<class CellT, class CoefT>
void tChain< CellT, CoefT >::add ( const CellT &  cell,
const CoefT &  coef 
)
inline

Adds a given cell to the chain with the given coefficient.

Definition at line 145 of file chain.h.

Referenced by tChain< tPair< Cell1T, Cell2T >, CoefT >::add(), and tChain< tPair< Cell1T, Cell2T >, CoefT >::operator+=().

◆ empty()

template<class CellT , class CoefT >
bool tChain< CellT, CoefT >::empty ( ) const
inline

Returns true if and only if the chain is zero.

Definition at line 121 of file chain.h.

Referenced by tChain< tPair< Cell1T, Cell2T >, CoefT >::empty(), and tChain< tPair< Cell1T, Cell2T >, CoefT >::operator+=().

◆ getCell()

template<class CellT , class CoefT >
const CellT & tChain< CellT, CoefT >::getCell ( int_t  n) const
inline

Returns the n-th cell of the chain.

Definition at line 127 of file chain.h.

Referenced by operator*(), tChain< tPair< Cell1T, Cell2T >, CoefT >::operator+=(), and operator<<().

◆ getCoef()

template<class CellT , class CoefT >
const CoefT & tChain< CellT, CoefT >::getCoef ( int_t  n) const
inline

Returns the coefficient at the n-th cell of the chain.

Definition at line 133 of file chain.h.

Referenced by operator*(), tChain< tPair< Cell1T, Cell2T >, CoefT >::operator+=(), and operator<<().

◆ negate()

template<class CellT , class CoefT >
tChain< CellT, CoefT > & tChain< CellT, CoefT >::negate ( )
inline

Negates all the coefficients in the chain.

Definition at line 190 of file chain.h.

Referenced by tChain< tPair< Cell1T, Cell2T >, CoefT >::negate().

◆ operator*=()

template<class CellT , class CoefT>
tChain< CellT, CoefT > & tChain< CellT, CoefT >::operator*= ( const CoefT &  coef)
inline

Multiples the chain by a given coefficient.

Definition at line 200 of file chain.h.

◆ operator+=()

template<class CellT, class CoefT>
tChain< CellT, CoefT > & tChain< CellT, CoefT >::operator+= ( const tChain< CellT, CoefT > &  ch)
inline

Adds a given chain to the chain.

Definition at line 173 of file chain.h.

◆ operator==()

template<class CellT, class CoefT>
bool tChain< CellT, CoefT >::operator== ( const tChain< CellT, CoefT > &  ch) const
inline

Compares if the two chains are equal.

Definition at line 219 of file chain.h.

◆ position()

template<class CellT, class CoefT >
int_t tChain< CellT, CoefT >::position ( const CellT &  c) const
inline

Returns the position of the given cell in the chain or -1 if the cell is not there.

Definition at line 139 of file chain.h.

Referenced by operator*().

◆ size()

template<class CellT , class CoefT >
int_t tChain< CellT, CoefT >::size ( ) const
inline

◆ swap()

template<class CellT, class CoefT>
void tChain< CellT, CoefT >::swap ( tChain< CellT, CoefT > &  ch)
inline

Member Data Documentation

◆ cells

template<class CellT, class CoefT>
chomp::homology::hashedset<CellT> tChain< CellT, CoefT >::cells
private

◆ coefs

template<class CellT, class CoefT>
extarray<CoefT> tChain< CellT, CoefT >::coefs
private

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