Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Malte R
graph-tool
Commits
064a9add
Commit
064a9add
authored
Sep 22, 2017
by
Tiago Peixoto
Browse files
blockmodel_overlap: Use boost::container::small_vector for group mixtures
parent
3ebca6c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/graph/inference/overlap/graph_blockmodel_overlap_partition.hh
View file @
064a9add
...
...
@@ -18,12 +18,51 @@
#ifndef GRAPH_BLOCKMODEL_OVERLAP_PARTITION_HH
#define GRAPH_BLOCKMODEL_OVERLAP_PARTITION_HH
#include
<functional>
#include
"graph_blockmodel_overlap_util.hh"
#include
"boost/container/small_vector.hpp"
namespace
graph_tool
namespace
std
{
template
<
class
Value
,
size_t
N
>
struct
hash
<
boost
::
container
::
small_vector
<
Value
,
N
>>
{
size_t
operator
()(
const
boost
::
container
::
small_vector
<
Value
,
N
>&
v
)
const
{
std
::
size_t
seed
=
0
;
for
(
auto
&
x
:
v
)
_hash_combine
(
seed
,
x
);
return
seed
;
}
};
}
using
namespace
boost
;
template
<
class
Value
,
size_t
N
>
struct
empty_key
<
boost
::
container
::
small_vector
<
Value
,
N
>>
{
static
boost
::
container
::
small_vector
<
Value
,
N
>
get
()
{
boost
::
container
::
small_vector
<
Value
,
N
>
key
(
1
);
key
[
0
]
=
empty_key
<
Value
>::
get
();
return
key
;
}
};
template
<
class
Value
,
size_t
N
>
struct
deleted_key
<
boost
::
container
::
small_vector
<
Value
,
N
>>
{
static
boost
::
container
::
small_vector
<
Value
,
N
>
get
()
{
boost
::
container
::
small_vector
<
Value
,
N
>
key
(
1
);
key
[
0
]
=
deleted_key
<
Value
>::
get
();
return
key
;
}
};
namespace
graph_tool
{
//=============================
// Partition Description length
...
...
@@ -32,9 +71,9 @@ using namespace boost;
struct
overlap_partition_stats_t
{
typedef
std
::
tuple
<
int
,
int
>
deg_t
;
typedef
vector
<
deg_t
>
cdeg_t
;
typedef
boost
::
container
::
small_
vector
<
deg_t
,
64
>
cdeg_t
;
typedef
vector
<
int
>
bv_t
;
typedef
boost
::
container
::
small_
vector
<
int
,
64
>
bv_t
;
typedef
gt_hash_map
<
bv_t
,
size_t
>
bhist_t
;
typedef
gt_hash_map
<
cdeg_t
,
size_t
,
std
::
hash
<
cdeg_t
>>
cdeg_hist_t
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment