represents the data associated with a vertex its adjacent edges and neighbors. More...
#include <iscope.hpp>
Public Types | |
| typedef Graph | graph_type |
| The type of graph that the iscope operates on. | |
| typedef Graph::vertex_data_type | vertex_data_type |
| The vertex data type associated with the graph. | |
| typedef Graph::edge_data_type | edge_data_type |
| The edge data type associated with the graph. | |
| typedef Graph::edge_list_type | edge_list_type |
| The edge data type associated with the graph. | |
Public Member Functions | |
| iscope (Graph *graph_ptr=NULL, vertex_id_t vertex=-1) | |
| construct an iscope from a graph This is called by the engine when creating an iscope to be passed into an update function. | |
| virtual | ~iscope () |
| virtual void | commit ()=0 |
| commits all changes. This is called by the engine after the update function returns. | |
| size_t | num_vertices () const |
| vertex_id_t | vertex () const |
| Returns the vertex id of the base vertex in this scope. | |
| edge_id_t | edge (vertex_id_t source, vertex_id_t target) const |
| edge lookup from source target pair to edge id. | |
| bool | edge_exists (vertex_id_t source, vertex_id_t target) const |
| test whether an edge is present | |
| edge_id_t | reverse_edge (edge_id_t eid) const |
| Get the reverse edge. | |
| edge_list_type | in_edge_ids () const |
| get all in edges to the base vertex of this scope. | |
| edge_list_type | in_edge_ids (vertex_id_t v) const |
| get all in edge ids to the vertex argument | |
| edge_list_type | out_edge_ids () const |
| get all out edge ids to the base vertex of this scope | |
| edge_list_type | out_edge_ids (vertex_id_t v) const |
| get all out ede ids to the vertex argument. | |
| vertex_id_t | source (edge_id_t edge_id) const |
| Get the source vertex of the edge id argument. | |
| vertex_id_t | target (edge_id_t edge_id) const |
| get the target vertex of the edge id argument | |
| virtual vertex_data_type & | vertex_data ()=0 |
| Get a mutable reference to the data associated with the base vertex. | |
| virtual const vertex_data_type & | vertex_data () const =0 |
| Get an immutable reference to the data associated with the vase vertex. | |
| virtual const vertex_data_type & | const_vertex_data () const =0 |
| Get an immutable reference to the data associated with the vase vertex. | |
| virtual edge_data_type & | edge_data (edge_id_t eid)=0 |
| Get a mutable reference to the data associated with the edge. | |
| virtual const edge_data_type & | edge_data (edge_id_t eid) const =0 |
| Get an immutable reference to the data associated with the edge. | |
| virtual const edge_data_type & | const_edge_data (edge_id_t eid) const =0 |
| Get an immutable reference to the data associated with the vase vertex. | |
| virtual vertex_data_type & | neighbor_vertex_data (vertex_id_t vertex)=0 |
| get a mutable reference to the data associated with a neighboring vertex. | |
| virtual const vertex_data_type & | neighbor_vertex_data (vertex_id_t vertex) const =0 |
| get an immutable reference to the data associated with a neighboring vertex. | |
| virtual const vertex_data_type & | const_neighbor_vertex_data (vertex_id_t vertex) const =0 |
| get an immutable reference to the data associated with a neighboring vertex. | |
| virtual bool | experimental_scope_upgrade (scope_range::scope_range_enum newrange) |
Protected Attributes | |
| Graph * | _graph_ptr |
| vertex_id_t | _vertex |
represents the data associated with a vertex its adjacent edges and neighbors.
The update function is passed an instance of iscope and is uses that instance to obtain information about the graph structure and to read and modify the graph data.
Definition at line 145 of file iscope.hpp.
| virtual graphlab::iscope< Graph >::~iscope | ( | ) | [inline, virtual] |
iscope destructor
Definition at line 173 of file iscope.hpp.
| virtual const edge_data_type& graphlab::iscope< Graph >::const_edge_data | ( | edge_id_t | eid | ) | const [pure virtual] |
Get an immutable reference to the data associated with the vase vertex.
This should be called if the data does not need to be modified.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| virtual const vertex_data_type& graphlab::iscope< Graph >::const_neighbor_vertex_data | ( | vertex_id_t | vertex | ) | const [pure virtual] |
get an immutable reference to the data associated with a neighboring vertex.
This function should only be invoked on neighboring vertices. Unfortunately, due to the Log(d) lookup required to enforce the adjacency constraint we do not check at this time.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| virtual const vertex_data_type& graphlab::iscope< Graph >::const_vertex_data | ( | ) | const [pure virtual] |
Get an immutable reference to the data associated with the vase vertex.
This should be called if the data does not need to be modified.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| edge_id_t graphlab::iscope< Graph >::edge | ( | vertex_id_t | source, | |
| vertex_id_t | target | |||
| ) | const [inline] |
edge lookup from source target pair to edge id.
This is used to get structural information from the graph. If the edge is not present this method will fail.
Definition at line 205 of file iscope.hpp.
| virtual const edge_data_type& graphlab::iscope< Graph >::edge_data | ( | edge_id_t | eid | ) | const [pure virtual] |
Get an immutable reference to the data associated with the edge.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| virtual edge_data_type& graphlab::iscope< Graph >::edge_data | ( | edge_id_t | eid | ) | [pure virtual] |
Get a mutable reference to the data associated with the edge.
This should only be invoked on edges that are adjacent to the base vertex. If the edge_data is not going to be modified the const version of this function should be used to permit further optimization.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| bool graphlab::iscope< Graph >::edge_exists | ( | vertex_id_t | source, | |
| vertex_id_t | target | |||
| ) | const [inline] |
test whether an edge is present
This method tests whether the edge exists. If the edge exists this method returns true.
Definition at line 219 of file iscope.hpp.
| virtual bool graphlab::iscope< Graph >::experimental_scope_upgrade | ( | scope_range::scope_range_enum | newrange | ) | [inline, virtual] |
Experimental scope upgrade scheme. Returns true if scope upgrade is successful. If this ever returns false, you are hosed. Should work with general_scope. Note that after scope_upgrade is called, any graph data within the scope may change due to a race between releasing and reacquiring the upgraded scope.
Reimplemented in graphlab::general_scope< Graph >.
Definition at line 401 of file iscope.hpp.
| edge_list_type graphlab::iscope< Graph >::in_edge_ids | ( | vertex_id_t | v | ) | const [inline] |
get all in edge ids to the vertex argument
This method returns an immutable vector of edge ids sorted in order of <source id, dest id> pairs.
Definition at line 259 of file iscope.hpp.
| edge_list_type graphlab::iscope< Graph >::in_edge_ids | ( | ) | const [inline] |
get all in edges to the base vertex of this scope.
This method returns an immutable vector of edge ids sorted in order of <source id, dest id> pairs.
Definition at line 248 of file iscope.hpp.
| virtual vertex_data_type& graphlab::iscope< Graph >::neighbor_vertex_data | ( | vertex_id_t | vertex | ) | [pure virtual] |
get a mutable reference to the data associated with a neighboring vertex.
This function should only be invoked on neighboring vertices. Unfortunately, due to the Log(d) lookup required to enforce the adjacency constraint we do not check at this time. If the neighboring vertex data is not going to be modified the const version of this function should be called to permit further optimization by the graphlab engine.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| virtual const vertex_data_type& graphlab::iscope< Graph >::neighbor_vertex_data | ( | vertex_id_t | vertex | ) | const [pure virtual] |
get an immutable reference to the data associated with a neighboring vertex.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| size_t graphlab::iscope< Graph >::num_vertices | ( | ) | const [inline] |
Get the number of vertices in the graph
Definition at line 184 of file iscope.hpp.
| edge_list_type graphlab::iscope< Graph >::out_edge_ids | ( | ) | const [inline] |
get all out edge ids to the base vertex of this scope
This method returns an immutable vector of edge ids sorted in order of <source id, dest id> pairs.
Definition at line 271 of file iscope.hpp.
| edge_list_type graphlab::iscope< Graph >::out_edge_ids | ( | vertex_id_t | v | ) | const [inline] |
get all out ede ids to the vertex argument.
This method returns an immutable vector of edge ids sorted in order of <source id, dest id> pairs.
Definition at line 282 of file iscope.hpp.
| edge_id_t graphlab::iscope< Graph >::reverse_edge | ( | edge_id_t | eid | ) | const [inline] |
Get the reverse edge.
Get the reverse edge id. If no such edge exists this method will fail.
Definition at line 234 of file iscope.hpp.
| vertex_id_t graphlab::iscope< Graph >::vertex | ( | ) | const [inline] |
Returns the vertex id of the base vertex in this scope.
This method is used by the update function to get the base vertex of the scope. The base vertex is the vertex that the update function is being applied to.
Definition at line 197 of file iscope.hpp.
| virtual const vertex_data_type& graphlab::iscope< Graph >::vertex_data | ( | ) | const [pure virtual] |
Get an immutable reference to the data associated with the vase vertex.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
| virtual vertex_data_type& graphlab::iscope< Graph >::vertex_data | ( | ) | [pure virtual] |
Get a mutable reference to the data associated with the base vertex.
Certain optimizations may be made in future version of graphlab that could benefit from immutable vertex_data requests. Therefore if the vertex data does not need to be mutable use the const reference version of vertex_data.
Implemented in graphlab::general_scope< Graph >, and graphlab::synchronous_scope< Graph >.
Graph* graphlab::iscope< Graph >::_graph_ptr [protected] |
A pointer to the underlying graph datastructure
Definition at line 407 of file iscope.hpp.
vertex_id_t graphlab::iscope< Graph >::_vertex [protected] |
The vertex that this graph represents
Definition at line 410 of file iscope.hpp.
1.7.1