Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
aidge
aidge_core
Commits
a5eccecc
Commit
a5eccecc
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Added missing references to loop variables
parent
748aedd0
No related branches found
No related tags found
No related merge requests found
Pipeline
#30758
failed
1 year ago
Stage: static_analysis
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graph/GraphView.cpp
+16
-16
16 additions, 16 deletions
src/graph/GraphView.cpp
with
16 additions
and
16 deletions
src/graph/GraphView.cpp
+
16
−
16
View file @
a5eccecc
...
...
@@ -127,13 +127,13 @@ Aidge::IOIndex_t Aidge::GraphView::getNbFreeDataInputs() const {
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Aidge
::
Node
>
,
Aidge
::
IOIndex_t
>>
Aidge
::
GraphView
::
dataInputs
()
const
{
IOIndex_t
nbDataIn
=
0U
;
for
(
const
std
::
shared_ptr
<
Node
>
inputNode
:
mInputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
inputNode
:
mInputNodes
)
{
nbDataIn
+=
inputNode
->
nbDataInputs
();
}
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>>
res
=
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>>
(
nbDataIn
);
nbDataIn
=
0U
;
for
(
const
std
::
shared_ptr
<
Node
>
inputNode
:
mInputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
inputNode
:
mInputNodes
)
{
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>>
inputNodeinputs
=
inputNode
->
dataInputs
();
std
::
move
(
inputNodeinputs
.
begin
(),
inputNodeinputs
.
end
(),
...
...
@@ -149,13 +149,13 @@ Aidge::GraphView::dataInputs() const {
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Aidge
::
Node
>
,
Aidge
::
IOIndex_t
>>
Aidge
::
GraphView
::
inputs
()
const
{
std
::
size_t
nbIn
=
0U
;
for
(
const
std
::
shared_ptr
<
Node
>
inputNode
:
mInputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
inputNode
:
mInputNodes
)
{
nbIn
+=
inputNode
->
nbInputs
();
}
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>>
res
=
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>>
(
nbIn
);
nbIn
=
0U
;
for
(
const
std
::
shared_ptr
<
Node
>
inputNode
:
mInputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
inputNode
:
mInputNodes
)
{
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
IOIndex_t
>>
inputNodeinputs
=
inputNode
->
inputs
();
std
::
move
(
inputNodeinputs
.
begin
(),
inputNodeinputs
.
end
(),
...
...
@@ -242,13 +242,13 @@ void Aidge::GraphView::setDatatype(const DataType &datatype) {
void
Aidge
::
GraphView
::
updateOutputNodes
()
{
mOutputNodes
.
clear
();
for
(
const
std
::
shared_ptr
<
Node
>
go_it
:
mNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
go_it
:
mNodes
)
{
if
(
go_it
->
nbOutputs
()
!=
go_it
->
nbValidOutputs
())
{
// an output linked to nothing
mOutputNodes
.
insert
(
go_it
);
continue
;
}
for
(
const
std
::
shared_ptr
<
Node
>
ch_ptr
:
go_it
->
getChildren
())
{
for
(
const
std
::
shared_ptr
<
Node
>
&
ch_ptr
:
go_it
->
getChildren
())
{
if
(
mNodes
.
find
(
ch_ptr
)
==
mNodes
.
end
())
{
// Child not in the graph
mOutputNodes
.
insert
(
go_it
);
break
;
...
...
@@ -277,7 +277,7 @@ void Aidge::GraphView::updateOutputNodes(std::shared_ptr<Node> node) {
mOutputNodes
.
end
()))
{
// it's a match! Must check if the outputNode
// found is still an outputNode
bool
remove
=
(
pa_ptr
->
nbOutputs
()
==
pa_ptr
->
nbValidOutputs
());
for
(
const
std
::
shared_ptr
<
Node
>
ch_ptr
:
pa_ptr
->
getChildren
())
{
for
(
const
std
::
shared_ptr
<
Node
>
&
ch_ptr
:
pa_ptr
->
getChildren
())
{
if
(
mNodes
.
find
(
ch_ptr
)
==
mNodes
.
end
())
{
// Child not in the graph
remove
=
false
;
break
;
...
...
@@ -295,7 +295,7 @@ std::vector<
Aidge
::
GraphView
::
outputs
()
const
{
std
::
vector
<
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
Aidge
::
IOIndex_t
>>>
outputTensors
;
for
(
const
std
::
shared_ptr
<
Node
>
outputNode
:
mOutputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
outputNode
:
mOutputNodes
)
{
std
::
vector
<
std
::
vector
<
std
::
pair
<
std
::
shared_ptr
<
Node
>
,
Aidge
::
IOIndex_t
>>>
tmpOutputs
=
(
outputNode
->
outputs
());
outputTensors
.
insert
(
outputTensors
.
end
(),
tmpOutputs
.
begin
(),
...
...
@@ -404,7 +404,7 @@ void Aidge::GraphView::addChild(
std
::
set
<
std
::
shared_ptr
<
Aidge
::
Node
>>
Aidge
::
GraphView
::
getParents
()
const
{
// TODO: choose if we return a set or a vector
std
::
set
<
std
::
shared_ptr
<
Node
>>
parents
;
for
(
const
std
::
shared_ptr
<
Node
>
inputNode
:
mInputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
inputNode
:
mInputNodes
)
{
parents
.
insert
(
inputNode
->
getParents
().
begin
(),
inputNode
->
getParents
().
end
());
}
...
...
@@ -423,7 +423,7 @@ std::vector<std::shared_ptr<Aidge::Node>> Aidge::GraphView::getParents(const std
std
::
vector
<
std
::
vector
<
std
::
shared_ptr
<
Aidge
::
Node
>>>
Aidge
::
GraphView
::
getOrderedParents
()
const
{
std
::
vector
<
std
::
vector
<
std
::
shared_ptr
<
Node
>>>
parents
;
for
(
const
std
::
shared_ptr
<
Node
>
inputNode
:
mInputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
inputNode
:
mInputNodes
)
{
parents
.
push_back
(
inputNode
->
getParents
());
}
return
parents
;
...
...
@@ -431,7 +431,7 @@ Aidge::GraphView::getOrderedParents() const {
std
::
set
<
std
::
shared_ptr
<
Aidge
::
Node
>>
Aidge
::
GraphView
::
getChildren
()
const
{
std
::
set
<
std
::
shared_ptr
<
Node
>>
children
;
for
(
const
std
::
shared_ptr
<
Node
>
outputNode
:
mOutputNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
&
outputNode
:
mOutputNodes
)
{
children
.
insert
((
outputNode
->
getChildren
()).
begin
(),
(
outputNode
->
getChildren
()).
end
());
}
...
...
@@ -597,8 +597,8 @@ bool Aidge::GraphView::replaceWith(std::set<std::shared_ptr<Node>> newNodes) {
void
Aidge
::
GraphView
::
updateInputNodes
()
{
mInputNodes
.
clear
();
for
(
const
std
::
shared_ptr
<
Node
>
go_ptr
:
mNodes
)
{
for
(
const
std
::
shared_ptr
<
Node
>
pa_ptr
:
go_ptr
->
getParents
())
{
for
(
const
std
::
shared_ptr
<
Node
>
&
go_ptr
:
mNodes
)
{
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
...
...
@@ -613,7 +613,7 @@ void Aidge::GraphView::updateInputNodes(std::shared_ptr<Node> node) {
// add node_ptr to inputNode if it can
std
::
size_t
filledWithKnownInputs
=
0U
;
bool
wasAdded
=
mInputNodes
.
find
(
node
)
!=
mInputNodes
.
end
();
for
(
const
std
::
shared_ptr
<
Node
>
pa_ptr
:
node
->
getParents
())
{
for
(
const
std
::
shared_ptr
<
Node
>
&
pa_ptr
:
node
->
getParents
())
{
if
((
pa_ptr
==
nullptr
)
||
(
mNodes
.
find
(
pa_ptr
)
==
mNodes
.
end
()))
{
// Parent doesn't exist || Parent not in the graph
...
...
@@ -627,14 +627,14 @@ void Aidge::GraphView::updateInputNodes(std::shared_ptr<Node> node) {
mInputNodes
.
erase
(
node
);
}
// update other inputNodes
for
(
const
std
::
shared_ptr
<
Node
>
ch_ptr
:
for
(
const
std
::
shared_ptr
<
Node
>
&
ch_ptr
:
node
->
getChildren
())
{
// check if any child is in InputNodes too
if
(
mInputNodes
.
find
(
ch_ptr
)
!=
mInputNodes
.
end
())
{
// it's a match! Must check if the inputNode found
// is still an inputNode
// change here
bool
remove
=
true
;
for
(
const
std
::
shared_ptr
<
Node
>
pa_ptr
:
ch_ptr
->
getParents
())
{
for
(
const
std
::
shared_ptr
<
Node
>
&
pa_ptr
:
ch_ptr
->
getParents
())
{
if
(
pa_ptr
==
nullptr
||
mNodes
.
find
(
pa_ptr
)
==
mNodes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment