Changeset 2340
- Timestamp:
- Oct 16, 2010, 5:08:19 PM (12 years ago)
- Location:
- trunk/yat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/KNN.h
r2337 r2340 34 34 #include "yat/utility/Exception.h" 35 35 #include "yat/utility/Matrix.h" 36 #include "yat/utility/Vector.h" 36 37 #include "yat/utility/VectorConstView.h" 37 38 #include "yat/utility/VectorView.h" … … 192 193 193 194 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 195 235 196 236 template <typename Distance, typename NeighborWeighting> … … 199 239 { 200 240 BOOST_CONCEPT_ASSERT((utility::DistanceConcept<Distance>)); 241 BOOST_CONCEPT_ASSERT((NeighborWeightingConcept<NeighborWeighting>)); 201 242 } 202 243 … … 207 248 { 208 249 BOOST_CONCEPT_ASSERT((utility::DistanceConcept<Distance>)); 250 // BOOST_CONCEPT_ASSERT((NeighborWeightingConcept<NeighborWeighting>)); 209 251 } 210 252 -
trunk/yat/utility/concept_check.h
r2338 r2340 261 261 */ 262 262 template <class T> 263 class DistanceConcept : boost::CopyConstructible<T>263 class DistanceConcept : public boost::CopyConstructible<T> 264 264 { 265 265 public:
Note: See TracChangeset
for help on using the changeset viewer.