Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fishnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenz Gruber
fishnet
Commits
0c55276f
Commit
0c55276f
authored
4 months ago
by
Lorenz Gruber
Browse files
Options
Downloads
Patches
Plain Diff
fixing duplicate iteration of view
parent
2f9ad223
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#67039
passed
4 months ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/sda-workflow/src/3_components/ConnectedComponentsTask.h
+13
-5
13 additions, 5 deletions
app/sda-workflow/src/3_components/ConnectedComponentsTask.h
with
13 additions
and
5 deletions
app/sda-workflow/src/3_components/ConnectedComponentsTask.h
+
13
−
5
View file @
0c55276f
...
...
@@ -30,7 +30,7 @@ public:
this
->
desc
[
"cfg-file"
]
=
this
->
cfgFile
.
string
();
}
std
::
unordered_map
<
uint64_t
,
std
::
vector
<
std
::
string
>>
queryPathsForComponent
(
fishnet
::
util
::
forward_range_of
<
ComponentReference
>
auto
&
componentIds
,
const
MemgraphConnection
&
memgraphConnection
){
std
::
unordered_map
<
uint64_t
,
std
::
vector
<
std
::
string
>>
queryPathsForComponent
(
fishnet
::
util
::
forward_range_of
<
ComponentReference
>
auto
&
&
componentIds
,
const
MemgraphConnection
&
memgraphConnection
){
std
::
unordered_map
<
uint64_t
,
std
::
vector
<
std
::
string
>>
componentToFilesMap
;
std
::
vector
<
mg
::
Value
>
componentValues
;
for
(
auto
componentRef
:
componentIds
)
...
...
@@ -84,10 +84,18 @@ public:
}
auto
components
=
fishnet
::
graph
::
BFS
::
connectedComponents
(
graph
).
get
();
this
->
desc
[
"Connected Components"
]
=
components
.
size
();
auto
componentIds
=
components
|
std
::
views
::
transform
([
&
memgraphClient
](
const
auto
&
nodesOfComponent
){
return
memgraphClient
.
createComponent
(
nodesOfComponent
);})
|
std
::
views
::
filter
([](
const
std
::
optional
<
ComponentReference
>
&
opt
){
return
opt
.
has_value
();})
|
std
::
views
::
transform
([](
const
std
::
optional
<
ComponentReference
>
&
opt
){
return
opt
.
value
();});
std
::
vector
<
ComponentReference
>
componentIds
;
for
(
const
auto
&
nodesOfComponent
:
components
)
{
auto
optComponent
=
memgraphClient
.
createComponent
(
nodesOfComponent
);
if
(
optComponent
.
has_value
())
{
componentIds
.
push_back
(
optComponent
.
value
());
}
}
// auto componentIds = components
// | std::views::transform([&memgraphClient](const auto & nodesOfComponent){return memgraphClient.createComponent(nodesOfComponent);})
// | std::views::filter([](const std::optional<ComponentReference> & opt){return opt.has_value();})
// | std::views::transform([](const std::optional<ComponentReference> & opt){return opt.value();});
// | std::ranges::to<...> not supported yet
std
::
unordered_map
<
uint64_t
,
std
::
vector
<
std
::
string
>>
componentToFilesMap
=
queryPathsForComponent
(
componentIds
,
memgraphClient
.
getMemgraphConnection
());
std
::
unordered_map
<
std
::
string
,
std
::
vector
<
uint64_t
>>
fileToComponentsMap
;
std
::
vector
<
ComponentFileJob
>
contractionJobs
;
...
...
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