Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string OptimalRates::getAskChain(Currency from, Currency to)
- {
- size_t i = m_indexes[from];
- size_t j = m_indexes[to];
- size_t m = m_hop_number - 1;
- std::ostringstream oss;
- PDEBUG("XXX: Find bid chain from " << i << " to " << j);
- if (m_rates[m][i][j].isEmpty()) {
- PDEBUG("XXX: There is no path");
- return std::string("No cross rate");
- }
- size_t child = i;
- PDEBUG("XXX: child " << child);
- while (m >= 0 && m < m_hop_number) {
- if (m_children[m][child][j].getValue() != child) {
- oss << m_currencies[child] << "-";
- }
- child = m_children[m--][child][j].getValue();
- PDEBUG("XXX: child " << child);
- }
- oss << m_currencies[child];
- return oss.str();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement