Back to index

wims  3.65+svn20090927
Public Member Functions | Public Attributes
Membre Class Reference

#include <chemeq.h>

Inheritance diagram for Membre:
Inheritance graph
[legend]
Collaboration diagram for Membre:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int findMol (const Molec *)
void addMol (const Molec *)
void addMembre (const Membre *)
void eraseNull ()
void compte (Compteur &c) const
void numerote ()
void triage ()
void printnorm (std::ostream &o) const
void printcount (std::ostream &o) const
void printelec (std::ostream &o) const
void printspecies (std::ostream &o) const
void printweight (std::ostream &o) const
void coeff (fraction f)
void printNernst (std::ostream &o)
void printNernstWIMS (std::ostream &o, bool wantedlatex)
int printableNernst ()
bool redox () const
fraction nbelectron () const
void debug (int decal=0) const

Public Attributes

elements
 STL member.

Detailed Description

Definition at line 182 of file chemeq.h.


Member Function Documentation

void Membre::addMembre ( const Membre m)

Definition at line 467 of file chemeq.cc.

                                      {
  for(int i=0; i<m->size(); i++){
    addMol((*m)[i]);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Membre::addMol ( const Molec m)

Definition at line 458 of file chemeq.cc.

                                  {
  int i = findMol(m);
  if (i < 0){
    push_back(new Molec(*m));
  } else {
    (*this)[i]->add(m->nombre());
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void Membre::coeff ( fraction  f)

Definition at line 545 of file chemeq.cc.

                             {
  for (int i=0; i<size(); i++) operator[](i)->coeff(f);
}

Here is the caller graph for this function:

void Membre::compte ( Compteur c) const

Definition at line 481 of file chemeq.cc.

                                    {
  for(int i =0; i < size(); i++){
    operator [] (i)->compte(c);
  }
}

Here is the caller graph for this function:

void Membre::debug ( int  decal = 0) const [inline]

Definition at line 202 of file chemeq.h.

                                {
    for (int i=0; i < decal; i++) std::cout << " ";
    std::cout << "Membre : ( " << this;
    for (int j=0; j < size(); j++){
      std::cout << j << " :\n";
      operator[](j)->debug(decal+2);
    }
    std::cout << "\n";
  }

Definition at line 473 of file chemeq.cc.

                      {
  Membre m(*this);
  clear();
  for(int i=0; i < m.size();i++){
    if (m[i]->nombre().i>0) push_back(m[i]);
  }
}

Here is the caller graph for this function:

int Membre::findMol ( const Molec m)

Definition at line 448 of file chemeq.cc.

                                  {
  // returns the index of a molecule with the same atomlist if any
  // else returns -1.
  int result=-1;
  for(int i=0; i<size(); i++){
    if ((*this)[i]->eqMol(m)) result=i;
  }
  return result;
}

Here is the caller graph for this function:

Definition at line 566 of file chemeq.cc.

                                 {
  fraction result(0);

  for(int i = 0; i<size(); i++) result=result+(*this)[i]->nbelectron();
  return result;
}

Here is the caller graph for this function:

void Membre::numerote ( )

Definition at line 487 of file chemeq.cc.

                     {
  for (int i=0; i < size(); i++){
    operator [](i)->numero(i);
    operator [](i)->liste().numerote();
  }
}

Here is the caller graph for this function:

Definition at line 549 of file chemeq.cc.

                           {
  int result=0;
  for (int i=0; i<size(); i++) {
    if (operator[](i)->typage() != sol && 
       !operator[](i)->iswater() &&
       !operator[](i)->iselectron()) result =1;
  }  
  return result;
}

Here is the caller graph for this function:

void Membre::printcount ( std::ostream &  o) const

Definition at line 510 of file chemeq.cc.

                                           {
  bool first=true;
  for(int i=0; i < size(); i++){
    first=operator[](i)->printcount(o,first);
  }
}

Here is the caller graph for this function:

void Membre::printelec ( std::ostream &  o) const

Definition at line 517 of file chemeq.cc.

                                          {
  bool first=true;
  for(int i=0; i < size(); i++){
    first=operator[](i)->printelec(o,first);
  }
}

Here is the caller graph for this function:

void Membre::printNernst ( std::ostream &  o)

Definition at line 573 of file chemeq.cc.

                                      {
  bool printed = 0; 
  const char * prefix="";
  for (int i=0; i<size(); i++) {
    if (i>0) prefix="\\,";
    if (operator[](i)->printNernst(o, prefix)){
      printed = 1; 
    }
  }
  if (!printed) o << "1";
}

Here is the caller graph for this function:

void Membre::printNernstWIMS ( std::ostream &  o,
bool  wantedlatex 
)

Definition at line 585 of file chemeq.cc.

                                                            {
  bool printed = false; 
  bool addcomma = false;
  for (int i=0; i<size(); i++) {
    std::ostringstream w;
    if (operator[](i)->printNernstWIMS(w,wantedlatex)){
      if (addcomma) o << ", ";
      o << w.str();
      printed = true; 
      addcomma = true;
    } else {
      addcomma = false;
    }
  }
  if (!printed) o << "1";
}

Here is the caller graph for this function:

void Membre::printnorm ( std::ostream &  o) const

Definition at line 531 of file chemeq.cc.

                                          {
  for(int i=0; i < size(); i++){
    operator[](i)->printnorm(o);
    if (i < size()-1) o << " + ";
  }
}

Here is the caller graph for this function:

void Membre::printspecies ( std::ostream &  o) const

Definition at line 524 of file chemeq.cc.

                                             {
  bool first=true;
  for(int i=0; i < size(); i++){
    first=operator[](i)->printspecies(o,first);
  }
}

Here is the caller graph for this function:

void Membre::printweight ( std::ostream &  o) const

Definition at line 538 of file chemeq.cc.

                                            {
  for(int i=0; i < size(); i++){
    o << operator[](i)->weight();
    if (i < size()-1) o << " ";
  }
}

Here is the caller graph for this function:

bool Membre::redox ( ) const

Definition at line 559 of file chemeq.cc.

                       {
  for (int i=0; i<size(); i++){
    if ((*this)[i]->iselectron()) /* c'est un électron */ return 1;
  }
  return 0;
}

Here is the caller graph for this function:

void Membre::triage ( )

Definition at line 494 of file chemeq.cc.

                   {
  int i,j;
  for (i=0; i < size(); i++){
    operator [](i)->triage();
  }
  for (i=0; i < size(); i++){
    for (j=i+1; j < size(); j++){
      if (operator [](i)->signature() > operator [](j)->signature()){
       Molec * m = operator [](i);
       operator [](i) = operator [](j);
       operator [](j) = m;
      }
    }
  }
}

Here is the caller graph for this function:


Member Data Documentation

template<typename T>
T std::vector< T >::elements [inherited]

STL member.


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