IBM SYSTEMG G RUNTIME & NATIVE STORE  0.5
IBM Native Graph Computing and Storage System based on IBM Parallel Programming Library
 All Classes Functions Variables Typedefs Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | List of all members
ibmppl::ibm_generic_graph Class Reference

Generic Graph Class: a generic interface for directed/undirected graph. More...

#include <ibm_generic_graph.h>

Inheritance diagram for ibmppl::ibm_generic_graph:
ibmppl::ibm_multiproperty_graph_generic< HYBRID > ibmppl::rdfGraph< tabular_multiproperty_type, tabular_multiproperty_type, ST >

Public Types

typedef _pred_iterator_t
< base_pred_iterator,
ibm_generic_graph
pred_iterator
 predecessor iterator type
 
typedef base_type::vertexd_type vertexd_type
 internal vertex id type
 
typedef base_type::edged_type edged_type
 internal edge id type
 
typedef _edge_iterator_t
< base_edge_iterator,
base_vertex_iterator,
ibm_generic_graph
edge_iterator
 edge iterator type
 
typedef _vertex_iterator_t
< base_vertex_iterator,
edge_iterator,
ibm_generic_graph
vertex_iterator
 vertex iterator type
 
typedef
_subproperty_iterator_t
< vertex_iterator,
edge_iterator
property_iterator
 property(subproperty) iterator type
 
typedef base_type::vertex_property vertex_property
 
typedef _fast_vertex_iterator
< ibm_generic_graph,
vertex_iterator
fast_vertex_iterator
 fast vertex iterator type: only iterate over exsiting internal/external vertex id
 
- Public Types inherited from ibmppl::ibm_multiproperty_graph_generic< HYBRID >
typedef base_type::edged_type edged_type
 Edge descriptor or unique edge identifier.
 
typedef base_type::vertex_type vertex_type
 The vertex class; storage for property and edges.
 
typedef base_type::edge_type edge_type
 
typedef base_type::vertexd_type vertexd_type
 Vertex descriptor. Unique vertex identifier.
 
typedef base_type::vertex_property vertex_property
 Property type associated with each vertex.
 
typedef base_type::edge_property edge_property
 Property type associated with each edge.
 
typedef base_type::edge_iterator base_edge_iterator
 Iterator type for traversing vertices.
 
typedef base_type::vertex_iterator base_vertex_iterator
 
typedef base_type::pred_iterator base_pred_iterator
 
typedef imp_vertex_iterator
< vertex_type,
base_vertex_iterator,
this_type, vertexd_type
vertex_iterator
 
typedef imp_edge_iterator
< edge_type,
base_edge_iterator, this_type,
edged_type
edge_iterator
 
typedef imp_pred_iterator
< edge_type,
base_pred_iterator, this_type
pred_iterator
 
typedef
omnidirectional_edge_iterator_t
< edge_iterator,
vertex_iterator, this_type
omni_iterator
 
typedef
base_type::const_vertex_iterator 
const_vertex_iterator
 Const Iterator type for traversing edges. You won't be able to modify properties when using this iterator.
 
typedef std::string property_name_type
 
typedef std::string property_value_type
 
typedef std::string label_string_type
 
typedef std::string vclass_string_type
 
typedef
mp_subproperty_iterator_t
< vertex_iterator,
edge_iterator
property_iterator
 
- Public Types inherited from ibmppl::rdfGraph< tabular_multiproperty_type, tabular_multiproperty_type, ST >
typedef base_type::edged_type edged_type
 Edge descriptor or unique edge identifier.
 
typedef base_type::vertexd_type vertexd_type
 Vertex descriptor. Unique vertex identifier.
 
typedef base_type::vertex_property vertex_property
 Property type associated with each vertex.
 
typedef base_type::edge_property edge_property
 Property type associated with each edge.
 
typedef base_type::vertex_iterator vertex_iterator
 Iterator type for traversing vertices.
 
typedef
base_type::const_vertex_iterator 
const_vertex_iterator
 
typedef base_type::edge_iterator edge_iterator
 edge iterator
 

Public Member Functions

 ibm_generic_graph (string filename, string path, DIRECTNESS d=PRED_DIRECTED, UINT64 max_memsize=0)
 Generic graph constructor. More...
 
DIRECTNESS get_directness (void)
 get graph directness More...
 
bool is_directed (void)
 check if graph is directed More...
 
bool is_undirected (void)
 check if graph is undirected More...
 
size_t num_edges (void)
 get number of edges in the graph More...
 
size_t num_vertices (void)
 get number of vertices in the graph More...
 
long int load_csv_vertices (string filename, bool has_header, string separators, size_t keypos, string global_label, size_t labelpos, bool *loop_ctrl=NULL)
 load vertices from a csv file into graph. If the vertex already exists in graph, its property will be updated. More...
 
long int batch_load_csv_vertices (string filename, bool has_header, string separators, size_t keypos, string global_label, size_t labelpos, size_t batch_size=60000000, bool *loop_ctrl=NULL, bool boolAddNOverwriteProperties=false)
 load vertices from a csv file in batch mode. More...
 
size_t get_sec ()
 
long int load_csv_edges (string filename, bool has_header, string separators, size_t srcpos, size_t targpos, string global_label, size_t labelpos, string default_vertex_label="na", bool *loop_ctrl=NULL)
 load edges from a csv file. if the vertex doesn't exist in the graph, it will be added with default_vertex_label More...
 
long int batch_load_csv_edges (string filename, bool has_header, string separators, size_t srcpos, size_t targpos, string global_label, size_t labelpos, string default_vertex_label="na", size_t batch_size=60000000, bool *loop_ctrl=NULL)
 load edges from a csv file. if the vertex doesn't exist in the graph, it will be added with default_vertex_label More...
 
long int batch_load_csv_edges (string fn_id, string fn_src, string fn_dest, string edge_label, string vertex_label, size_t batch_size=60000000)
 
vertex_iterator vertices_begin ()
 returning the iterator pointing to the head element of the graph More...
 
vertex_iterator vertices_end ()
 returning the iterator pointing to the tail element of the graph More...
 
fast_vertex_iterator vertices_begin_fast ()
 returning the fast vertex iterator pointing to the head element of the graph More...
 
fast_vertex_iterator vertices_end_fast ()
 returning the fast vertex iterator pointing to the tail element of the graph More...
 
vertex_iterator find_vertex (size_t vid)
 find vertex with given internal vertex id More...
 
vertex_iterator find_vertex (const string &external_id)
 find vertex with given external vertex id More...
 
vertex_iterator deprecated_find_vertex (const string &external_id)
 
edge_iterator find_edge (vertexd_type vid, edged_type eid)
 find edge with given vertex id and edge id More...
 
bool find_edge (vertexd_type vid, edged_type eid, edge_iterator &ret)
 find edge with given vertex id and edge id More...
 
void find_edge (const string &src, const string &targ, std::vector< edge_iterator > &ret)
 find edge with given source and target vertex id More...
 
void find_edge (vertexd_type vid, vertexd_type targ, std::vector< edge_iterator > &ret)
 find edge with given source and target vertex id More...
 
vertexd_type add_vertex (std::string label)
 add new vertex More...
 
vertexd_type add_vertex (std::string label, const std::string &external_id)
 add new vertex with given external id More...
 
vertexd_type add_vertex (size_t lid, const std::string &external_id)
 
vertexd_type add_vertex (const std::string &external_id, vertex_property &mp)
 
void delete_vertex (const std::string &external_id)
 delete vertex with given external id More...
 
void delete_vertex (vertexd_type vid)
 delete vertex with given internal id More...
 
void delete_edge (const size_t src_id, const size_t targ_id)
 delete edge
 
void delete_edge (const size_t src_id, const size_t targ_id, const size_t eid)
 delete edge with eid
 
bool get_internal_id (const string &external_id, size_t &vid)
 found the corresponding internal id More...
 
string get_external_id (size_t vid)
 found the corresponding external id More...
 
edge_iterator add_edge_ref (vertexd_type vsource, vertexd_type vtarget, std::string label)
 add a new edge and return its reference More...
 
bool get_vertex_labelid (const std::string &label, size_t &labelid)
 
std::string get_vertex_label (size_t labelid)
 
bool get_edge_labelid (const std::string &label, size_t &labelid)
 
vertexd_type add_vertex (size_t lid)
 
edge_iterator add_edge_ref (vertexd_type vsource, vertexd_type vtarget, size_t lid)
 
- Public Member Functions inherited from ibmppl::ibm_multiproperty_graph_generic< HYBRID >
 ibm_multiproperty_graph_generic (string filename, string path, UINT64 max_memsize=(UINT64)(4294967295), size_t el_blk_sz=DEFAULT_BUNDLE_SZ, size_t vp_blk_sz=DEFAULT_BUNDLE_SZ, size_t ep_blk_sz=DEFAULT_BUNDLE_SZ)
 IBM Multiporperty graph constructor. More...
 
virtual ~ibm_multiproperty_graph_generic ()
 IBM Multiprpoerty graph destructor. More...
 
bool vert_index_available (size_t propid) const
 This method indicates if the named index exists. Currently the index name is the name of the vertex property that would be indexed. At the moment this class does not support edge properties. More...
 
bool vert_index_available_we (size_t propid) const
 This method is like vert_index_available() but it will throw an out_of_range exception if the propid is beyond the highest index we're supporting. This will help the calling code to enumerate indices. More...
 
int index_find (int propid, const property_value_type &pval, vertexd_type &vid)
 This method allows the caller to find the vid of a vertex that has the given value on the given property. More...
 
int index_find_all (int propid, const property_value_type &pval, std::vector< vertexd_type > &vids)
 This method allows the caller to find all the vertices that have the given value on the given property. Warning: it will crash if there is no index. Check for that using the "available" method. More...
 
int find_all (int propid, const property_value_type &pval, std::vector< vertexd_type > &vids)
 This method allows the caller to find all the vertices that have the given value on the given property. This version will not die if the index doesn't exist. Instead it will slowly generate the response after printing a warning message. More...
 
void _index_insert (int propid, const property_value_type &pval, vertexd_type vid)
 This is a method that most people should not use. It's used internally to keep the index up to date. More...
 
void index_erasexx (int propid, const property_value_type &pval)
 This is a method that most people should not use. It's used internally to keep the index up to date. More...
 
void index_erase (int propid, const property_value_type &pval, vertexd_type vid)
 This is a method that most people should not use. It's used internally to keep the index up to date. More...
 
void index_erase (int propid, char const *pval, int pvallen, vertexd_type vid)
 
void add_index (const property_name_type &pname, bool is_multi=false)
 This method creates an index on the specified property and property value. More...
 
void set_esubproperty (edged_type eid, const property_name_type &pname, const property_value_type &value)
 This method adds a property to an edge. More...
 
void set_esubproperty (edged_type eid, const size_t propid, const property_value_type &value)
 This method adds a property to an edge. More...
 
void set_vsubproperty (vertexd_type vid, const property_name_type &pname, const property_value_type &value)
 Sets the specified property for the specified vertex to the specified string value. More...
 
void set_vsubproperty (vertexd_type vid, const size_t propid, const property_value_type &value)
 Sets the specified property for the specified vertex to the specified string value. More...
 
property_value_type get_vsubproperty (vertexd_type vid, const property_name_type &pname)
 Returns the specified property for the specified vertex. More...
 
property_value_type get_vsubproperty (vertexd_type vid, size_t propid)
 
size_t get_or_allocate_epropertyid (const property_name_type &pname)
 Maps a specified edge property-name to it's property-id. More...
 
size_t get_or_allocate_vpropertyid (const property_name_type &pname)
 Maps a specified vertex property-name to it's property-id. More...
 
size_t get_or_allocate_labelid (const label_string_type &labelstr)
 Maps a specified label name to it's label-id. More...
 
size_t get_or_allocate_vclassid (const vclass_string_type &vclassname)
 
bool get_labelid (const label_string_type &labelstr, size_t &retval)
 Maps a specified label name to it's label-id. More...
 
size_t get_labelid (const label_string_type &labelstr)
 Maps a specified label string to it's label-id. More...
 
bool get_vclassid (const vclass_string_type &vclassname, size_t &retval)
 
size_t get_vclassid (const vclass_string_type &vclassname)
 
size_t get_epropertyid (const property_name_type &pname)
 Maps a specified edge property-name to it's property-id. More...
 
string get_edge_property_name (const size_t propid) const
 Maps a specified edge property-id to it's property name. More...
 
int get_edge_property_count () const
 get the number or propertynames found edge in the graph. The caller can follow this up by calling get_property_name() from 0 .. ((returned value-1)) Values 0, 1... are reserved pseudo-properties, so the caller might chose to skip these and start with the CSVP_PROPERTIES_FIRST_NON_PSEUDO_PROPERTY property. More...
 
size_t get_vpropertyid (const property_name_type &pname)
 Maps a specified vertex property-name to it's property-id. More...
 
string get_vertex_property_name (const size_t propid) const
 Maps a specified vertex property-id to it's property value. More...
 
int get_vertex_property_count () const
 get the number or propertynames found vertices in the graph. The caller can follow this up by calling get_property_name() from 0 .. ((returned value-1)) Values 0, 1... are reserved pseudo-properties, so the caller might chose to skip these and start with the CSVP_PROPERTIES_FIRST_NON_PSEUDO_PROPERTY property. More...
 
string get_label_string (const size_t labelid) const
 Maps a specified label-id it's label string. More...
 
string get_vclassname (size_t vclassid)
 
string deprecated_get_vclassname_as_stdstring (size_t vclassid)
 
char const * get_external_id_as_cstr (size_t vid)
 
string deprecated_get_external_id_as_stdstring (size_t vid)
 
vertex_iterator find_vertex (vertexd_type vid)
 Finds the first vertex with a given vertex id. More...
 
vertex_iterator find_vertex (const property_name_type &pname, const property_value_type &pval)
 Finds the first vertex with a given property value. More...
 
edge_iterator find_edge (vertexd_type vid, edged_type eid)
 Finds the first edge for a given vertex with a given edge id. More...
 
vertex_iterator vertices_begin ()
 
vertex_iterator vertices_end ()
 
void delete_vertex (vertexd_type vid)
 Deletes specified vertex and adjacent edges. More...
 
void delete_vertex (char const *exid, int exidlen)
 
vertexd_type add_vertex (vertex_property &vp)
 Add a vertex to the graph. More...
 
vertexd_type add_vertex (size_t vclassid)
 Add a vertex to the graph. More...
 
vertexd_type add_vertex (size_t vclassid, char const *exid, int exidlen)
 add a vertex More...
 
vertexd_type add_vertexxxx (property_value_type &value)
 Add a vertex to the graph. More...
 
edged_type add_edge (vertexd_type vsource, vertexd_type vtarget, edge_property ep)
 Add an edge to the graph. More...
 
edged_type add_edge (vertexd_type vsource, vertexd_type vtarget, size_t lid)
 
edged_type add_edge (vertexd_type vsource, vertexd_type vtarget, std::string label)
 
edge_iterator add_edge_ref (vertexd_type vsource, vertexd_type vtarget, size_t lid)
 Add an edge to the graph. More...
 
edge_iterator add_edge_ref (vertexd_type vsource, vertexd_type vtarget, std::string label)
 Add an edge to the graph. More...
 
- Public Member Functions inherited from ibmppl::rdfGraph< tabular_multiproperty_type, tabular_multiproperty_type, ST >
 rdfGraph (const graph_config &gc=graph_config())
 
vertex_iterator vertices_begin ()
 
const_vertex_iterator vertices_begin () const
 
vertex_iterator vertices_begin (size_t lid)
 
vertex_iterator vertices_end ()
 
const_vertex_iterator vertices_end () const
 
vertex_iterator vertices_end (size_t lid)
 
edged_type add_edge (vertexd_type s, vertexd_type t, const edge_property &ep)
 
edge_iterator add_edge_ref (vertexd_type s, vertexd_type t, const edge_property &ep)
 

Protected Member Functions

size_t csv_nextCell (string &line, string sepr, string &ret, size_t pos=0)
 
bool csv_header_sanity_check (string &line, string &sep)
 
- Protected Member Functions inherited from ibmppl::ibm_multiproperty_graph_generic< HYBRID >
void _load_keys (std::string fn, std::map< std::string, vertexd_type > *vvec, std::vector< std::string > *revmap=0)
 Utility routine for reloading mappings between property-id's and property-name's. More...
 
void _load_keys ()
 Utility routine for reloading mappings between property-id's and property-name's. More...
 
void _save_keys (std::string fn, std::map< std::string, vertexd_type > *vvec)
 Utility routine for persisting mappings between property-id's and property-name's. More...
 
void _save_keys ()
 Utility routine for persisting mappings between property-id's and property-name's. More...
 
size_t _get_or_alloc_map (std::map< std::string, vertexd_type > *mapin, std::vector< std::string > *vecin, std::string keystring)
 Helper routine for get_or_allocXXXX() methods. More...
 
size_t _get_mapping (std::map< std::string, vertexd_type > *mapin, std::string keystring)
 Helper routine to help implement get_Xpropertyid() methods. More...
 

Protected Attributes

DIRECTNESS _directness
 
std::map< std::string, size_t > vertex_label_to_id
 
keymap_type key_to_id
 
rev_keymap_type id_to_key
 
- Protected Attributes inherited from ibmppl::ibm_multiproperty_graph_generic< HYBRID >
std::map< std::string, size_t > vpropname_to_id
 Maps a property name to a property id.
 
std::vector< std::string > id_to_vpropname
 Maps a property id to a property name(string)
 
std::map< std::string, size_t > epropname_to_id
 Similar as above for edges.
 
std::vector< std::string > id_to_epropname
 
std::vector< std::string > id_to_label
 Maps a label id to a label string.
 
std::map< std::string, size_t > label_to_id
 Maps a label string to a label id.
 
std::vector< std::string > vclassid_to_vclassname
 Maps a label id to a label string.
 
std::map< std::string, size_t > vclassname_to_vclassid
 Maps a label string to a label id.
 
std::string store_name
 
std::vector< index_type * > vert_indices
 
edge_iterator eitCached
 
edged_type eitCachedEid
 

Private Types

typedef
ibm_multiproperty_graph_generic
< HYBRID > 
base_type
 
typedef base_type::vertex_iterator base_vertex_iterator
 
typedef base_type::edge_iterator base_edge_iterator
 
typedef base_type::pred_iterator base_pred_iterator
 

Additional Inherited Members

- Protected Types inherited from ibmppl::ibm_multiproperty_graph_generic< HYBRID >
typedef index< size_t > index_type
 
typedef std::vector
< index_type * >::iterator 
index_iterator
 

Detailed Description

Generic Graph Class: a generic interface for directed/undirected graph.

Constructor & Destructor Documentation

ibmppl::ibm_generic_graph::ibm_generic_graph ( string  filename,
string  path,
DIRECTNESS  d = PRED_DIRECTED,
UINT64  max_memsize = 0 
)
inline

Generic graph constructor.

Parameters
filenamegraph name
pathpath of the graph store
dgraph directness
max_memsizemax mem usage of graph buffer

Member Function Documentation

edge_iterator ibmppl::ibm_generic_graph::add_edge_ref ( vertexd_type  vsource,
vertexd_type  vtarget,
std::string  label 
)
inline

add a new edge and return its reference

Parameters
vsourcesource vertex id (integer)
vtargettarget vertex id (integer)
labeledge label (string)
Returns
edge_iterator of the new edge
vertexd_type ibmppl::ibm_generic_graph::add_vertex ( std::string  label)
inline

add new vertex

Parameters
labelvertex label (string)
Returns
internal vertex id (integer)
vertexd_type ibmppl::ibm_generic_graph::add_vertex ( std::string  label,
const std::string &  external_id 
)
inline

add new vertex with given external id

Parameters
labelvertex label (string)
external_idexternal id (string)
Returns
internal vertex id (integer)
long int ibmppl::ibm_generic_graph::batch_load_csv_edges ( string  filename,
bool  has_header,
string  separators,
size_t  srcpos,
size_t  targpos,
string  global_label,
size_t  labelpos,
string  default_vertex_label = "na",
size_t  batch_size = 60000000,
bool *  loop_ctrl = NULL 
)
inline

load edges from a csv file. if the vertex doesn't exist in the graph, it will be added with default_vertex_label

Parameters
filenamecsv file name
has_headerif csv file has header
separatorsseparators used in the csv file
srcposcolumn # of source vertex id (starting from 0)
targposcolumn # of target vertex id (starting from 0)
global_labelif not empty, set all vertices to this label
labelposif global_label is empty, get label from csv file according to this column #.
default_vertex_labeldefault lable of newly added vertices
batch_sizebatch size. a batch flush would happen when the given size is reached.
loop_ctrlpointer to a bool controlling variable. if not NULL, setting the controlling variable to false can break the loading process
Returns
long int: if sucess, return number of processed edges. Otherwise, return -1.
long int ibmppl::ibm_generic_graph::batch_load_csv_vertices ( string  filename,
bool  has_header,
string  separators,
size_t  keypos,
string  global_label,
size_t  labelpos,
size_t  batch_size = 60000000,
bool *  loop_ctrl = NULL,
bool  boolAddNOverwriteProperties = false 
)
inline

load vertices from a csv file in batch mode.

Parameters
filenamecsv file name
has_headerif csv file has header
separatorsseparators used in the csv file
keyposcolumn # of external vertex id (starting from 0)
global_labelif not empty, set all vertices to this label
labelposif global_label is empty, get label from csv file according to this column #.
batch_sizebatch size. a batch flush would happen when the given size is reached.
loop_ctrlpointer to a bool controlling variable. if not NULL, setting the controlling variable to false can break the loading process
booAddNOverwritePropertiesspecifies if a vertex redefinition should be handled. 1 means the properties of the new definition will overwrite or supplement the properties already associated with the vertex. 0 means that the redefinition is ignored, which should cause faster performance. Additional values could be added in future versions of this code.
Returns
long int: if sucess, return number of processed vertices. Otherwise, return -1.
void ibmppl::ibm_generic_graph::delete_vertex ( const std::string &  external_id)
inline

delete vertex with given external id

Parameters
external_idexternal id (string)
void ibmppl::ibm_generic_graph::delete_vertex ( vertexd_type  vid)
inline

delete vertex with given internal id

Parameters
vidinternal vertex id (integer)
edge_iterator ibmppl::ibm_generic_graph::find_edge ( vertexd_type  vid,
edged_type  eid 
)
inline

find edge with given vertex id and edge id

Parameters
vidvertex id (integer)
eidedge_id (integer)
Returns
edge_iterator
bool ibmppl::ibm_generic_graph::find_edge ( vertexd_type  vid,
edged_type  eid,
edge_iterator ret 
)
inline

find edge with given vertex id and edge id

Parameters
vidvertex id (integer)
eidedge_id (integer)
reta reference of the edge_iterator
Returns
bool: true if found
void ibmppl::ibm_generic_graph::find_edge ( const string &  src,
const string &  targ,
std::vector< edge_iterator > &  ret 
)
inline

find edge with given source and target vertex id

Parameters
srcsource vertex id (string)
targtarget vertex id (string)
retvector of found edges
void ibmppl::ibm_generic_graph::find_edge ( vertexd_type  vid,
vertexd_type  targ,
std::vector< edge_iterator > &  ret 
)
inline

find edge with given source and target vertex id

Parameters
vidsource vertex id (integer)
targtarget vertex id (integer)
retvector of found edges
vertex_iterator ibmppl::ibm_generic_graph::find_vertex ( size_t  vid)
inline

find vertex with given internal vertex id

Parameters
vidinternal vertex id (integer)
Returns
vertex_iterator
vertex_iterator ibmppl::ibm_generic_graph::find_vertex ( const string &  external_id)
inline

find vertex with given external vertex id

Parameters
external_idexternal vertex id (string)
Returns
vertex_iterator
DIRECTNESS ibmppl::ibm_generic_graph::get_directness ( void  )
inline

get graph directness

Returns
enum DIRECTNESS: DIRECTED|PRED_DIRECTED|UNDIRECTED
string ibmppl::ibm_generic_graph::get_external_id ( size_t  vid)
inline

found the corresponding external id

Parameters
vidinternal vertex id
Returns
string: external id. returning empty string if not found
bool ibmppl::ibm_generic_graph::get_internal_id ( const string &  external_id,
size_t &  vid 
)
inline

found the corresponding internal id

Parameters
external_idexternal vertex id (string)
vidreference of internal id
Returns
bool: true if found
bool ibmppl::ibm_generic_graph::is_directed ( void  )
inline

check if graph is directed

Returns
bool: true if the graph is directed
bool ibmppl::ibm_generic_graph::is_undirected ( void  )
inline

check if graph is undirected

Returns
bool: true if the graph is undirected
long int ibmppl::ibm_generic_graph::load_csv_edges ( string  filename,
bool  has_header,
string  separators,
size_t  srcpos,
size_t  targpos,
string  global_label,
size_t  labelpos,
string  default_vertex_label = "na",
bool *  loop_ctrl = NULL 
)
inline

load edges from a csv file. if the vertex doesn't exist in the graph, it will be added with default_vertex_label

Parameters
filenamecsv file name
has_headerif csv file has header
separatorsseparators used in the csv file
srcposcolumn # of source vertex id (starting from 0)
targposcolumn # of target vertex id (starting from 0)
global_labelif not empty, set all vertices to this label
labelposif global_label is empty, get label from csv file according to this column #.
default_vertex_labeldefault lable of newly added vertices
loop_ctrlpointer to a bool controlling variable. if not NULL, setting the controlling variable to false can break the loading process
Returns
long int: if sucess, return number of processed edges. Otherwise, return -1.
long int ibmppl::ibm_generic_graph::load_csv_vertices ( string  filename,
bool  has_header,
string  separators,
size_t  keypos,
string  global_label,
size_t  labelpos,
bool *  loop_ctrl = NULL 
)
inline

load vertices from a csv file into graph. If the vertex already exists in graph, its property will be updated.

Parameters
filenamecsv file name
has_headerif csv file has header
separatorsseparators used in the csv file
keyposcolumn # of external vertex id (starting from 0)
global_labelif not empty, set all vertices to this label
labelposif global_label is empty, get label from csv file according to this column #.
loop_ctrlpointer to a bool controlling variable. if not NULL, setting the controlling variable to false can break the loading process
Returns
long int: if sucess, return number of processed vertices. Otherwise, return -1.
size_t ibmppl::ibm_generic_graph::num_edges ( void  )
inline

get number of edges in the graph

Returns
size_t: edge number
size_t ibmppl::ibm_generic_graph::num_vertices ( void  )
inline

get number of vertices in the graph

Returns
size_t: vertex number
vertex_iterator ibmppl::ibm_generic_graph::vertices_begin ( )
inline

returning the iterator pointing to the head element of the graph

Returns
vertex_iterator
fast_vertex_iterator ibmppl::ibm_generic_graph::vertices_begin_fast ( )
inline

returning the fast vertex iterator pointing to the head element of the graph

Returns
fast_vertex_iterator
vertex_iterator ibmppl::ibm_generic_graph::vertices_end ( )
inline

returning the iterator pointing to the tail element of the graph

Returns
vertex_iterator
fast_vertex_iterator ibmppl::ibm_generic_graph::vertices_end_fast ( )
inline

returning the fast vertex iterator pointing to the tail element of the graph

Returns
fast_vertex_iterator

The documentation for this class was generated from the following file: