Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
group-connectivity-pub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Radek Hušek
group-connectivity-pub
Commits
5cc9577f
Commit
5cc9577f
authored
9 years ago
by
Radek Hušek
Committed by
Radek Hušek
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Refactor Tester::run()
parent
e7be7573
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
group-connectivity.h
+18
-20
18 additions, 20 deletions
group-connectivity.h
with
18 additions
and
20 deletions
group-connectivity.h
+
18
−
20
View file @
5cc9577f
...
@@ -140,32 +140,30 @@ struct Tester : public AbstractTester {
...
@@ -140,32 +140,30 @@ struct Tester : public AbstractTester {
#endif
#endif
virtual
bool
run
()
{
virtual
bool
run
()
{
# if SAVE_MEMORY
# define INC(a) a = true
# else
# define INC(a) a++
# endif
Mapping
forb
(
edges
);
Mapping
forb
(
edges
);
# if USE_NEXT_FORB
# if USE_NEXT_FORB
for
(
size_t
i
=
0
;
i
<
edges
;
i
++
)
for
(
size_t
i
=
0
;
i
<
edges
;
i
++
)
forb
.
assign
(
i
,
1
);
forb
.
assign
(
i
,
1
);
do
{
do
{
Mapping
copy
(
forb
);
Mapping
copy
(
forb
);
#if SAVE_MEMORY
INC
(
classes
[
pack
(
cannonize
(
copy
))]);
classes
[
pack
(
cannonize
(
copy
))]
=
true
;
#else
classes
[
pack
(
cannonize
(
copy
))]
++
;
#endif
}
while
(
nextForb
(
forb
));
}
while
(
nextForb
(
forb
));
#else // ! USE_NEXT_FORB
for
(
size_t
i
=
0
;
i
<
numForb
;
i
++
)
#if SAVE_MEMORY
classes
[
pack
(
cannonize
(
unpack
(
i
,
forb
)))]
=
true
;
# else
# else
classes
[
pack
(
cannonize
(
unpack
(
i
,
forb
)))]
++
;
for
(
size_t
i
=
0
;
i
<
numForb
;
i
++
)
#endif
INC
(
classes
[
pack
(
cannonize
(
unpack
(
i
,
forb
)))]);
# endif
# endif
for
(
const
auto
&
c
:
classes
)
if
(
!
c
)
return
(
isConnected
=
false
);
for
(
const
auto
&
c
:
classes
)
if
(
!
c
)
return
(
isConnected
=
false
);
return
(
isConnected
=
true
);
return
(
isConnected
=
true
);
# undef INC
}
}
virtual
~
Tester
()
{}
virtual
~
Tester
()
{}
...
...
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