MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / getIndex

Method getIndex

src/openpose/core/array.cpp:604–622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602
603 template<typename T>
604 int Array<T>::getIndex(const std::vector<int>& indexes) const
605 {
606 try
607 {
608 auto index = 0;
609 auto accumulated = 1;
610 for (auto i = (int)indexes.size() - 1 ; i >= 0 ; i--)
611 {
612 index += accumulated * indexes[i];
613 accumulated *= mSize[i];
614 }
615 return index;
616 }
617 catch (const std::exception& e)
618 {
619 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
620 return 0;
621 }
622 }
623
624 template<typename T>
625 int Array<T>::getIndexAndCheck(const std::vector<int>& indexes) const

Callers

nothing calls this directly

Calls 3

whatMethod · 0.80
errorFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected