~ubuntu-branches/ubuntu/wily/chemeq/wily

« back to all changes in this revision

Viewing changes to src/chemeq.cc

  • Committer: Bazaar Package Importer
  • Author(s): Georges Khaznadar
  • Date: 2008-10-01 14:09:26 UTC
  • mfrom: (3.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081001140926-0jbsi3ep6srgxc42
Tags: 2.8-4
updated the test suite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
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
196
  std::stringstream s1, s2;
197
 
  a1.printnorm(s1);
 
197
  printnorm(s1);
198
198
  a2.printnorm(s2);
199
199
  return s1.str() == s2.str();
200
200
}
248
248
 
249
249
const char* moltypeStr[] = { "aq", "g", "s" };
250
250
 
251
 
bool operator == (const Molec & m1, const Molec & m2){
252
 
  return *(m1.al) == *(m2.al) && m1.ch == m2.ch;
253
 
}
254
 
 
255
251
const std::string Molec::signature()const{
256
252
  std::ostringstream o;
257
253
  o << liste();
613
609
 
614
610
Membre operator & (Membre & m1, Membre & m2){
615
611
  Membre result;
616
 
  result.printnorm(std::cout);
 
612
  //result.printnorm(std::cout);
617
613
  fraction min(1);
618
614
  for(Membre::iterator i = m1.begin(); i < m1.end(); i++){
619
615
    for(Membre::iterator j = m2.begin(); j < m2.end(); j++){
620
 
      if (**i == **j){
 
616
      if ((*i)->eqMol(*j)){
621
617
        Molec *m = new Molec(**i);
622
618
        if ((*i)->nb > (*j)->nb){
623
619
          min=(*j)->nb;
638
634
  for(Membre::iterator i = m1.begin(); i < m1.end(); i++){
639
635
    Molec *m = new Molec(**i);
640
636
    for(Membre::iterator j = m2.begin(); j < m2.end(); j++){
641
 
      if (**i == **j){
 
637
      if ((*i)->eqMol(*j)){
642
638
        diff=(*i)->nb - (*j)->nb;
643
639
        m->nb=diff;
644
640
      }