/[escript]/trunk-mpi-branch/escript/src/BinaryOp.h
ViewVC logotype

Diff of /trunk-mpi-branch/escript/src/BinaryOp.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 122 by jgs, Thu Jun 9 05:38:05 2005 UTC revision 154 by jgs, Mon Nov 7 05:51:17 2005 UTC
# Line 47  inline void binaryOp(DataTagged& left, c Line 47  inline void binaryOp(DataTagged& left, c
47               BinaryFunction operation)               BinaryFunction operation)
48  {  {
49    //    //
50    // perform the operation on each tagged value including the default    // perform the operation on each tagged value
51    const DataTagged::DataMapType& lookup=left.getTagLookup();    const DataTagged::DataMapType& lookup=left.getTagLookup();
52    DataTagged::DataMapType::const_iterator i;    DataTagged::DataMapType::const_iterator i;
53    DataTagged::DataMapType::const_iterator lookupEnd=lookup.end();    DataTagged::DataMapType::const_iterator lookupEnd=lookup.end();
# Line 77  inline void binaryOp(DataTagged& left, c Line 77  inline void binaryOp(DataTagged& left, c
77    DataTagged::DataMapType::const_iterator rightLookupEnd=rightLookup.end();    DataTagged::DataMapType::const_iterator rightLookupEnd=rightLookup.end();
78    for (i=rightLookup.begin();i!=rightLookupEnd;i++) {    for (i=rightLookup.begin();i!=rightLookupEnd;i++) {
79      //      //
80      // Add the right hand tag to the left hand tag list and assign      // If the left does not already have a value assigned to this tag,
81      // the rights default value. If the tag already exists the      // add the right hand tag to the left hand tag list and assign
82      // attempt to add it again will be ignored.      // the right's default value.
83      left.addTaggedValue(i->first,right.getDefaultValue());      if (!left.isCurrentTag(i->first)) {
84          left.addTaggedValue(i->first,right.getDefaultValue());
85        }
86    }    }
87    //    //
88    // Perform the operation. Any tags originally in the left which don't exist for    // Perform the operation. Any tags originally in the left which don't exist for

Legend:
Removed from v.122  
changed lines
  Added in v.154

  ViewVC Help
Powered by ViewVC 1.1.26