Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Sort.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_PatSort_h
00002 #define Impala_Core_Array_PatSort_h
00003 
00004 #include "Core/Array/Pattern/PatSet.h"
00005 #include "Util/QuickSort.h"
00006 
00007 /*****************************
00008  * quicksort algorithm copied from http://www.uow.edu.au/~nabg/ABC/quicks.html
00009  * cose is edited to conform to coding standards
00010  *****************************/
00011 
00012 namespace Impala
00013 {
00014 namespace Core
00015 {
00016 namespace Array
00017 {
00018 
00019 template<class ArrayT>
00020 void
00021 Sort(ArrayT*& dst, const ArrayT* src)
00022 {
00023     if (dst == 0)
00024         dst = ArrayClone<ArrayT>(src);
00025     Pattern::PatSet(dst, src);
00026     int length = dst->W() * dst->H();
00027     Util::QuickSort(dst->CPB(), 0, length-1);
00028 }
00029 
00030 } // namespace Array
00031 } // namespace Core
00032 } // namespace Impala
00033 
00034 #endif 

Generated on Fri Mar 19 09:30:54 2010 for ImpalaSrc by  doxygen 1.5.1