00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00076 #ifndef __LSHKIT_CONCEPT__
00077 #define __LSHKIT_CONCEPT__
00078
00079 #include <boost/concept/assert.hpp>
00080 #include <boost/concept/usage.hpp>
00081
00082 namespace lshkit {
00083
00085 template <typename LSH>
00086 struct LshConcept
00087 {
00088 typedef typename LSH::Domain Domain;
00089 typedef typename LSH::Parameter Parameter;
00090
00091 BOOST_CONCEPT_USAGE(LshConcept)
00092 {
00093 LSH lsh1(param, rng1);
00094 LSH lsh2(param, rng2);
00095 LSH lsh3;
00096 lsh.reset(param, rng1);
00097 lsh.reset(param, rng2);
00098 same_type(lsh.getRange(), u);
00099 same_type(lsh(object), u);
00100
00101 }
00102 protected:
00103 boost::mt11213b rng1;
00104 boost::mt19937 rng2;
00105 LSH lsh;
00106 Domain object;
00107 const Parameter param;
00108
00109 unsigned u;
00110 template <typename T>
00111 void same_type(T const &, T const&);
00112 };
00113
00115 template <typename LSH>
00116 struct DeltaLshConcept: public LshConcept<LSH>
00117 {
00118 typedef LshConcept<LSH> Super;
00119 BOOST_CONCEPT_USAGE(DeltaLshConcept)
00120 {
00121 float delta;
00122 Super::same_type(Super::lsh(Super::object, &delta), Super::u);
00123 }
00124 };
00125
00126 }
00127
00128 #endif
00129