MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / get_sd

Function get_sd

src/myFunc.cpp:156–162  ·  view source on GitHub ↗

Calculate sd across individuals around given mean ---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

154// Calculate sd across individuals around given mean
155// ---------------------------------------------------------------------------
156float get_sd (const std::vector<float>& data, float mean) {
157 double sum = 0;
158 int arrayLength = data.size();
159 for (int i=0; i< arrayLength; i++)
160 sum+=(data[i]-mean)*(data[i]-mean);
161 return (float)sqrt(sum/arrayLength);
162}
163
164// Calculate argmin for a vector for the first smallest value in a range
165// ---------------------------------------------------------------------------

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected