Rev 13325 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 13325 | Rev 17747 | ||
---|---|---|---|
Line 112... | Line 112... | ||
112 | {105, "Db"}, |
112 | {105, "Db"}, |
113 | {106, "Sg"}, |
113 | {106, "Sg"}, |
114 | {107, "Bh"}, |
114 | {107, "Bh"}, |
115 | {108, "Hs"}, |
115 | {108, "Hs"}, |
116 | {109, "Mt"}, |
116 | {109, "Mt"}, |
117 | {110, " |
117 | {110, "Ds"}, |
118 | {111, " |
118 | {111, "Rg"}, |
119 | {112, " |
119 | {112, "Cn"}, |
120 | {113, " |
120 | {113, "Nh"}, |
121 | {114, " |
121 | {114, "Fl"}, |
122 | {115, " |
122 | {115, "Mc"}, |
123 | {116, " |
123 | {116, "Lv"}, |
124 | {117, " |
124 | {117, "Ts"}, |
125 | {118, " |
125 | {118, "Og"}, |
126 | {0,"fin"} |
126 | {0,"fin"} |
127 | }; |
127 | }; |
128 | 128 | ||
129 | std::ostream & Compteur::operator << (std::ostream & o)const{ |
129 | std::ostream & Compteur::operator << (std::ostream & o)const{ |
130 | const_iterator i=begin(); |
130 | const_iterator i=begin(); |
Line 180... | Line 180... | ||
180 | if(al->Z()!=0){ /* cas où ce n'est pas un groupe */ |
180 | if(al->Z()!=0){ /* cas où ce n'est pas un groupe */ |
181 | if (al->suiv){ |
181 | if (al->suiv){ |
182 | al->suiv = triage(al->suiv); |
182 | al->suiv = triage(al->suiv); |
183 | } |
183 | } |
184 | while (al->suiv && al->suiv->Zed!=0 && |
184 | while (al->suiv && al->suiv->Zed!=0 && |
185 | strcmp(al->symbole(), al->suiv->symbole()) > |
185 | strcmp(al->symbole(), al->suiv->symbole()) > 0){ |
186 | al1=al; al=al->suiv; al1->suiv=al->suiv; al->suiv=triage(al1); |
186 | al1=al; al=al->suiv; al1->suiv=al->suiv; al->suiv=triage(al1); |
187 | } |
187 | } |
188 | } |
188 | } |
189 | else{ /* cas d'un groupe */ |
189 | else{ /* cas d'un groupe */ |
190 | if (al->groupe()) al->groupe(triage(al->groupe())); |
190 | if (al->groupe()) al->groupe(triage(al->groupe())); |
Line 283... | Line 283... | ||
283 | bool Molec::printspecies(std::ostream & o, bool first) const{ |
283 | bool Molec::printspecies(std::ostream & o, bool first) const{ |
284 | if (!first) o << ", "; |
284 | if (!first) o << ", "; |
285 | first=false; |
285 | first=false; |
286 | printnorm(o); |
286 | printnorm(o); |
287 | return first; |
287 | return first; |
- | 288 | } |
|
- | 289 | ||
- | 290 | void Molec::delete_aq(){ |
|
- | 291 | // retire les attributs aqueux |
|
- | 292 | if (t==aqueous_explicit) t=aqueous; |
|
288 | } |
293 | } |
289 | 294 | ||
290 | void Molec::printnorm(std::ostream & o)const{ |
295 | void Molec::printnorm(std::ostream & o)const{ |
291 | if (nb!=1) o << nb << " "; |
296 | if (nb!=1) o << nb << " "; |
292 | al-> printnorm(o); |
297 | al-> printnorm(o); |
Line 407... | Line 412... | ||
407 | } |
412 | } |
408 | } |
413 | } |
409 | return true; |
414 | return true; |
410 | } |
415 | } |
411 | return false; |
416 | return false; |
412 | } |
417 | } |
413 | 418 | ||
414 | bool Molec::iswater()const{ |
419 | bool Molec::iswater()const{ |
415 | if (t != aqueous) return 0; |
420 | if (t != aqueous) return 0; |
416 | if (signature()==std::string("\\mathrm{H}_{2}\\mathrm{O}") || |
421 | if (signature()==std::string("\\mathrm{H}_{2}\\mathrm{O}") || |
417 | signature()==std::string("\\mathrm{O}\\mathrm{H}_{2}")) return 1; |
422 | signature()==std::string("\\mathrm{O}\\mathrm{H}_{2}")) return 1; |
Line 498... | Line 503... | ||
498 | void Membre::numerote(){ |
503 | void Membre::numerote(){ |
499 | for (unsigned int i=0; i < size(); i++){ |
504 | for (unsigned int i=0; i < size(); i++){ |
500 | operator [](i)->numero(i); |
505 | operator [](i)->numero(i); |
501 | operator [](i)->liste().numerote(); |
506 | operator [](i)->liste().numerote(); |
502 | } |
507 | } |
- | 508 | } |
|
- | 509 | ||
- | 510 | void Membre::delete_aq(){ |
|
- | 511 | // retire les attributs aqueux |
|
- | 512 | for (unsigned int i=0; i < size(); i++){ |
|
- | 513 | operator [](i)->delete_aq(); |
|
- | 514 | } |
|
503 | } |
515 | } |
504 | 516 | ||
505 | void Membre::triage(){ |
517 | void Membre::triage(){ |
506 | unsigned int i,j; |
518 | unsigned int i,j; |
507 | for (i=0; i < size(); i++){ |
519 | for (i=0; i < size(); i++){ |
Line 776... | Line 788... | ||
776 | droit->coeff(mult); |
788 | droit->coeff(mult); |
777 | simplifie(); |
789 | simplifie(); |
778 | if (!redox() && valdefined()){ |
790 | if (!redox() && valdefined()){ |
779 | val = val*mult.i/mult.d; |
791 | val = val*mult.i/mult.d; |
780 | } |
792 | } |
- | 793 | } |
|
- | 794 | ||
- | 795 | void Chemeq::delete_aq(){ |
|
- | 796 | // supprime tous les attributs "aqueux" des molécules ou ions présents |
|
- | 797 | gauche->delete_aq(); |
|
- | 798 | droit->delete_aq(); |
|
781 | } |
799 | } |
782 | 800 | ||
783 | void Chemeq::multiply(int num, int den){ |
801 | void Chemeq::multiply(int num, int den){ |
784 | fraction mult(num,den); |
802 | fraction mult(num,den); |
785 | gauche->coeff(mult); |
803 | gauche->coeff(mult); |