Subversion Repositories wimsdev

Rev

Rev 472 | Rev 6770 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 472 Rev 820
Line 190... Line 190...
190
     if (al->groupe()) al->groupe(triage(al->groupe()));
190
     if (al->groupe()) al->groupe(triage(al->groupe()));
191
  }
191
  }
192
  return al;
192
  return al;
193
}
193
}
194
 
194
 
195
bool operator == (const AtomeListe & a1, const AtomeListe & a2){
195
bool AtomeListe::isEqual(const AtomeListe & a2) const {
196
  std::stringstream s1, s2;
196
  std::stringstream s1, s2;
197
  a1.printnorm(s1);
197
  printnorm(s1);
198
  a2.printnorm(s2);
198
  a2.printnorm(s2);
199
  return s1.str() == s2.str();
199
  return s1.str() == s2.str();
200
}
200
}
201
 
201
 
202
void AtomeListe::printcount(std::ostream & o, const fraction& n, int multiple=1) const{
202
void AtomeListe::printcount(std::ostream & o, const fraction& n, int multiple=1) const{
Line 245... Line 245...
245
  if (l.sq()) o << "]";
245
  if (l.sq()) o << "]";
246
  return o;
246
  return o;
247
}
247
}
248
 
248
 
249
const char* moltypeStr[] = { "aq", "g", "s" };
249
const char* moltypeStr[] = { "aq", "g", "s" };
250
 
-
 
251
bool operator == (const Molec & m1, const Molec & m2){
-
 
252
  return *(m1.al) == *(m2.al) && m1.ch == m2.ch;
-
 
253
}
-
 
254
 
250
 
255
const std::string Molec::signature()const{
251
const std::string Molec::signature()const{
256
  std::ostringstream o;
252
  std::ostringstream o;
257
  o << liste();
253
  o << liste();
258
  if (charge()){
254
  if (charge()){
Line 611... Line 607...
611
  return o;
607
  return o;
612
}
608
}
613
 
609
 
614
Membre operator & (Membre & m1, Membre & m2){
610
Membre operator & (Membre & m1, Membre & m2){
615
  Membre result;
611
  Membre result;
616
  result.printnorm(std::cout);
612
  //result.printnorm(std::cout);
617
  fraction min(1);
613
  fraction min(1);
618
  for(Membre::iterator i = m1.begin(); i < m1.end(); i++){
614
  for(Membre::iterator i = m1.begin(); i < m1.end(); i++){
619
    for(Membre::iterator j = m2.begin(); j < m2.end(); j++){
615
    for(Membre::iterator j = m2.begin(); j < m2.end(); j++){
620
      if (**i == **j){
616
      if ((*i)->eqMol(*j)){
621
        Molec *m = new Molec(**i);
617
        Molec *m = new Molec(**i);
622
        if ((*i)->nb > (*j)->nb){
618
        if ((*i)->nb > (*j)->nb){
623
          min=(*j)->nb;
619
          min=(*j)->nb;
624
        }else{
620
        }else{
625
          min=(*i)->nb;
621
          min=(*i)->nb;
Line 636... Line 632...
636
  Membre result;
632
  Membre result;
637
  fraction diff(1);
633
  fraction diff(1);
638
  for(Membre::iterator i = m1.begin(); i < m1.end(); i++){
634
  for(Membre::iterator i = m1.begin(); i < m1.end(); i++){
639
    Molec *m = new Molec(**i);
635
    Molec *m = new Molec(**i);
640
    for(Membre::iterator j = m2.begin(); j < m2.end(); j++){
636
    for(Membre::iterator j = m2.begin(); j < m2.end(); j++){
641
      if (**i == **j){
637
      if ((*i)->eqMol(*j)){
642
        diff=(*i)->nb - (*j)->nb;
638
        diff=(*i)->nb - (*j)->nb;
643
        m->nb=diff;
639
        m->nb=diff;
644
      }
640
      }
645
    }
641
    }
646
    result.push_back(m);
642
    result.push_back(m);