#ifndef APOLLOTA_TUPLE_H_ #define APOLLOTA_TUPLE_H_ #include #include namespace apollota { template class Tuple { public: struct HashFunctor { std::size_t operator()(const Tuple& t) const { return t.hash_value(); } }; Tuple() { for(unsigned int i=0;i& values) { for(unsigned int i=0;i& shorter, const std::size_t tail) { for(unsigned int i=0;i<(N-1);i++) { v_[i]=shorter.get(i); } v_[N-1]=tail; sort(); } Tuple(const std::size_t a, const std::size_t b) { if(0 exclude(unsigned int i) const { std::vector values; values.reserve(N-1); for(unsigned int j=0;j(values); } int number_of_subtuple(const Tuple& subtuple) const { for(unsigned int i=0;i(i); } } return -1; } bool has_repetetions() const { for(unsigned int i=0;i+1 get_min_max() const { std::pair result(v_[0], v_[0]); for(unsigned int i=1;i> 6); } h += (h << 3); h ^= (h >> 11); h += (h << 15); return h; } bool operator==(const Tuple& t) const { for(unsigned int i=0;it.get(i)) { return false; } } return false; } private: void sort() { std::sort(v_, v_+N); } std::size_t v_[N]; }; typedef Tuple<2> Pair; typedef Tuple<3> Triple; typedef Tuple<4> Quadruple; } #endif /* APOLLOTA_TUPLE_H_ */