Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Private Attributes
AtomeListe Class Reference

#include <chemeq.h>

Collaboration diagram for AtomeListe:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AtomeListe (const char *nom, int num, AtomeListe *s=0, AtomeListe *g=0)
 AtomeListe (const AtomeListe &a)
const char * symbole () const
int Z () const
int sq () const
void sq (int val)
void numerote (int n=0)
void setmolecularite (int n)
int getmolecularite () const
AtomeListegroupe ()
void groupe (AtomeListe *al)
const AtomeListesuivant () const
const AtomeListegroupe () const
void setsuivant (AtomeListe *s)
void compte (Compteur &c, fraction mult=fraction(1, 1)) const
double weight (fraction mult=fraction(1, 1)) const
void printcount (std::ostream &o, const fraction &, int multiple) const
void printnorm (std::ostream &o) const
bool isEqual (const AtomeListe &a2) const
void debug (int decal=0) const

Static Public Member Functions

static AtomeListetriage (AtomeListe *al)

Private Attributes

AtomeListesuiv
AtomeListegroup
char symb [4]
int Zed
int nb
int no
int sqbr

Detailed Description

Definition at line 77 of file chemeq.h.


Constructor & Destructor Documentation

AtomeListe::AtomeListe ( const char *  nom,
int  num,
AtomeListe s = 0,
AtomeListe g = 0 
) [inline]

Definition at line 83 of file chemeq.h.

                                                                          {
    strncpy(symb,nom,3); Zed=num; nb=1; sqbr=0;
    /* sqbr == 1 quand il y a un square bracket */
    suiv = s; group=g;
  };
AtomeListe::AtomeListe ( const AtomeListe a) [inline]

Definition at line 88 of file chemeq.h.

                                  :
    suiv(a.suiv), group(a.group), Zed(a.Zed), nb(a.nb), sqbr(a.sqbr){
    strncpy(symb,a.symb,3);
  };

Member Function Documentation

void AtomeListe::compte ( Compteur c,
fraction  mult = fraction(1,1) 
) const

Definition at line 155 of file chemeq.cc.

                                                      {
  const AtomeListe * al;
  if(Zed!=0 && Zed!=-1 ){ /* cas où ce n'est pas un groupe ou un électron */
    std::string key(symb);
    c[key] +=1.0*nb*mult.i/mult.d;
  }
  else if (Zed==0){ /* cas d'un groupe */
    if (group) group->compte(c,mult*nb);
  }
  if (suiv) suiv->compte(c,mult);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 110 of file chemeq.h.

                                {
    for (int i=0; i< decal; i++) std::cout << " ";
    std::cout << "AtomeListe : ( & = " << this << " symb=\"" << symb << "\" Zed = " << Zed 
        << " nb = " << nb << " no = " << no 
        << " suiv = " << suiv << " group = " << group
        << ")\n";
    if(group) group->debug(2+decal);
    if(suiv) suiv->debug(decal);
  };

Here is the call graph for this function:

Here is the caller graph for this function:

int AtomeListe::getmolecularite ( ) const [inline]

Definition at line 98 of file chemeq.h.

{return nb;};

Here is the caller graph for this function:

Definition at line 99 of file chemeq.h.

{return group;};

Here is the caller graph for this function:

void AtomeListe::groupe ( AtomeListe al) [inline]

Definition at line 100 of file chemeq.h.

{group= al;};
const AtomeListe* AtomeListe::groupe ( ) const [inline]

Definition at line 102 of file chemeq.h.

{return group;};
bool AtomeListe::isEqual ( const AtomeListe a2) const

Definition at line 195 of file chemeq.cc.

                                                    {
  std::stringstream s1, s2;
  printnorm(s1);
  a2.printnorm(s2);
  return s1.str() == s2.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AtomeListe::numerote ( int  n = 0)

Definition at line 167 of file chemeq.cc.

                              {
  if(Zed!=0){ /* cas où ce n'est pas un groupe */
    no = n;
  }
  else if (Zed==0){ /* cas d'un groupe */
    no = n;
    if (group) group->numerote();
  }
  if (suiv) suiv->numerote(n+1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AtomeListe::printcount ( std::ostream &  o,
const fraction n,
int  multiple = 1 
) const

Definition at line 202 of file chemeq.cc.

                                                                                  {
  if(Zed!=0){ /* cas où ce n'est pas un groupe */
    o << symb;
    o << ':' << n << '*' << multiple*nb;
  }
  else{ /* cas d'un groupe */
    if (group) group->printcount(o,n,nb);
  }  
  if (suiv) {o << ' '; suiv->printcount(o,n,multiple);}
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 213 of file chemeq.cc.

                                              {
  if (sqbr) o << "[";
  if(Zed!=0){ /* cas où ce n'est pas un groupe */
    o << symb;
    if (nb!=1) o << nb;
  }
  else{ /* cas d'un groupe */
    o << "(";
    if (group) group->printnorm(o);
    o << ")" << nb;
  }  
  if (suiv) suiv->printnorm(o);
  if (sqbr) o << "]";
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AtomeListe::setmolecularite ( int  n) [inline]

Definition at line 97 of file chemeq.h.

{nb=n;};
void AtomeListe::setsuivant ( AtomeListe s) [inline]

Definition at line 103 of file chemeq.h.

{suiv=s;};
int AtomeListe::sq ( ) const [inline]

Definition at line 94 of file chemeq.h.

{return sqbr;};

Here is the caller graph for this function:

void AtomeListe::sq ( int  val) [inline]

Definition at line 95 of file chemeq.h.

{sqbr=val;};
const AtomeListe* AtomeListe::suivant ( ) const [inline]

Definition at line 101 of file chemeq.h.

{return suiv;};

Here is the caller graph for this function:

const char* AtomeListe::symbole ( ) const [inline]

Definition at line 92 of file chemeq.h.

{return symb;};

Here is the caller graph for this function:

Definition at line 178 of file chemeq.cc.

                                              {
  AtomeListe * al1;
  if(al->Z()!=0){ /* cas où ce n'est pas un groupe */
    if (al->suiv){
      al->suiv = triage(al->suiv);
    }
    while (al->suiv && al->suiv->Zed!=0 && 
          strcmp(al->symbole(), al->suiv->symbole()) > 1){
      al1=al; al=al->suiv; al1->suiv=al->suiv; al->suiv=triage(al1);
    }
  }
  else{ /* cas d'un groupe */
     if (al->groupe()) al->groupe(triage(al->groupe()));
  }
  return al;
}

Here is the call graph for this function:

double AtomeListe::weight ( fraction  mult = fraction(1,1)) const

Definition at line 142 of file chemeq.cc.

                                           {
  const AtomeListe * al;
  double w=0.0;
  if(Zed!=0 && Zed!=-1 ){ /* cas où ce n'est pas un groupe ou un électron */
    w=mendelweight(symb)*nb*mult.i/mult.d;
  }
  else if (Zed==0){ /* cas d'un groupe */
    if (group) w+=group->weight(mult*nb);
  }
  if (suiv) w+=suiv->weight(mult);
  return w;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int AtomeListe::Z ( ) const [inline]

Definition at line 93 of file chemeq.h.

{return Zed;};

Here is the caller graph for this function:


Member Data Documentation

Definition at line 78 of file chemeq.h.

int AtomeListe::nb [private]

Definition at line 80 of file chemeq.h.

int AtomeListe::no [private]

Definition at line 80 of file chemeq.h.

int AtomeListe::sqbr [private]

Definition at line 80 of file chemeq.h.

Definition at line 78 of file chemeq.h.

char AtomeListe::symb[4] [private]

Definition at line 79 of file chemeq.h.

int AtomeListe::Zed [private]

Definition at line 80 of file chemeq.h.


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