加速组合指标计算(continue)

This commit is contained in:
fasiondog 2023-10-26 02:18:21 +08:00
parent 53c6dc04fd
commit a498d4e725
2 changed files with 29 additions and 0 deletions

View File

@ -1476,4 +1476,31 @@ bool IndicatorImp::alike(const IndicatorImp &other) const {
return true;
}
std::list<IndicatorImpPtr> IndicatorImp::getAllSubNodes() const {
std::list<IndicatorImpPtr> result;
if (m_left) {
result.push_back(m_left);
auto sub_nodes = m_left->getAllSubNodes();
result.splice(result.end(), sub_nodes);
}
if (m_right) {
result.push_back(m_right);
auto sub_nodes = m_right->getAllSubNodes();
result.splice(result.end(), sub_nodes);
}
if (m_three) {
result.push_back(m_three);
auto sub_nodes = m_three->getAllSubNodes();
result.splice(result.end(), sub_nodes);
}
for (auto iter = m_ind_params.begin(); iter != m_ind_params.end(); ++iter) {
if (iter->second) {
result.push_back(iter->second);
auto sub_nodes = iter->second->getAllSubNodes();
result.splice(result.end(), sub_nodes);
}
}
return result;
}
} /* namespace hku */

View File

@ -218,6 +218,8 @@ private:
void execute_if();
void execute_corr();
std::list<IndicatorImpPtr> getAllSubNodes() const;
protected:
static size_t _get_step_start(size_t pos, size_t step, size_t discard);