Changeset 909 for trunk/yat


Ignore:
Timestamp:
Sep 29, 2007, 1:49:05 AM (14 years ago)
Author:
Peter
Message:

using weighted_iterator_traits, closes #151

Location:
trunk/yat
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/NCC.h

    r898 r909  
    9999  private:
    100100    utility::matrix centroids_;
    101     const statistics::vector_distance_lookup_weighted_ptr distance_;                 
     101    const statistics::vector_distance_lookup_weighted_ptr distance_;
    102102
    103103    // data_ has to be of type DataLookup2D to accomodate both
  • trunk/yat/statistics/euclidean_vector_distance.h

    r900 r909  
    77#include "AveragerPairWeighted.h"
    88#include "vector_distance.h"
     9#include "yat/utility/IteratorTraits.h"
    910
    1011#include <cmath>
     
    3435  double vector_distance(Iter1 beg1,Iter1 end1, Iter2 beg2,
    3536                         const euclidean_vector_distance_tag& disttype,
    36                          std::forward_iterator_tag)
     37                         utility::unweighted_type)
    3738  {
    3839    AveragerPair ap;
     
    5051  double vector_distance(Iter1 beg1, Iter1 end1, Iter2 beg2,
    5152                         const euclidean_vector_distance_tag& disttype,
    52                          utility::weighted_random_access_iterator_tag)
     53                         utility::weighted_type)
    5354  {
    5455    AveragerPairWeighted ap;
  • trunk/yat/statistics/pearson_vector_distance.h

    r900 r909  
    88#include "AveragerPair.h"
    99#include "AveragerPairWeighted.h"
     10#include "yat/utility/IteratorTraits.h"
    1011
    1112namespace theplu {
     
    3334  double vector_distance(Iter beg1,Iter end1, Iter beg2,
    3435                         const pearson_vector_distance_tag& disttype,
    35                          std::forward_iterator_tag)
     36                         utility::unweighted_type)
    3637  {
    3738    AveragerPair ap;
     
    4849  double vector_distance(Iter beg1,Iter end1, Iter beg2,
    4950                         const pearson_vector_distance_tag& disttype,
    50                          utility::weighted_random_access_iterator_tag)
     51                         utility::weighted_type)
    5152  {
    5253    AveragerPairWeighted ap;
  • trunk/yat/statistics/vector_distance.h

    r898 r909  
    88#include "yat/classifier/DataLookup1D.h"
    99#include "yat/classifier/DataLookupWeighted1D.h"
     10#include "yat/utility/IteratorTraits.h"
    1011
    1112namespace theplu {
     
    5152  double vector_distance(Iter1 beg1, Iter1 end1, Iter2 beg2, const Dist disttag)
    5253  {
    53     return vector_distance(beg1,end1,beg2,
    54                            typename vector_distance_traits<Dist>::distance(),
    55                            typename std::iterator_traits<Iter1>::iterator_category());
     54    return
     55      vector_distance(beg1,end1,beg2,
     56                      typename vector_distance_traits<Dist>::distance(),
     57                      typename utility::weighted_iterator_traits<Iter1>::type());
    5658  }       
    5759
  • trunk/yat/utility/IteratorTraits.h

    r908 r909  
    5858  struct weighted_iterator_traits<yat::utility::IteratorWeighted<U,V> > {
    5959    typedef weighted_type type;
    60   }
    61 };
    62 
    63 
     60  };
    6461
    6562}}} // of namespace utility, yat, and theplu
  • trunk/yat/utility/IteratorWeighted.h

    r898 r909  
    77#include <stddef.h>
    88
    9 // namespace std {
    10 //  struct weighted_random_access_iterator_tag
    11 //    : public random_access_iterator_tag {
    12 //  };
    13 // }
    14 
    15 
    169namespace theplu {
    1710namespace yat {
    1811namespace utility {
    19 
    20   struct weighted_random_access_iterator_tag
    21     : public std::random_access_iterator_tag {
    22   };
    2312
    2413  /**
     
    2918  {
    3019  public:
    31     typedef weighted_random_access_iterator_tag iterator_category;
     20    typedef std::random_access_iterator_tag iterator_category;
    3221    typedef double value_type;
    3322    typedef size_t difference_type;
Note: See TracChangeset for help on using the changeset viewer.