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
cf31a83f
Commit
cf31a83f
authored
9 years ago
by
Radek Hušek
Committed by
Radek Hušek
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
API changes for double-subdivision optimization
parent
94184620
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
compileTimeOptions.h
+3
-0
3 additions, 0 deletions
compileTimeOptions.h
group-connectivity.h
+3
-0
3 additions, 0 deletions
group-connectivity.h
groupConnectivity.pyx
+7
-3
7 additions, 3 deletions
groupConnectivity.pyx
with
13 additions
and
3 deletions
compileTimeOptions.h
+
3
−
0
View file @
cf31a83f
...
@@ -20,3 +20,6 @@ REQUIRES(EXPLICIT_NORMAL_EDGES, USE_NEXT_FORB)
...
@@ -20,3 +20,6 @@ REQUIRES(EXPLICIT_NORMAL_EDGES, USE_NEXT_FORB)
BOOL_OPTION
(
USE_TWO_CUTS
,
1
)
BOOL_OPTION
(
USE_TWO_CUTS
,
1
)
REQUIRES
(
USE_TWO_CUTS
,
USE_NEXT_FORB
&&
EXPLICIT_NORMAL_EDGES
)
REQUIRES
(
USE_TWO_CUTS
,
USE_NEXT_FORB
&&
EXPLICIT_NORMAL_EDGES
)
BOOL_OPTION
(
USE_DOUBLE_SUBDIVISIONS
,
0
)
REQUIRES
(
USE_DOUBLE_SUBDIVISIONS
,
USE_NEXT_FORB
&&
EXPLICIT_NORMAL_EDGES
)
This diff is collapsed.
Click to expand it.
group-connectivity.h
+
3
−
0
View file @
cf31a83f
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
typedef
int
EdgeId
;
typedef
int
EdgeId
;
typedef
int
DirectedEdgeId
;
typedef
int
DirectedEdgeId
;
typedef
std
::
pair
<
DirectedEdgeId
,
DirectedEdgeId
>
TwoCut
;
typedef
std
::
pair
<
DirectedEdgeId
,
DirectedEdgeId
>
TwoCut
;
typedef
std
::
vector
<
EdgeId
>
DoubleSubdivision
;
struct
AbstractTester
{
struct
AbstractTester
{
bool
isConnected
;
bool
isConnected
;
...
@@ -25,6 +26,7 @@ struct AbstractTester {
...
@@ -25,6 +26,7 @@ struct AbstractTester {
int
edges
,
int
edges
,
std
::
vector
<
EdgeId
>
spanningTree
,
std
::
vector
<
EdgeId
>
spanningTree
,
std
::
vector
<
TwoCut
>
twoCuts
,
std
::
vector
<
TwoCut
>
twoCuts
,
std
::
vector
<
DoubleSubdivision
>
dSub
,
std
::
vector
<
std
::
vector
<
DirectedEdgeId
>
>
elementaryCycles
std
::
vector
<
std
::
vector
<
DirectedEdgeId
>
>
elementaryCycles
)
=
0
;
)
=
0
;
virtual
std
::
vector
<
size_t
>
getClasses
()
=
0
;
virtual
std
::
vector
<
size_t
>
getClasses
()
=
0
;
...
@@ -60,6 +62,7 @@ struct Tester : public AbstractTester {
...
@@ -60,6 +62,7 @@ struct Tester : public AbstractTester {
int
edges_
,
int
edges_
,
std
::
vector
<
EdgeId
>
spanningTree
,
std
::
vector
<
EdgeId
>
spanningTree
,
std
::
vector
<
TwoCut
>
twoCuts_
,
std
::
vector
<
TwoCut
>
twoCuts_
,
std
::
vector
<
DoubleSubdivision
>
dSub
,
std
::
vector
<
std
::
vector
<
DirectedEdgeId
>
>
elementaryCycles
std
::
vector
<
std
::
vector
<
DirectedEdgeId
>
>
elementaryCycles
)
{
)
{
edges
=
edges_
;
edges
=
edges_
;
...
...
This diff is collapsed.
Click to expand it.
groupConnectivity.pyx
+
7
−
3
View file @
cf31a83f
...
@@ -16,9 +16,10 @@ cdef extern from "group-connectivity.h":
...
@@ -16,9 +16,10 @@ cdef extern from "group-connectivity.h":
ctypedef
int
EdgeId
ctypedef
int
EdgeId
ctypedef
int
DirectedEdgeId
ctypedef
int
DirectedEdgeId
ctypedef
pair
[
DirectedEdgeId
,
DirectedEdgeId
]
TwoCut
ctypedef
pair
[
DirectedEdgeId
,
DirectedEdgeId
]
TwoCut
ctypedef
vector
[
EdgeId
]
DoubleSubdivision
cdef
cppclass
AbstractTester
:
cdef
cppclass
AbstractTester
:
void
init
(
int
,
vector
[
EdgeId
],
vector
[
TwoCut
],
vector
[
vector
[
DirectedEdgeId
]])
void
init
(
int
,
vector
[
EdgeId
],
vector
[
TwoCut
],
vector
[
DoubleSubdivision
],
vector
[
vector
[
DirectedEdgeId
]])
vector
[
size_t
]
getClasses
()
vector
[
size_t
]
getClasses
()
bool
run
()
bool
run
()
...
@@ -38,7 +39,8 @@ def pathToEdges(G, path):
...
@@ -38,7 +39,8 @@ def pathToEdges(G, path):
def
testGroupConnectivity
(
G
,
group
=
"
Z4
"
,
getClasses
=
False
,
def
testGroupConnectivity
(
G
,
group
=
"
Z4
"
,
getClasses
=
False
,
useTwoCuts
=
True
,
debug
=
False
):
useTwoCuts
=
True
,
useDoubleSubdivisions
=
False
,
debug
=
False
):
cdef
AbstractTester
*
tester
=
NULL
cdef
AbstractTester
*
tester
=
NULL
if
group
==
"
Z4
"
:
if
group
==
"
Z4
"
:
tester
=
new
Tester
[
Z4
[
int
]]()
tester
=
new
Tester
[
Z4
[
int
]]()
...
@@ -65,6 +67,8 @@ def testGroupConnectivity(G, group = "Z4", getClasses = False,
...
@@ -65,6 +67,8 @@ def testGroupConnectivity(G, group = "Z4", getClasses = False,
spanningTreeEdges
=
[
l
for
(
_
,
_
,
l
)
in
spanningTree
.
edge_iterator
()
]
spanningTreeEdges
=
[
l
for
(
_
,
_
,
l
)
in
spanningTree
.
edge_iterator
()
]
twoCuts
=
[]
twoCuts
=
[]
if
useTwoCuts
:
if
useTwoCuts
:
availableEdges
=
set
(
spanningTreeEdges
)
availableEdges
=
set
(
spanningTreeEdges
)
...
@@ -95,7 +99,7 @@ def testGroupConnectivity(G, group = "Z4", getClasses = False,
...
@@ -95,7 +99,7 @@ def testGroupConnectivity(G, group = "Z4", getClasses = False,
print
"
Elementary cycles:
"
,
elemCycles
print
"
Elementary cycles:
"
,
elemCycles
print
"
Two cuts:
"
,
twoCuts
print
"
Two cuts:
"
,
twoCuts
tester
.
init
(
G
.
num_edges
(),
spanningTreeEdges
,
twoCuts
,
elemCycles
)
tester
.
init
(
G
.
num_edges
(),
spanningTreeEdges
,
twoCuts
,
[],
elemCycles
)
ret
=
tester
.
run
()
ret
=
tester
.
run
()
if
getClasses
:
if
getClasses
:
...
...
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