This commit is contained in:
codeboss 2024-10-05 10:19:24 +08:00
parent 436e88a708
commit 0ba87a2d70
2 changed files with 7 additions and 7 deletions

View File

@ -153,7 +153,7 @@ std::shared_ptr<DAGLayerHelper> DAGGraph::spawns_peak(QList<std::shared_ptr<DAGL
return std::shared_ptr<DAGLayerHelper>(); return std::shared_ptr<DAGLayerHelper>();
} }
void DAGGraph::graph_recovery(QList<std::shared_ptr<DAGLayerHelper>> sort_seqs) { void DAGGraph::graph_recovery(const QList<std::shared_ptr<DAGLayerHelper>> &sort_seqs) {
for (auto it : sort_seqs) { for (auto it : sort_seqs) {
it->inputCount() = 0; it->inputCount() = 0;
} }
@ -170,7 +170,7 @@ void DAGGraph::graph_recovery(QList<std::shared_ptr<DAGLayerHelper>> sort_seqs)
} }
} }
int DAGGraph::node_layering(std::shared_ptr<DAGLayerHelper> inst, int layer_current) { int DAGGraph::node_layering(const std::shared_ptr<DAGLayerHelper> &inst, int layer_current) {
auto max_remains = layer_current; auto max_remains = layer_current;
if (!layer_current || inst->layerValue() < layer_current) { if (!layer_current || inst->layerValue() < layer_current) {
inst->setLayerValue(layer_current); inst->setLayerValue(layer_current);
@ -228,7 +228,7 @@ QList<std::shared_ptr<DAGOrderHelper>> DAGGraph::tidy_graph_nodes() {
} }
#include <QDebug> #include <QDebug>
void DAGGraph::graph_layer_nodes_sort(int layer_index, QList<std::shared_ptr<DAGOrderHelper>> nodes) { void DAGGraph::graph_layer_nodes_sort(int layer_index, const QList<std::shared_ptr<DAGOrderHelper>> &nodes) {
QList<std::shared_ptr<DAGOrderHelper>> nodes_within_current_layer; QList<std::shared_ptr<DAGOrderHelper>> nodes_within_current_layer;
for (auto n : nodes) for (auto n : nodes)
if (n->layerNumber() == layer_index) { if (n->layerNumber() == layer_index) {

View File

@ -82,11 +82,11 @@ namespace dags {
private: private:
std::shared_ptr<DAGLayerHelper> spawns_peak(QList<std::shared_ptr<DAGLayerHelper>>& ref_set); std::shared_ptr<DAGLayerHelper> spawns_peak(QList<std::shared_ptr<DAGLayerHelper>>& ref_set);
void graph_recovery(QList<std::shared_ptr<DAGLayerHelper>> sort_seqs); void graph_recovery(const QList<std::shared_ptr<DAGLayerHelper>> &sort_seqs);
int node_layering(std::shared_ptr<DAGLayerHelper> inst, int layer_current); int node_layering(const std::shared_ptr<DAGLayerHelper> &inst, int layer_current);
int node_layering_adj(std::shared_ptr<DAGLayerHelper> inst); int node_layering_adj(std::shared_ptr<DAGLayerHelper> inst);
QList<std::shared_ptr<DAGOrderHelper>> tidy_graph_nodes(); QList<std::shared_ptr<DAGOrderHelper>> tidy_graph_nodes();
void graph_layer_nodes_sort(int layer_index, QList<std::shared_ptr<DAGOrderHelper>> nodes); void graph_layer_nodes_sort(int layer_index, const QList<std::shared_ptr<DAGOrderHelper>> &nodes);
// void above_node_sort(int curr_layer, )
}; };
} }