- nth_element(temp.begin(),temp.begin()+(temp.size())/2,temp.end());
- value=temp[temp.size()/2];
- nth_element(temp.begin(),temp.begin()+ (temp.size()/2+1),temp.end());
- value+=temp[temp.size()/2+1];
- value/=2;
+ nth_element(temp.begin(), temp.begin() + temporal_dimension/2 - 1, temp.end());
+ value = temp[temporal_dimension/2 - 1];
+ nth_element(temp.begin(), temp.begin() + temporal_dimension/2, temp.end());
+ value += temp[temporal_dimension/2];
+ value /= 2;