MCPcopy Create free account
hub / github.com/OriginQ/QPanda-2 / compare_map_result

Function compare_map_result

test/Core/QVM.test.cpp:219–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219static bool compare_map_result(map<string, size_t> result1, map<string, size_t> result2 , int shots)
220{
221 for (auto val : result1)
222 {
223 auto iter = result2.find(val.first);
224
225 if (iter == result2.end())
226 return false;
227
228 if (1e-2 < std::fabs((double)(((int)val.second - (int)iter->second) / shots)))
229 return false;
230 }
231
232 return true;
233}
234
235static bool compare_probs_result(const prob_vec& result1,const prob_vec& result2)
236{

Callers 1

TESTFunction · 0.85

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected