Skip to content
Snippets Groups Projects
Commit 92738e81 authored by Maxence Naud's avatar Maxence Naud
Browse files

Remove deprecated function 'updateInputsOutputsNodes_DEPRECATED()'

parent 928ea252
No related branches found
No related tags found
No related merge requests found
......@@ -451,14 +451,6 @@ public:
*/
IOIndex_t getNbFreeDataInputs() const;
protected:
/**
* @brief Update inputs/outputs of the GraphView, with no particular order.
* This function DOES NOT preserve inputs/outputs order and should NOT BE USED.
* It is here only to leave time to adapt the replace() function.
*/
void updateInputsOutputsNodes_DEPRECATED();
private:
///////////////////////////////////////////////////////
// TENSOR MANAGEMENT
......
......@@ -1040,40 +1040,6 @@ void Aidge::GraphView::updateInputsOutputsDelete(std::shared_ptr<Node> deletedNo
}
}
void Aidge::GraphView::updateInputsOutputsNodes_DEPRECATED() {
mInputNodes.clear();
for (const std::shared_ptr<Node>& go_ptr : mNodes) {
IOIndex_t inputIdx = 0;
for (const std::shared_ptr<Node>& pa_ptr : go_ptr->getParents()) {
if ((pa_ptr == nullptr) ||
(mNodes.find(pa_ptr) ==
mNodes.end())) { // Parent doesn't exist || Parent not in the graph
mInputNodes.push_back(std::make_pair(go_ptr, inputIdx));
}
++inputIdx;
}
}
mOutputNodes.clear();
for (const std::shared_ptr<Node>& go_ptr : mNodes) {
IOIndex_t outputIdx = 0;
for (auto orderedChilds : go_ptr->getOrderedChildren()) {
bool noInsideConnection = true;
for (auto ch_ptr : orderedChilds) {
if (mNodes.find(ch_ptr) != mNodes.end()) {
noInsideConnection = false;
break;
}
}
if (noInsideConnection) {
mOutputNodes.push_back(std::make_pair(go_ptr, outputIdx));
}
++outputIdx;
}
}
}
std::shared_ptr<Aidge::GraphView> Aidge::GraphView::cloneCallback(NodePtr(*cloneNode)(NodePtr)) const {
std::shared_ptr<GraphView> newGraph = std::make_shared<GraphView>(mName);
......
......@@ -28,19 +28,6 @@
using namespace Aidge;
class GraphView_Test : public GraphView {
public:
GraphView_Test(std::string name="")
: GraphView(name)
{
// ctor
}
void updateInputsOutputsNodes_DEPRECATED_Test() {
GraphView::updateInputsOutputsNodes_DEPRECATED();
}
};
TEST_CASE("genRandomGraph", "[GraphView][randomGen]") {
const size_t nbTests = 100;
size_t nbUnicity = 0;
......@@ -50,7 +37,7 @@ TEST_CASE("genRandomGraph", "[GraphView][randomGen]") {
const std::mt19937::result_type seed(rd());
RandomGraph randGraph;
const auto g1 = std::make_shared<GraphView_Test>("g1");
const auto g1 = std::make_shared<GraphView>("g1");
const bool unicity1 = g1->add(randGraph.gen(seed, 10));
const auto g2 = std::make_shared<GraphView>("g2");
const bool unicity2 = g2->add(randGraph.gen(seed, 10));
......@@ -68,8 +55,6 @@ TEST_CASE("genRandomGraph", "[GraphView][randomGen]") {
REQUIRE(nodePtrTo(g1->outputNodes(), nodePtrToName) == nodePtrTo(g2->outputNodes(), nodePtrToName));
++nbUnicity;
// Test deprecated function
g1->updateInputsOutputsNodes_DEPRECATED_Test();
// Check that inputs/outputs are the same regardless of the order
auto orderedInputs1 = nodePtrTo(g1->getOrderedInputs(), nodePtrToName);
auto orderedInputs2 = nodePtrTo(g2->getOrderedInputs(), nodePtrToName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment