From: loizides Date: Wed, 17 Apr 2002 20:49:01 +0000 (+0000) Subject: Comments updated and merge problems solved. X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;ds=sidebyside;h=a472f00ac0d03ea0782ff36ee0fc43964ec058b6;p=u%2Fmrichter%2FAliRoot.git Comments updated and merge problems solved. --- diff --git a/HLT/src/AliL3MemHandler.cxx b/HLT/src/AliL3MemHandler.cxx index 34b13333ff5..6c8e901a664 100644 --- a/HLT/src/AliL3MemHandler.cxx +++ b/HLT/src/AliL3MemHandler.cxx @@ -1,5 +1,8 @@ +/* $Id$ // Author: Uli Frankenfeld -//*-- Copyright © Uli +// -- Copyright © Uli +// changes done by Constantin Loizides +*/ #include #include @@ -65,8 +68,6 @@ // newfile.Memory2CompBinary((UInt_t)NumberOfRowsInPatch,(AliL3DigitRowData*)data); // newfile.CloseBinaryOutput(); - - ClassImp(AliL3MemHandler) AliL3MemHandler::AliL3MemHandler() @@ -326,47 +327,47 @@ void AliL3MemHandler::SetRandomCluster(Int_t maxnumber) fDPt = new AliL3RandomDigitData *[fNRandom*9]; } -void AliL3MemHandler::QSort(AliL3RandomDigitData **a, Int_t first, Int_t last) -{ - - // Sort array of AliL3RandomDigitData pointers using a quicksort algorithm. - // Uses CompareDigits() to compare objects. - // Thanks to Root! - - static AliL3RandomDigitData *tmp; - static int i; // "static" to save stack space - int j; - - while (last - first > 1) { - i = first; - j = last; - for (;;) { - while (++i < last && CompareDigits(a[i], a[first]) < 0) - ; - while (--j > first && CompareDigits(a[j], a[first]) > 0) - ; - if (i >= j) - break; - - tmp = a[i]; - a[i] = a[j]; +void AliL3MemHandler::QSort(AliL3RandomDigitData **a, Int_t first, Int_t last){ + + // Sort array of AliL3RandomDigitData pointers using a quicksort algorithm. + // Uses CompareDigits() to compare objects. + // Thanks to Root! + + static AliL3RandomDigitData *tmp; + static int i; // "static" to save stack space + int j; + + while (last - first > 1) { + i = first; + j = last; + for (;;) { + while (++i < last && CompareDigits(a[i], a[first]) < 0) + ; + while (--j > first && CompareDigits(a[j], a[first]) > 0) + ; + if (i >= j) + break; + + tmp = a[i]; + a[i] = a[j]; + a[j] = tmp; + } + if (j == first) { + ++first; + continue; + } + tmp = a[first]; + a[first] = a[j]; a[j] = tmp; - } - if (j == first) { - ++first; - continue; - } - tmp = a[first]; - a[first] = a[j]; - a[j] = tmp; - if (j - first < last - (j + 1)) { - QSort(a, first, j); - first = j + 1; // QSort(j + 1, last); - } else { - QSort(a, j + 1, last); - last = j; // QSort(first, j); - } - } + + if (j - first < last - (j + 1)) { + QSort(a, first, j); + first = j + 1; // QSort(j + 1, last); + } else { + QSort(a, j + 1, last); + last = j; // QSort(first, j); + } + } } UInt_t AliL3MemHandler::GetRandomSize()