Ignore:
Timestamp:
Oct 16, 2010, 5:08:19 PM (12 years ago)
Author:
Peter
Message:

closes #627

File:
1 edited

Legend:

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

    r2337 r2340  
    3434#include "yat/utility/Exception.h"
    3535#include "yat/utility/Matrix.h"
     36#include "yat/utility/Vector.h"
    3637#include "yat/utility/VectorConstView.h"
    3738#include "yat/utility/VectorView.h"
     
    192193 
    193194 
    194   // templates
     195  /**
     196     \brief Concept check for a \ref concept_neighbor_weighting
     197
     198     This class is intended to be used in a <a
     199     href="\boost_url/concept_check/using_concept_check.htm">
     200     BOOST_CONCEPT_ASSERT </a>
     201
     202     \code
     203     template<class Distance>
     204     void some_function(double x)
     205     {
     206     BOOST_CONCEPT_ASSERT((DistanceConcept<Distance>));
     207     ...
     208     }
     209     \endcode
     210
     211     \since New in yat 0.7
     212  */
     213  template <class T>
     214  class NeighborWeightingConcept
     215    : public boost::DefaultConstructible<T>, public boost::Assignable<T>
     216  {
     217  public:
     218    /**
     219       \brief function doing the concept test
     220     */
     221    BOOST_CONCEPT_USAGE(NeighborWeightingConcept)
     222    {
     223      T neighbor_weighting;
     224      utility::Vector vec;
     225      const utility::VectorBase& distance(vec);
     226      utility::VectorMutable& prediction(vec);
     227      std::vector<size_t> k_sorted;
     228      Target target;
     229      neighbor_weighting(distance, k_sorted, target, prediction);
     230    }
     231  private:
     232  };
     233
     234  // template implementation
    195235 
    196236  template <typename Distance, typename NeighborWeighting>
     
    199239  {
    200240    BOOST_CONCEPT_ASSERT((utility::DistanceConcept<Distance>));
     241    BOOST_CONCEPT_ASSERT((NeighborWeightingConcept<NeighborWeighting>));
    201242  }
    202243
     
    207248  {
    208249    BOOST_CONCEPT_ASSERT((utility::DistanceConcept<Distance>));
     250    //    BOOST_CONCEPT_ASSERT((NeighborWeightingConcept<NeighborWeighting>));
    209251  }
    210252
Note: See TracChangeset for help on using the changeset viewer.