MCPcopy Create free account
hub / github.com/Boyle-Lab/Blacklist / quantile

Function quantile

blacklist.cpp:188–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188double quantile(std::vector<double> v, double q) {
189 sort(v.begin(), v.end());
190 double h = ((v.size() - 1) * q) + 1;
191 if(h >= v.size()) {
192 h = v.size() - 1;
193 }
194 return v[floor(h)] + ((h - floor(h)) * (v[floor(h) + 1] - v[floor(h)]));
195}
196
197int quantile(std::vector<int> v, double q) {
198 sort(v.begin(), v.end());

Callers 2

getAbnormalRegionsFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected