|
|
@ -599,6 +599,7 @@ public: |
|
|
|
T median() const |
|
|
|
T median() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
int size = vSorted.size(); |
|
|
|
int size = vSorted.size(); |
|
|
|
|
|
|
|
assert(size>0); |
|
|
|
if(size & 1) // Odd number of elements
|
|
|
|
if(size & 1) // Odd number of elements
|
|
|
|
{ |
|
|
|
{ |
|
|
|
return vSorted[size/2]; |
|
|
|
return vSorted[size/2]; |
|
|
|