Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
44
Issues
44
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
8477c7ef
Commit
8477c7ef
authored
Sep 17, 2019
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blockmodel: small tweaks to egroups and forced inlining
parent
a7496657
Pipeline
#530
failed with stage
in 388 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
src/graph/inference/blockmodel/graph_blockmodel_elist.hh
src/graph/inference/blockmodel/graph_blockmodel_elist.hh
+15
-14
src/graph/inference/blockmodel/graph_blockmodel_entries.hh
src/graph/inference/blockmodel/graph_blockmodel_entries.hh
+5
-2
No files found.
src/graph/inference/blockmodel/graph_blockmodel_elist.hh
View file @
8477c7ef
...
...
@@ -136,13 +136,11 @@ public:
assert
(
e
!=
Edge
());
size_t
r
=
b
[
get_source
(
e
,
g
)];
auto
&
r_elist
=
_egroups
[
r
];
insert_edge
(
std
::
make_tuple
(
e
,
true
),
r_elist
,
weight
,
_epos
[
e
].
first
);
insert_edge
(
std
::
make_tuple
(
e
,
true
),
r_elist
,
weight
,
_epos
[
e
].
first
);
size_t
s
=
b
[
get_target
(
e
,
g
)];
auto
&
s_elist
=
_egroups
[
s
];
insert_edge
(
std
::
make_tuple
(
e
,
false
),
s_elist
,
weight
,
_epos
[
e
].
second
);
insert_edge
(
std
::
make_tuple
(
e
,
false
),
s_elist
,
weight
,
_epos
[
e
].
second
);
}
template
<
class
Edge
,
class
EV
>
...
...
@@ -183,15 +181,17 @@ public:
{
if
(
pos
>=
elist
.
size
()
||
elist
[
pos
]
!=
e
)
return
;
if
(
get
<
1
>
(
elist
.
back
()))
_epos
[
get
<
0
>
(
elist
.
back
())].
first
=
pos
;
auto
&
back
=
elist
.
back
();
if
(
get
<
1
>
(
back
))
_epos
[
get
<
0
>
(
back
)].
first
=
pos
;
else
_epos
[
get
<
0
>
(
elist
.
back
())].
second
=
pos
;
if
(
get
<
1
>
(
elist
[
pos
]))
_epos
[
get
<
0
>
(
elist
[
pos
])].
first
=
numeric_limits
<
size_t
>::
max
();
_epos
[
get
<
0
>
(
back
)].
second
=
pos
;
auto
&
epos
=
elist
[
pos
];
if
(
get
<
1
>
(
epos
))
_epos
[
get
<
0
>
(
epos
)].
first
=
numeric_limits
<
size_t
>::
max
();
else
_epos
[
get
<
0
>
(
e
list
[
pos
]
)].
second
=
numeric_limits
<
size_t
>::
max
();
e
list
[
pos
]
=
elist
.
back
()
;
_epos
[
get
<
0
>
(
e
pos
)].
second
=
numeric_limits
<
size_t
>::
max
();
e
pos
=
back
;
elist
.
pop_back
();
if
(
elist
.
empty
())
...
...
@@ -203,10 +203,11 @@ public:
{
if
(
pos
>=
elist
.
size
()
||
elist
[
pos
]
!=
e
)
return
;
if
(
get
<
1
>
(
elist
[
pos
]))
_epos
[
get
<
0
>
(
elist
[
pos
])].
first
=
numeric_limits
<
size_t
>::
max
();
auto
&
epos
=
elist
[
pos
];
if
(
get
<
1
>
(
epos
))
_epos
[
get
<
0
>
(
epos
)].
first
=
numeric_limits
<
size_t
>::
max
();
else
_epos
[
get
<
0
>
(
e
list
[
pos
]
)].
second
=
numeric_limits
<
size_t
>::
max
();
_epos
[
get
<
0
>
(
e
pos
)].
second
=
numeric_limits
<
size_t
>::
max
();
elist
.
remove
(
pos
);
if
(
elist
.
empty
())
...
...
src/graph/inference/blockmodel/graph_blockmodel_entries.hh
View file @
8477c7ef
...
...
@@ -219,7 +219,7 @@ public:
}
template
<
bool
Add
,
class
...
DVals
>
__attribute__
((
flatten
))
inline
__attribute__
((
always_inline
))
__attribute__
((
flatten
))
void
insert_delta
(
size_t
s
,
size_t
t
,
int
d
,
DVals
&&
...
delta
)
{
auto
&
f
=
get_field
(
s
,
t
);
...
...
@@ -307,7 +307,7 @@ struct is_loop_nop
template
<
bool
Remove
,
bool
Add
,
class
Vertex
,
class
Graph
,
class
Vprop
,
class
Eprop
,
class
MEntries
,
class
Efilt
,
class
IL
,
class
...
Eprops
>
__attribute__
((
flatten
))
inline
__attribute__
((
always_inline
))
__attribute__
((
flatten
))
void
modify_entries
(
Vertex
v
,
Vertex
r
,
Vertex
nr
,
Vprop
&
_b
,
Graph
&
g
,
Eprop
&
eweights
,
MEntries
&
m_entries
,
Efilt
&&
efilt
,
IL
&&
is_loop
,
Eprops
&
...
eprops
)
...
...
@@ -420,6 +420,7 @@ void modify_entries(Vertex v, Vertex r, Vertex nr, Vprop& _b, Graph& g,
// after the move
template
<
class
Graph
,
class
Vertex
,
class
VProp
,
class
Eprop
,
class
MEntries
,
class
EFilt
,
class
IL
,
class
...
Eprops
>
inline
__attribute__
((
always_inline
))
void
move_entries
(
Vertex
v
,
size_t
r
,
size_t
nr
,
VProp
&
_b
,
Graph
&
g
,
Eprop
&
eweights
,
size_t
B
,
MEntries
&
m_entries
,
EFilt
&&
efilt
,
IL
&&
is_loop
,
Eprops
&
...
eprops
)
...
...
@@ -451,6 +452,7 @@ void move_entries(Vertex v, size_t r, size_t nr, VProp& _b, Graph& g,
// operation on a set of entries
template
<
class
MEntries
,
class
EMat
,
class
OP
>
inline
__attribute__
((
always_inline
))
void
entries_op
(
MEntries
&
m_entries
,
EMat
&
emat
,
OP
&&
op
)
{
const
auto
&
entries
=
m_entries
.
get_entries
();
...
...
@@ -468,6 +470,7 @@ void entries_op(MEntries& m_entries, EMat& emat, OP&& op)
// operation on a set of entries, with edge covariates
template
<
class
MEntries
,
class
EMat
,
class
OP
>
inline
__attribute__
((
always_inline
))
void
wentries_op
(
MEntries
&
m_entries
,
EMat
&
emat
,
OP
&&
op
)
{
const
auto
&
entries
=
m_entries
.
get_entries
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment