Changeset 891


Ignore:
Timestamp:
Sep 25, 2007, 4:26:33 PM (13 years ago)
Author:
Markus Ringnér
Message:

Minor modifications

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/vector_distance_test.cc

    r890 r891  
    7878  }
    7979
     80
     81  // Test with reference to a vector_distance_tag
     82  statistics::euclidean_vector_distance_tag tag;
     83  statistics::vector_distance_tag& tagref=tag;
     84  dist=statistics::vector_distance(aw.begin(),aw.end(),bw.begin(),tagref);
     85  *error << "Dist: " << dist << std::endl;
     86
    8087  if (error!=&std::cerr)
    8188    delete error;
     
    8794
    8895
    89 
  • trunk/yat/statistics/euclidean_vector_distance.h

    r890 r891  
    3131  /// distance measure and iterators to unweighted containers.
    3232  ///
    33   template <class Iter>
    34   double vector_distance(Iter beg1,Iter end1, Iter beg2,
     33  template <typename Iter1, typename Iter2>
     34  double vector_distance(Iter1 beg1,Iter1 end1, Iter2 beg2,
    3535                         const euclidean_vector_distance_tag& disttype,
    3636                         std::random_access_iterator_tag)
     
    4747  /// distance measure and iterators to weighted containers.
    4848  ///
    49   template <class Iter>
    50   double vector_distance(Iter beg1,Iter end1, Iter beg2,
     49  template <typename Iter1, typename Iter2>
     50  double vector_distance(Iter1 beg1, Iter1 end1, Iter2 beg2,
    5151                         const euclidean_vector_distance_tag& disttype,
    5252                         std::weighted_random_access_iterator_tag)
  • trunk/yat/statistics/vector_distance.h

    r889 r891  
    4343  /// (templatized as Dist). It can also call separate implementations
    4444  /// for iterators to weighted and unweighted iterators based on the
    45   /// trait of the iterator (templatized as Iter).
     45  /// trait of the iterators (templatized as Iter1 and Iter2).
    4646  ///
    47   template <typename Iter, typename Dist>
    48   double vector_distance(Iter beg1, Iter end1, Iter beg2, const Dist& disttag)
     47  template <typename Iter1, typename Iter2, typename Dist>
     48  double vector_distance(Iter1 beg1, Iter1 end1, Iter2 beg2, const Dist disttag)
    4949  {
    50     return vector_distance(beg1,end1,beg2,typename vector_distance_traits<Dist>::distance(),
    51                            typename std::iterator_traits<Iter>::iterator_category());
     50    return vector_distance(beg1,end1,beg2,
     51                           typename vector_distance_traits<Dist>::distance(),
     52                           typename std::iterator_traits<Iter1>::iterator_category());
    5253  }       
    5354 
     55  // Temporary function of where I end up when calling with a reference to distance_tag
     56  template <typename Iter1, typename Iter2>
     57  double vector_distance(Iter1 beg1, Iter1 end1, Iter2 beg2,
     58                         const vector_distance_tag& disttag)
     59  {
     60    std::cout << "Hello" << std::endl;
     61    return 0;
     62  }       
     63
     64 
    5465}}} // of namespace statistics, yat, and theplu
    55    
     66
    5667#endif
Note: See TracChangeset for help on using the changeset viewer.