MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / median

Function median

src/program.cpp:880–891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878}
879
880static double median(const std::vector<double>& v)
881{
882 size_t mid = v.size() / 2;
883 if(v.size() % 2 == 0)
884 {
885 return (v[mid - 1] + v[mid]) / 2.0;
886 }
887 else
888 {
889 return v[mid];
890 }
891}
892
893static double percentile(const std::vector<double>& v, double percentile)
894{

Callers 1

perf_reportMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected