Changeset 898 for trunk/yat/statistics


Ignore:
Timestamp:
Sep 26, 2007, 3:44:19 PM (14 years ago)
Author:
Markus Ringnér
Message:

A first suggestion for how to adress #250. Also removed contamination of namespace std (see #251).

Location:
trunk/yat/statistics
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/euclidean_vector_distance.h

    r897 r898  
    5050  double vector_distance(Iter1 beg1, Iter1 end1, Iter2 beg2,
    5151                         const euclidean_vector_distance_tag& disttype,
    52                          std::weighted_random_access_iterator_tag)
     52                         utility::weighted_random_access_iterator_tag)
    5353  {
    5454    AveragerPairWeighted ap;
  • trunk/yat/statistics/pearson_vector_distance.h

    r897 r898  
    77
    88#include "AveragerPair.h"
     9#include "AveragerPairWeighted.h"
    910
    1011namespace theplu {
     
    4748  double vector_distance(Iter beg1,Iter end1, Iter beg2,
    4849                         const pearson_vector_distance_tag& disttype,
    49                          std::weighted_random_access_iterator_tag)
     50                         utility::weighted_random_access_iterator_tag)
    5051  {
    5152    AveragerPairWeighted ap;
  • trunk/yat/statistics/vector_distance.h

    r897 r898  
    66#include <iterator>
    77
     8#include "yat/classifier/DataLookup1D.h"
     9#include "yat/classifier/DataLookupWeighted1D.h"
     10
    811namespace theplu {
    912namespace yat {
    1013
    1114namespace statistics {
    12 
     15 
    1316  ///
    1417  /// For each measure to calculate distances between containers
     
    5255                           typename std::iterator_traits<Iter1>::iterator_category());
    5356  }       
     57
     58  /// A partial specialization for DataLookupWeighted1D
     59  template<typename Dist>
     60  double vector_distance(const classifier::DataLookupWeighted1D::const_iterator& beg1,const classifier::DataLookupWeighted1D::const_iterator& end1,const classifier::DataLookupWeighted1D::const_iterator& beg2)
     61  {
     62    return vector_distance(beg1,end1,beg2, typename statistics::vector_distance_traits<Dist>::distance());
     63  }
    5464 
    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)
     65  /// A partial specialization for DataLookup1D
     66  template<typename Dist>
     67  double vector_distance(const classifier::DataLookup1D::const_iterator& beg1,const classifier::DataLookup1D::const_iterator& end1,const classifier::DataLookup1D::const_iterator& beg2)
    5968  {
    60     return 0;
    61   }       
     69    return vector_distance(beg1,end1,beg2, typename statistics::vector_distance_traits<Dist>::distance());
     70  }
    6271
    6372 
Note: See TracChangeset for help on using the changeset viewer.