Changeset 1204


Ignore:
Timestamp:
Oct 5, 2010, 2:42:30 PM (11 years ago)
Author:
Peter Johansson
Message:

refs #475. remove dead code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Functor.h

    r1203 r1204  
    153153  };
    154154 
    155   ///
    156   /// Calculating sum of two vectors.
    157   ///
    158   /// @return resulting vector
    159   ///
    160   template <typename T >
    161   struct VectorPlus :
    162     public std::binary_function<std::vector<T>,std::vector<T>,std::vector<T> >
    163   {
    164     std::vector<T> operator()(const std::vector<T>& u,
    165                               const std::vector<T>& v) const
    166     {
    167       std::vector<T> res;
    168       res.reserve(std::max(u.size(), v.size()));
    169       std::back_insert_iterator<std::vector<T> > inserter(res);
    170       if ( u.size() > v.size() ){
    171         std::transform(v.begin(), v.end(), u.begin(), inserter, std::plus<T>());
    172         std::copy(u.begin()+v.size(), u.end(), inserter);
    173       }
    174       else {
    175         std::transform(u.begin(), u.end(), v.begin(), inserter, std::plus<T>());
    176         std::copy(v.begin()+u.size(), v.end(), inserter);
    177       }
    178       return res;
    179     }
     155  /**
     156     Functor perfoming plus assignment on first argument using second argument
    180157
    181   };
    182 
    183   ///
    184   /// @return resulting vector
    185   ///
    186   template <typename Key, typename T>
    187   struct PairValuePlus :
    188     public std::binary_function<T, std::pair<const Key, T>, T>
    189   {
    190     T operator()(const T& sum, const std::pair<const Key, T>& p)
    191     {
    192       return sum + p.second;
    193     }
    194   };
    195 
    196 
     158     arg1 += arg2.second
     159   */
    197160  template <typename Key, typename T>
    198161  struct PairValuePlusAssign :
Note: See TracChangeset for help on using the changeset viewer.