Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tiago Peixoto
graph-tool
Commits
d6aaa556
Commit
d6aaa556
authored
Dec 26, 2015
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace ConstantPropertyMap by UnityPropertyMap whenever appropriate
parent
27f82a7d
Pipeline
#88
failed with stage
Changes
32
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
82 additions
and
84 deletions
+82
-84
src/graph/centrality/graph_eigenvector.cc
src/graph/centrality/graph_eigenvector.cc
+2
-2
src/graph/centrality/graph_hits.cc
src/graph/centrality/graph_hits.cc
+2
-2
src/graph/centrality/graph_katz.cc
src/graph/centrality/graph_katz.cc
+4
-4
src/graph/centrality/graph_pagerank.cc
src/graph/centrality/graph_pagerank.cc
+2
-2
src/graph/community/graph_community.cc
src/graph/community/graph_community.cc
+2
-2
src/graph/community/graph_community_network.cc
src/graph/community/graph_community_network.cc
+3
-3
src/graph/community/graph_community_network_eavg.cc
src/graph/community/graph_community_network_eavg.cc
+2
-2
src/graph/community/graph_community_network_eavg_imp1.cc
src/graph/community/graph_community_network_eavg_imp1.cc
+1
-1
src/graph/community/graph_community_network_edges.cc
src/graph/community/graph_community_network_edges.cc
+2
-2
src/graph/community/graph_community_network_vavg.cc
src/graph/community/graph_community_network_vavg.cc
+2
-2
src/graph/correlations/graph_avg_correlations.cc
src/graph/correlations/graph_avg_correlations.cc
+2
-2
src/graph/correlations/graph_avg_correlations_combined.cc
src/graph/correlations/graph_avg_correlations_combined.cc
+1
-1
src/graph/correlations/graph_correlations.cc
src/graph/correlations/graph_correlations.cc
+2
-2
src/graph/correlations/graph_correlations_combined.cc
src/graph/correlations/graph_correlations_combined.cc
+1
-1
src/graph/flow/graph_minimum_cut.cc
src/graph/flow/graph_minimum_cut.cc
+2
-2
src/graph/graph.hh
src/graph/graph.hh
+1
-1
src/graph/graph_properties.hh
src/graph/graph_properties.hh
+5
-5
src/graph/graph_selectors.hh
src/graph/graph_selectors.hh
+4
-4
src/graph/layout/graph_arf.cc
src/graph/layout/graph_arf.cc
+2
-2
src/graph/layout/graph_fruchterman_reingold.cc
src/graph/layout/graph_fruchterman_reingold.cc
+2
-4
src/graph/layout/graph_sfdp.cc
src/graph/layout/graph_sfdp.cc
+4
-4
src/graph/spectral/graph_adjacency.cc
src/graph/spectral/graph_adjacency.cc
+2
-2
src/graph/spectral/graph_laplacian.cc
src/graph/spectral/graph_laplacian.cc
+2
-2
src/graph/spectral/graph_laplacian.hh
src/graph/spectral/graph_laplacian.hh
+6
-6
src/graph/spectral/graph_norm_laplacian.cc
src/graph/spectral/graph_norm_laplacian.cc
+2
-2
src/graph/spectral/graph_transition.cc
src/graph/spectral/graph_transition.cc
+2
-2
src/graph/spectral/graph_transition.hh
src/graph/spectral/graph_transition.hh
+2
-2
src/graph/topology/graph_minimum_spanning_tree.cc
src/graph/topology/graph_minimum_spanning_tree.cc
+4
-4
src/graph/topology/graph_random_matching.cc
src/graph/topology/graph_random_matching.cc
+2
-2
src/graph/topology/graph_random_spanning_tree.cc
src/graph/topology/graph_random_spanning_tree.cc
+2
-2
src/graph/topology/graph_subgraph_isomorphism.cc
src/graph/topology/graph_subgraph_isomorphism.cc
+8
-8
src/graph/topology/graph_tsp.cc
src/graph/topology/graph_tsp.cc
+2
-2
No files found.
src/graph/centrality/graph_eigenvector.cc
View file @
d6aaa556
...
...
@@ -33,12 +33,12 @@ long double eigenvector(GraphInterface& g, boost::any w, boost::any c,
throw
ValueException
(
"vertex property must be of floating point"
" value type"
);
typedef
Constant
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
boost
::
mpl
::
push_back
<
writable_edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
if
(
w
.
empty
())
w
=
weight_map_t
(
1
);
w
=
weight_map_t
();
long
double
eig
=
0
;
run_action
<>
()
...
...
src/graph/centrality/graph_hits.cc
View file @
d6aaa556
...
...
@@ -59,12 +59,12 @@ long double hits(GraphInterface& g, boost::any w, boost::any x, boost::any y,
throw
ValueException
(
"vertex property must be of floating point"
" value type"
);
typedef
Constant
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
boost
::
mpl
::
push_back
<
writable_edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
if
(
w
.
empty
())
w
=
weight_map_t
(
1
);
w
=
weight_map_t
();
long
double
eig
=
0
;
run_action
<>
()
...
...
src/graph/centrality/graph_katz.cc
View file @
d6aaa556
...
...
@@ -39,19 +39,19 @@ void katz(GraphInterface& g, boost::any w, boost::any c, boost::any beta,
throw
ValueException
(
"personalization vertex property must be of floating point"
" value type"
);
typedef
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
boost
::
mpl
::
push_back
<
writable_edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
if
(
w
.
empty
())
w
=
weight_map_t
(
1.
);
w
=
weight_map_t
();
typedef
Constant
PropertyMap
<
double
,
GraphInterface
::
vertex_t
>
beta_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
vertex_t
>
beta_map_t
;
typedef
boost
::
mpl
::
push_back
<
vertex_floating_properties
,
beta_map_t
>::
type
beta_props_t
;
if
(
beta
.
empty
())
beta
=
beta_map_t
(
1.
);
beta
=
beta_map_t
();
run_action
<>
()(
g
,
std
::
bind
(
get_katz
(),
std
::
placeholders
::
_1
,
g
.
get_vertex_index
(),
std
::
placeholders
::
_2
,
std
::
placeholders
::
_3
,
...
...
src/graph/centrality/graph_pagerank.cc
View file @
d6aaa556
...
...
@@ -44,7 +44,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers,
if
(
pers
.
empty
())
pers
=
pers_map_t
(
1.0
/
g
.
get_num_vertices
());
typedef
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
boost
::
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
...
...
@@ -52,7 +52,7 @@ size_t pagerank(GraphInterface& g, boost::any rank, boost::any pers,
throw
ValueException
(
"weight edge property must have a scalar value type"
);
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1.0
);
weight
=
weight_map_t
();
size_t
iter
;
run_action
<>
()
...
...
src/graph/community/graph_community.cc
View file @
d6aaa556
...
...
@@ -79,12 +79,12 @@ double modularity(GraphInterface& g, boost::any weight, boost::any property)
{
double
modularity
=
0
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
boost
::
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
edge_props_t
;
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1
);
weight
=
weight_map_t
();
run_action
<
graph_tool
::
detail
::
never_directed
>
()
(
g
,
std
::
bind
(
get_modularity
(),
std
::
placeholders
::
_1
,
std
::
placeholders
::
_2
,
...
...
src/graph/community/graph_community_network.cc
View file @
d6aaa556
...
...
@@ -33,8 +33,8 @@ using namespace boost;
using
namespace
graph_tool
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
vertex_t
>
no_vweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
vertex_t
>
no_vweight_map_t
;
typedef
property_map_type
::
apply
<
int32_t
,
GraphInterface
::
edge_index_map_t
>::
type
::
unchecked_t
ecount_map_t
;
typedef
property_map_type
::
apply
<
int32_t
,
GraphInterface
::
vertex_index_map_t
>::
type
::
unchecked_t
vcount_map_t
;
...
...
@@ -97,7 +97,7 @@ void community_network(GraphInterface& gi, GraphInterface& cgi,
vweight_properties
;
if
(
vweight
.
empty
())
vweight
=
no_vweight_map_t
(
1
);
vweight
=
no_vweight_map_t
();
run_action
<>
()
(
gi
,
std
::
bind
(
get_community_network_vertices_dispatch
(),
...
...
src/graph/community/graph_community_network_eavg.cc
View file @
d6aaa556
...
...
@@ -33,7 +33,7 @@ using namespace boost;
using
namespace
graph_tool
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
property_map_type
::
apply
<
int32_t
,
GraphInterface
::
edge_index_map_t
>::
type
ecount_map_t
;
struct
get_weighted_edge_property_dispatch
...
...
@@ -68,7 +68,7 @@ void community_network_eavg(GraphInterface& gi, GraphInterface& cgi,
if
(
eweight
.
empty
())
{
no_weight
=
true
;
eweight
=
no_eweight_map_t
(
1
);
eweight
=
no_eweight_map_t
();
}
typedef
boost
::
mpl
::
insert_range
<
writable_edge_scalar_properties
,
...
...
src/graph/community/graph_community_network_eavg_imp1.cc
View file @
d6aaa556
...
...
@@ -33,7 +33,7 @@ using namespace boost;
using
namespace
graph_tool
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
property_map_type
::
apply
<
int32_t
,
GraphInterface
::
edge_index_map_t
>::
type
ecount_map_t
;
struct
get_edge_sum_dispatch
...
...
src/graph/community/graph_community_network_edges.cc
View file @
d6aaa556
...
...
@@ -33,7 +33,7 @@ using namespace boost;
using
namespace
graph_tool
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
no_eweight_map_t
;
typedef
property_map_type
::
apply
<
int32_t
,
GraphInterface
::
edge_index_map_t
>::
type
::
unchecked_t
ecount_map_t
;
struct
get_community_network_edges_dispatch
...
...
@@ -72,7 +72,7 @@ void community_network_edges(GraphInterface& gi, GraphInterface& cgi,
eweight_properties
;
if
(
eweight
.
empty
())
eweight
=
no_eweight_map_t
(
1
);
eweight
=
no_eweight_map_t
();
run_action
<>
()
(
gi
,
std
::
bind
(
get_community_network_edges_dispatch
(
self_loops
,
parallel_edges
),
...
...
src/graph/community/graph_community_network_vavg.cc
View file @
d6aaa556
...
...
@@ -33,7 +33,7 @@ using namespace boost;
using
namespace
graph_tool
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
vertex_t
>
no_vweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
vertex_t
>
no_vweight_map_t
;
typedef
property_map_type
::
apply
<
int32_t
,
GraphInterface
::
vertex_index_map_t
>::
type
vcount_map_t
;
...
...
@@ -77,7 +77,7 @@ void community_network_vavg(GraphInterface& gi, GraphInterface& cgi,
if
(
vweight
.
empty
())
{
no_weight
=
true
;
vweight
=
no_vweight_map_t
(
1
);
vweight
=
no_vweight_map_t
();
}
typedef
boost
::
mpl
::
insert_range
<
writable_vertex_scalar_properties
,
...
...
src/graph/correlations/graph_avg_correlations.cc
View file @
d6aaa556
...
...
@@ -40,7 +40,7 @@ void graph_avg_corr_imp1(GraphInterface& g, boost::python::object& avg,
const
vector
<
long
double
>&
bins
);
typedef
Constant
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
cweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
cweight_map_t
;
boost
::
python
::
object
get_vertex_avg_correlation
(
GraphInterface
&
gi
,
...
...
@@ -61,7 +61,7 @@ get_vertex_avg_correlation(GraphInterface& gi,
weight_prop
=
wrapped_weight_t
(
weight
,
edge_scalar_properties
());
}
else
weight_prop
=
cweight_map_t
(
1
);
weight_prop
=
cweight_map_t
();
try
{
...
...
src/graph/correlations/graph_avg_correlations_combined.cc
View file @
d6aaa556
...
...
@@ -31,7 +31,7 @@ using namespace std;
using
namespace
boost
;
using
namespace
graph_tool
;
typedef
Constant
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
dummy_weight
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
dummy_weight
;
boost
::
python
::
object
get_vertex_avg_combined_correlation
(
GraphInterface
&
gi
,
...
...
src/graph/correlations/graph_correlations.cc
View file @
d6aaa556
...
...
@@ -41,7 +41,7 @@ void graph_correlations_imp1(GraphInterface& g, boost::python::object& hist,
const
std
::
array
<
vector
<
long
double
>
,
2
>&
bins
);
typedef
Constant
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
cweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
cweight_map_t
;
boost
::
python
::
object
get_vertex_correlation_histogram
(
GraphInterface
&
gi
,
...
...
@@ -67,7 +67,7 @@ get_vertex_correlation_histogram(GraphInterface& gi,
weight_prop
=
wrapped_weight_t
(
weight
,
edge_scalar_properties
());
}
else
weight_prop
=
cweight_map_t
(
1
);
weight_prop
=
cweight_map_t
();
try
{
...
...
src/graph/correlations/graph_correlations_combined.cc
View file @
d6aaa556
...
...
@@ -30,7 +30,7 @@ using namespace std;
using
namespace
boost
;
using
namespace
graph_tool
;
typedef
Constant
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
dummy_weight
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
dummy_weight
;
boost
::
python
::
object
get_vertex_combined_correlation_histogram
(
GraphInterface
&
gi
,
...
...
src/graph/flow/graph_minimum_cut.cc
View file @
d6aaa556
...
...
@@ -47,10 +47,10 @@ double min_cut(GraphInterface& gi, boost::any weight, boost::any part_map)
{
double
mc
=
0
;
typedef
Constant
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
typedef
Unity
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
if
(
weight
.
empty
())
weight
=
cweight_t
(
1
);
weight
=
cweight_t
();
typedef
boost
::
mpl
::
push_back
<
writable_edge_scalar_properties
,
cweight_t
>::
type
weight_maps
;
...
...
src/graph/graph.hh
View file @
d6aaa556
...
...
@@ -137,7 +137,7 @@ public:
typedef
boost
::
property_map
<
multigraph_t
,
boost
::
vertex_index_t
>::
type
vertex_index_map_t
;
typedef
boost
::
property_map
<
multigraph_t
,
boost
::
edge_index_t
>::
type
edge_index_map_t
;
typedef
ConstantPropertyMap
<
size_t
,
boost
::
graph_property_tag
>
graph_index_map_t
;
typedef
ConstantPropertyMap
<
size_t
,
boost
::
graph_property_tag
>
graph_index_map_t
;
// internal access
...
...
src/graph/graph_properties.hh
View file @
d6aaa556
...
...
@@ -617,18 +617,18 @@ public:
};
// the following is a property map which always returns one
template
<
class
Key
>
template
<
class
Value
,
class
Key
>
class
UnityPropertyMap
:
public
boost
::
put_get_helper
<
int
,
UnityPropertyMap
<
Key
>>
:
public
boost
::
put_get_helper
<
Value
,
UnityPropertyMap
<
Value
,
Key
>>
{
public:
typedef
int
value_type
;
typedef
Value
value_type
;
typedef
value_type
reference
;
typedef
Key
key_type
;
typedef
boost
::
readable_property_map_tag
category
;
template
<
class
K
>
value_type
operator
[](
const
K
&
)
const
{
return
1
;
}
value_type
operator
[](
const
K
&
)
const
{
return
value_type
(
1
)
;
}
};
...
...
@@ -639,7 +639,7 @@ struct is_constant_property
typedef
typename
boost
::
property_traits
<
Property
>::
value_type
value_type
;
typedef
typename
std
::
conditional
<
std
::
is_same
<
Property
,
ConstantPropertyMap
<
value_type
,
key_type
>>::
value
,
std
::
true_type
,
typename
std
::
is_same
<
Property
,
UnityPropertyMap
<
key_type
>>::
type
>::
type
type
;
typename
std
::
is_same
<
Property
,
UnityPropertyMap
<
value_type
,
key_type
>>::
type
>::
type
type
;
};
...
...
src/graph/graph_selectors.hh
View file @
d6aaa556
...
...
@@ -105,9 +105,9 @@ struct in_degreeS
return
in_degree
(
v
,
g
)
*
weight
.
c
;
}
template
<
class
Graph
,
class
Vertex
,
class
Key
>
template
<
class
Graph
,
class
Vertex
,
class
Key
,
class
Value
>
auto
get_in_degree
(
Vertex
v
,
const
Graph
&
g
,
std
::
true_type
,
const
UnityPropertyMap
<
Key
>&
)
const
const
UnityPropertyMap
<
Value
,
Key
>&
)
const
{
return
in_degree
(
v
,
g
);
}
...
...
@@ -159,9 +159,9 @@ struct out_degreeS
return
out_degree
(
v
,
g
)
*
weight
.
c
;
}
template
<
class
Graph
,
class
Vertex
,
class
Key
>
template
<
class
Graph
,
class
Vertex
,
class
Key
,
class
Value
>
auto
get_out_degree
(
Vertex
v
,
const
Graph
&
g
,
const
UnityPropertyMap
<
Key
>&
)
const
const
UnityPropertyMap
<
Value
,
Key
>&
)
const
{
return
out_degree
(
v
,
g
);
}
...
...
src/graph/layout/graph_arf.cc
View file @
d6aaa556
...
...
@@ -31,12 +31,12 @@ void arf_layout(GraphInterface& g, boost::any pos, boost::any weight, double d,
double
a
,
double
dt
,
size_t
max_iter
,
double
epsilon
,
size_t
dim
)
{
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
boost
::
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
edge_props_t
;
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1
);
weight
=
weight_map_t
();
run_action
<
graph_tool
::
detail
::
never_directed
>
()
(
g
,
std
::
bind
(
get_arf_layout
(),
std
::
placeholders
::
_1
,
std
::
placeholders
::
_2
,
std
::
placeholders
::
_3
,
a
,
d
,
dt
,
epsilon
,
max_iter
,
dim
),
...
...
src/graph/layout/graph_fruchterman_reingold.cc
View file @
d6aaa556
...
...
@@ -155,8 +155,6 @@ struct get_layout
cooling
(
cool
).
force_pairs
(
all_force_pairs
()));
}
};
...
...
@@ -165,12 +163,12 @@ void fruchterman_reingold_layout(GraphInterface& g, boost::any pos,
bool
square
,
double
scale
,
bool
grid
,
double
ti
,
double
tf
,
size_t
max_iter
)
{
typedef
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
boost
::
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
edge_props_t
;
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1.0
);
weight
=
weight_map_t
();
if
(
square
)
run_action
<
graph_tool
::
detail
::
never_directed
>
()
(
g
,
...
...
src/graph/layout/graph_sfdp.cc
View file @
d6aaa556
...
...
@@ -36,8 +36,8 @@ void sfdp_layout(GraphInterface& g, boost::any pos, boost::any vweight,
size_t
max_level
,
double
epsilon
,
size_t
max_iter
,
bool
adaptive
,
bool
verbose
,
rng_t
&
rng
)
{
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
vertex_t
>
vweight_map_t
;
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
eweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
vertex_t
>
vweight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
eweight_map_t
;
typedef
mpl
::
push_back
<
vertex_scalar_properties
,
vweight_map_t
>::
type
vertex_props_t
;
typedef
mpl
::
push_back
<
edge_scalar_properties
,
eweight_map_t
>::
type
...
...
@@ -57,9 +57,9 @@ void sfdp_layout(GraphInterface& g, boost::any pos, boost::any vweight,
any_cast
<
group_map_t
>
(
python
::
extract
<
any
>
(
spring_parms
[
6
]));
if
(
vweight
.
empty
())
vweight
=
vweight_map_t
(
1
);
vweight
=
vweight_map_t
();
if
(
eweight
.
empty
())
eweight
=
eweight_map_t
(
1
);
eweight
=
eweight_map_t
();
typedef
property_map_type
::
apply
<
uint8_t
,
GraphInterface
::
vertex_index_map_t
>::
type
...
...
src/graph/spectral/graph_adjacency.cc
View file @
d6aaa556
...
...
@@ -37,7 +37,7 @@ void adjacency(GraphInterface& g, boost::any index, boost::any weight,
if
(
!
belongs
<
vertex_scalar_properties
>
()(
index
))
throw
ValueException
(
"index vertex property must have a scalar value type"
);
typedef
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
...
...
@@ -45,7 +45,7 @@ void adjacency(GraphInterface& g, boost::any index, boost::any weight,
throw
ValueException
(
"weight edge property must have a scalar value type"
);
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1.0
);
weight
=
weight_map_t
();
multi_array_ref
<
double
,
1
>
data
=
get_array
<
double
,
1
>
(
odata
);
multi_array_ref
<
int32_t
,
1
>
i
=
get_array
<
int32_t
,
1
>
(
oi
);
...
...
src/graph/spectral/graph_laplacian.cc
View file @
d6aaa556
...
...
@@ -38,7 +38,7 @@ void laplacian(GraphInterface& g, boost::any index, boost::any weight,
if
(
!
belongs
<
vertex_scalar_properties
>
()(
index
))
throw
ValueException
(
"index vertex property must have a scalar value type"
);
typedef
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
...
...
@@ -46,7 +46,7 @@ void laplacian(GraphInterface& g, boost::any index, boost::any weight,
throw
ValueException
(
"weight edge property must have a scalar value type"
);
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1.0
);
weight
=
weight_map_t
();
deg_t
deg
;
if
(
sdeg
==
"in"
)
...
...
src/graph/spectral/graph_laplacian.hh
View file @
d6aaa556
...
...
@@ -45,26 +45,26 @@ sum_degree(Graph& g, typename graph_traits<Graph>::vertex_descriptor v,
return
sum
;
}
template
<
class
Graph
,
class
EdgeSelector
>
template
<
class
Graph
,
class
EdgeSelector
,
class
Val
>
double
sum_degree
(
Graph
&
g
,
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
,
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
,
all_edges_iteratorS
<
Graph
>
)
Unity
PropertyMap
<
Val
,
GraphInterface
::
edge_t
>
,
all_edges_iteratorS
<
Graph
>
)
{
return
total_degreeS
()(
v
,
g
);
}
template
<
class
Graph
,
class
EdgeSelector
>
template
<
class
Graph
,
class
EdgeSelector
,
class
Val
>
double
sum_degree
(
Graph
&
g
,
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
,
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
,
in_edge_iteratorS
<
Graph
>
)
Unity
PropertyMap
<
Val
,
GraphInterface
::
edge_t
>
,
in_edge_iteratorS
<
Graph
>
)
{
return
in_degreeS
()(
v
,
g
);
}
template
<
class
Graph
,
class
EdgeSelector
>
template
<
class
Graph
,
class
EdgeSelector
,
class
Val
>
double
sum_degree
(
Graph
&
g
,
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
,
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
,
out_edge_iteratorS
<
Graph
>
)
Unity
PropertyMap
<
Val
,
GraphInterface
::
edge_t
>
,
out_edge_iteratorS
<
Graph
>
)
{
return
out_degreeS
()(
v
,
g
);
}
...
...
src/graph/spectral/graph_norm_laplacian.cc
View file @
d6aaa556
...
...
@@ -38,7 +38,7 @@ void norm_laplacian(GraphInterface& g, boost::any index, boost::any weight,
if
(
!
belongs
<
vertex_scalar_properties
>
()(
index
))
throw
ValueException
(
"index vertex property must have a scalar value type"
);
typedef
Constant
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
double
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
...
...
@@ -46,7 +46,7 @@ void norm_laplacian(GraphInterface& g, boost::any index, boost::any weight,
throw
ValueException
(
"weight edge property must have a scalar value type"
);
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1.0
);
weight
=
weight_map_t
();
deg_t
deg
;
if
(
sdeg
==
"in"
)
...
...
src/graph/spectral/graph_transition.cc
View file @
d6aaa556
...
...
@@ -37,7 +37,7 @@ void transition(GraphInterface& g, boost::any index, boost::any weight,
if
(
!
belongs
<
vertex_scalar_properties
>
()(
index
))
throw
ValueException
(
"index vertex property must have a scalar value type"
);
typedef
Constant
PropertyMap
<
size_
t
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
in
t
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
weight_props_t
;
...
...
@@ -45,7 +45,7 @@ void transition(GraphInterface& g, boost::any index, boost::any weight,
throw
ValueException
(
"weight edge property must have a scalar value type"
);
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1
);
weight
=
weight_map_t
();
multi_array_ref
<
double
,
1
>
data
=
get_array
<
double
,
1
>
(
odata
);
multi_array_ref
<
int32_t
,
1
>
i
=
get_array
<
int32_t
,
1
>
(
oi
);
...
...
src/graph/spectral/graph_transition.hh
View file @
d6aaa556
...
...
@@ -38,10 +38,10 @@ sum_degree(Graph& g, typename graph_traits<Graph>::vertex_descriptor v,
return
sum
;
}
template
<
class
Graph
>
template
<
class
Graph
,
class
Type
>
size_t
sum_degree
(
Graph
&
g
,
typename
graph_traits
<
Graph
>::
vertex_descriptor
v
,
const
Constant
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>&
)
const
Unity
PropertyMap
<
Type
,
GraphInterface
::
edge_t
>&
)
{
return
out_degreeS
()(
v
,
g
);
}
...
...
src/graph/topology/graph_minimum_spanning_tree.cc
View file @
d6aaa556
...
...
@@ -116,10 +116,10 @@ void get_kruskal_spanning_tree(GraphInterface& gi, boost::any weight_map,
boost
::
any
tree_map
)
{
typedef
Constant
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
typedef
Unity
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
if
(
weight_map
.
empty
())
weight_map
=
cweight_t
(
1
);
weight_map
=
cweight_t
();
typedef
mpl
::
push_back
<
writable_edge_scalar_properties
,
cweight_t
>::
type
weight_maps
;
...
...
@@ -133,10 +133,10 @@ void get_kruskal_spanning_tree(GraphInterface& gi, boost::any weight_map,
void
get_prim_spanning_tree
(
GraphInterface
&
gi
,
size_t
root
,
boost
::
any
weight_map
,
boost
::
any
tree_map
)
{
typedef
Constant
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
typedef
Unity
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
if
(
weight_map
.
empty
())
weight_map
=
cweight_t
(
1
);
weight_map
=
cweight_t
();
typedef
mpl
::
push_back
<
writable_edge_scalar_properties
,
cweight_t
>::
type
weight_maps
;
...
...
src/graph/topology/graph_random_matching.cc
View file @
d6aaa556
...
...
@@ -93,12 +93,12 @@ struct do_random_matching
void
random_matching
(
GraphInterface
&
gi
,
boost
::
any
weight
,
boost
::
any
match
,
bool
minimize
,
rng_t
&
rng
)
{
typedef
Constant
PropertyMap
<
int
32_t
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
Unity
PropertyMap
<
int
,
GraphInterface
::
edge_t
>
weight_map_t
;
typedef
mpl
::
push_back
<
edge_scalar_properties
,
weight_map_t
>::
type
edge_props_t
;
if
(
weight
.
empty
())
weight
=
weight_map_t
(
1
);
weight
=
weight_map_t
();
run_action
<>
()
(
gi
,
std
::
bind
(
do_random_matching
(),
std
::
placeholders
::
_1
,
gi
.
get_vertex_index
(),
...
...
src/graph/topology/graph_random_spanning_tree.cc
View file @
d6aaa556
...
...
@@ -85,10 +85,10 @@ void get_random_spanning_tree(GraphInterface& gi, size_t root,
boost
::
any
weight_map
,
boost
::
any
tree_map
,
rng_t
&
rng
)
{
typedef
Constant
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
typedef
Unity
PropertyMap
<
size_t
,
GraphInterface
::
edge_t
>
cweight_t
;
if
(
weight_map
.
empty
())
weight_map
=
cweight_t
(
1
);
weight_map
=
cweight_t
();
typedef
mpl
::
push_back
<
writable_edge_scalar_properties
,
cweight_t
>::
type
weight_maps
;
...
...
src/graph/topology/graph_subgraph_isomorphism.cc
View file @
d6aaa556
...
...
@@ -184,24 +184,24 @@ subgraph_isomorphism(GraphInterface& gi1, GraphInterface& gi2,
size_t
max_n
,
bool
induced
,
bool
iso
,
bool
generator
)
{
// typedef mpl::push_back<vertex_properties,
//
Constant
PropertyMap<bool,GraphInterface::vertex_t> >
//
Unity
PropertyMap<bool,GraphInterface::vertex_t> >
// ::type vertex_props_t;
// typedef mpl::push_back<edge_properties,
//
Constant
PropertyMap<bool,GraphInterface::edge_t> >
//
Unity
PropertyMap<bool,GraphInterface::edge_t> >
// ::type edge_props_t;
typedef
property_map_type
::
apply
<
int64_t
,
GraphInterface
::
vertex_index_map_t
>::
type
vlabel_t
;
typedef
mpl
::
vector2
<
typename
vlabel_t
::
unchecked_t
,
Constant
PropertyMap
<
bool
,
GraphInterface
::
vertex_t
>
>
vertex_props_t
;
Unity
PropertyMap
<
bool
,
GraphInterface
::
vertex_t
>
>
vertex_props_t
;
typedef
property_map_type
::
apply
<
int64_t
,
GraphInterface
::
edge_index_map_t
>::
type
elabel_t
;
typedef
mpl
::
vector2
<
typename
elabel_t
::
unchecked_t
,
Constant
PropertyMap
<
bool
,
GraphInterface
::
edge_t
>
>
edge_props_t
;
Unity
PropertyMap
<
bool
,
GraphInterface
::
edge_t
>
>
edge_props_t
;