Sha256: e0e544e9c8b5c1fde742c41b47277873c4acaf89cdb8a32c649a5b6d1368b04a
Contents?: true
Size: 1.51 KB
Versions: 13
Compression:
Stored size: 1.51 KB
Contents
// Copyright (C) 2003 Davis E. King (davis@dlib.net) // License: Boost Software License See LICENSE.txt for the full license. #ifndef DLIB_SEQUENCE_SORt_2_ #define DLIB_SEQUENCE_SORt_2_ #include "sequence_sort_abstract.h" #include "../algs.h" #include "../sort.h" namespace dlib { template < typename seq_base > class sequence_sort_2 : public seq_base { typedef typename seq_base::type T; public: /*! this is a version of the QuickSort algorithm this uses the dlib::qsort_array function !*/ void sort ( ); }; template < typename seq_base > inline void swap ( sequence_sort_2<seq_base>& a, sequence_sort_2<seq_base>& b ) { a.swap(b); } // ---------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------- // member function definitions // ---------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------- template < typename seq_base > void sequence_sort_2<seq_base>:: sort ( ) { if (this->size() > 1) { dlib::qsort_array(*this,0,this->size()-1); } } // ---------------------------------------------------------------------------------------- } #endif // DLIB_SEQUENCE_SORt_2_
Version data entries
13 entries across 13 versions & 1 rubygems