Cantera  3.0.0
Loading...
Searching...
No Matches
Group Class Reference

Class Group is an internal class used by class ReactionPath. More...

#include <Group.h>

Detailed Description

Class Group is an internal class used by class ReactionPath.

It represents some subset of the atoms of a molecule.

Definition at line 20 of file Group.h.

Public Member Functions

 Group (size_t n)
 
 Group (const vector< int > &elnumbers)
 
 Group (const vector< size_t > &elnumbers)
 
 Group (const Group &g)
 
Groupoperator= (const Group &g)
 
void operator-= (const Group &other)
 Decrement the atom numbers by those in group 'other'.
 
void operator+= (const Group &other)
 
void operator*= (int a)
 
bool operator== (const Group &other) const
 
void validate ()
 
bool valid () const
 True if all non-zero atom numbers have the same sign.
 
bool operator! () const
 
int sign () const
 
size_t size () const
 
int nAtoms () const
 Number of atoms in the group (>= 0)
 
int nAtoms (size_t m) const
 Number of atoms of element m (positive or negative)
 
std::ostream & fmt (std::ostream &s, const vector< string > &esymbols) const
 

Private Attributes

vector< int > m_comp
 
int m_sign
 

Friends

Group operator- (const Group &g1, const Group &g2)
 
Group operator+ (const Group &g1, const Group &g2)
 
std::ostream & operator<< (std::ostream &s, const Group &g)
 

Constructor & Destructor Documentation

◆ Group() [1/5]

Group ( )
inline

Definition at line 23 of file Group.h.

◆ Group() [2/5]

Group ( size_t  n)
inline

Definition at line 24 of file Group.h.

◆ Group() [3/5]

Group ( const vector< int > &  elnumbers)
inline

Definition at line 27 of file Group.h.

◆ Group() [4/5]

Group ( const vector< size_t > &  elnumbers)
inline

Definition at line 31 of file Group.h.

◆ Group() [5/5]

Group ( const Group g)
inline

Definition at line 38 of file Group.h.

◆ ~Group()

virtual ~Group ( )
inlinevirtual

Definition at line 47 of file Group.h.

Member Function Documentation

◆ operator=()

Group & operator= ( const Group g)
inline

Definition at line 40 of file Group.h.

◆ operator-=()

void operator-= ( const Group other)
inline

Decrement the atom numbers by those in group 'other'.

Definition at line 52 of file Group.h.

◆ operator+=()

void operator+= ( const Group other)
inline

Definition at line 58 of file Group.h.

◆ operator*=()

void operator*= ( int  a)
inline

Definition at line 64 of file Group.h.

◆ operator==()

bool operator== ( const Group other) const
inline

Definition at line 70 of file Group.h.

◆ validate()

void validate ( )

A group is 'valid' if all of its nonzero atom numbers have the same sign, either positive or negative. This method checks for this, and if the group is not valid it sets m_sign to -999, and sets all atom numbers to zero.

Definition at line 15 of file Group.cpp.

◆ valid()

bool valid ( ) const
inline

True if all non-zero atom numbers have the same sign.

Definition at line 99 of file Group.h.

◆ operator!()

bool operator! ( ) const
inline

Definition at line 102 of file Group.h.

◆ sign()

int sign ( ) const
inline

Definition at line 105 of file Group.h.

◆ size()

size_t size ( ) const
inline

Definition at line 108 of file Group.h.

◆ nAtoms() [1/2]

int nAtoms ( ) const
inline

Number of atoms in the group (>= 0)

Definition at line 113 of file Group.h.

◆ nAtoms() [2/2]

int nAtoms ( size_t  m) const
inline

Number of atoms of element m (positive or negative)

Definition at line 121 of file Group.h.

◆ fmt()

std::ostream & fmt ( std::ostream &  s,
const vector< string > &  esymbols 
) const

Definition at line 39 of file Group.cpp.

Friends And Related Symbol Documentation

◆ operator-

Group operator- ( const Group g1,
const Group g2 
)
friend

Definition at line 78 of file Group.h.

◆ operator+

Group operator+ ( const Group g1,
const Group g2 
)
friend

Definition at line 83 of file Group.h.

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const Group g 
)
friend

Definition at line 60 of file Group.cpp.

Member Data Documentation

◆ m_comp

vector<int> m_comp
private

Definition at line 134 of file Group.h.

◆ m_sign

int m_sign
private

Definition at line 135 of file Group.h.


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