GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
graphlab Namespace Reference

Namespaces

namespace  random

Classes

class  async_consistent_engine
 The asynchronous consistent engine executed vertex programs asynchronously but ensures mutual exclusion such that adjacent vertices are never executed simultaneously. Mutual exclusion can be weakened to "factorized" consistency in which case only individual gathers/applys/ scatters are guaranteed to be consistent. More...
struct  execution_status
 the reasons for execution completion. More...
class  iengine
 The abstract interface of a GraphLab engine. More...
class  omni_engine
 The omni engine encapsulates all the GraphLab engines allowing the user to select which engine to use at runtime. More...
class  semi_synchronous_engine
 The semi synchronous engine executes a fraction of all active vertex program synchronously in a sequence of super-step (iterations) in both the shared and distributed memory settings. More...
class  synchronous_engine
 The synchronous engine executes all active vertex program synchronously in a sequence of super-step (iterations) in both the shared and distributed memory settings. More...
class  distributed_graph
 A directed graph datastructure which is distributed across multiple machines. More...
class  graph_vertex_join
 Provides the ability to pass information between vertices of two different graphs. More...
class  distributed_constrained_oblivious_ingress
 Ingress object assigning edges using randoming hash function. More...
class  distributed_constrained_random_ingress
 Ingress object assigning edges using randoming hash function. More...
class  distributed_identity_ingress
 Ingress object assigning edges to the loading machine itself. More...
class  distributed_oblivious_ingress
 Ingress object assigning edges using randoming hash function. More...
class  distributed_random_ingress
 Ingress object assigning edges using randoming hash function. More...
class  idistributed_ingress
 The ingress object handles the graph ingress. More...
class  vertex_set
 Describes a set of vertices. More...
class  java_any
class  proxy_aggregator
class  jni_core
class  proxy_edge
class  proxy_vertex
class  proxy_updater
class  command_line_options
 The GraphLab command line options class helps parse basic command line options for the GraphLab framework as well as user applications. More...
class  graphlab_options
class  options_map
class  atomic_add_vector
class  atomic_add_vector2
struct  cache_line_pad
class  lockfree_push_back
class  mutex
class  simple_spinlock
class  conditional
class  semaphore
class  spinrwlock
class  rwlock
class  cancellable_barrier
class  thread
class  thread_group
struct  padded_integer
 an integer value padded to 64 bytes More...
class  queued_rw_lock
class  thread_pool
class  async_consensus
 This implements a distributed consensus algorithm which waits for global completion of all computation/RPC events on a given object. More...
struct  circular_char_buffer_source
struct  circular_char_buffer_sink
class  coherent_dht
struct  dc_init_param
 Distributed control constructor parameters. More...
class  distributed_control
 The distributed control object is primary means of communication between the distributed GraphLab processes. More...
class  dc_dist_object
 Provides a class with its own distributed communication context, allowing instances of the class to communicate with other remote instances. More...
class  dht
struct  log_entry
 A single entry in time. More...
struct  log_group
 Logging information for a particular log entry (say #updates) More...
struct  event_log_thread_local_type
struct  request_future
class  fifo_scheduler
struct  sched_status
class  ischeduler
class  queued_fifo_scheduler
struct  scheduler_factory
class  iarchive
 The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities. More...
class  iarchive_soft_fail
 When this archive is used to deserialize an object, and the object does not support serialization, failure will only occur at runtime. Otherwise equivalent to graphlab::iarchive. More...
struct  IS_POD_TYPE
 Inheriting from this type will force the serializer to treat the derived type as a POD type. More...
struct  gl_is_pod
 Tests if T is a POD type. More...
class  oarchive
 The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities. More...
class  oarchive_soft_fail
 When this archive is used to serialize an object, and the object does not support serialization, failure will only occur at runtime. Otherwise equivalent to graphlab::oarchive. More...
class  Serializable
 Concept checks if a type T is serializable. More...
struct  unsupported_serialize
 Inheritting from this class will prevent the serialization of the derived class. Used for debugging purposes. More...
class  binary_input_stream
class  binary_output_stream
class  blocking_queue
 Implements a blocking queue useful for producer/consumer models. More...
struct  char_counting_sink
class  cuckoo_map
class  cuckoo_map_pow2
class  cuckoo_set_pow2
class  dense_bitset
class  fixed_dense_bitset
class  any
class  blob
struct  test_function_or_functor_1
 This tests that a type F matches a specification for a function type or implements a specification for a functor type. More...
struct  test_function_or_const_functor_1
 This tests that a type F matches a specification for a function type or implements a specification for a functor type. More...
struct  test_function_or_functor_2
 This tests that a type F matches a specification for a function type or implements a specification for a functor type. More...
struct  test_function_or_const_functor_2
 This tests that a type F matches a specification for a function type or implements a specification for a functor type. More...
class  identity_hash
class  hopscotch_map
class  hopscotch_set
class  hopscotch_table
class  mutable_queue
class  resizing_array_sink_ref
class  safe_circular_char_buffer
class  small_set
class  timer
 A simple class that can be used for benchmarking/timing up to microsecond resolution. More...
union  gl_uint128_t
class  context
 The context object mediates the interaction between the vertex program and the graphlab execution environment and implements the icontext interface. More...
class  icontext
 The context object mediates the interaction between the vertex program and the graphlab execution environment. More...
class  ivertex_program
 The ivertex_program class defines the vertex program interface that all vertex programs should extend and implement. The vertex-program is used to encode the user-define computation in a GraphLab program. More...
class  OpPlusEq
 Concept checks if a type T supports operator+=. More...

Typedefs

typedef uint32_t vertex_id_type
 Identifier type of a vertex which is globally consistent. Guaranteed to be integral.
typedef vertex_id_type lvid_type
 Identifier type of a vertex which is only locally consistent. Guaranteed to be integral.
typedef lvid_type edge_id_type
typedef graph< proxy_vertex,
proxy_edge
proxy_graph
typedef mutex spinlock
 if spinlock not supported, it is typedef it to a mutex.
typedef cancellable_barrier barrier
typedef uint16_t procid_t
 The type used for numbering processors.
typedef boost::function
< std::pair< std::string,
std::string >std::map
< std::string, std::string > &)> 
http_redirect_callback_type
typedef
boost::iostreams::stream
< charstream_impl::resizing_array_sink
< true > > 
charstream
typedef
charstream_impl::resizing_array_sink
< false > 
resizing_array_sink

Enumerations

enum  edge_dir_type { NO_EDGES = 0, IN_EDGES = 1, OUT_EDGES = 2, ALL_EDGES = 3 }
 The set of edges that are traversed during gather and scatter operations. More...
enum  dc_comm_type { TCP_COMM, SCTP_COMM }

Functions

template<typename VertexData , typename EdgeData >
std::ostream & operator<< (std::ostream &out, const local_graph< VertexData, EdgeData > &local_graph)
std::ostream & operator<< (std::ostream &out, const graphlab::options_map &opts)
template<typename T >
bool atomic_compare_and_swap (T &a, T oldval, T newval)
template<typename T >
bool atomic_compare_and_swap (volatile T &a, T oldval, T newval)
template<>
bool atomic_compare_and_swap (volatile double &a, double oldval, double newval)
template<>
bool atomic_compare_and_swap (volatile float &a, float oldval, float newval)
template<typename T >
void atomic_exchange (T &a, T &b)
 Atomically exchanges the values of a and b.
template<typename T >
void atomic_exchange (volatile T &a, T &b)
 Atomically exchanges the values of a and b.
template<typename T >
fetch_and_store (T &a, const T &newval)
 Atomically sets a to the newval, returning the old value.
void destroy_tls_data (void *ptr)
thread::tls_datacreate_tls_data (size_t thread_id=0)
void prefetch_range (void *addr, size_t len)
void prefetch_range_write (void *addr, size_t len)
thread launch_in_new_thread (const boost::function< void(void)> &f, size_t cpuid=size_t(-1))
 Runs f in a new thread. convenience function for creating a new thread quickly.
bool init_param_from_env (dc_init_param &param)
bool init_param_from_mpi (dc_init_param &param, dc_comm_type commtype)
distributed_event_logger & get_event_log ()
void reply_increment_counter (distributed_control &dc, procid_t src, size_t ptr, dc_impl::blob ret)
void stored_increment_counter (distributed_control &dc, procid_t src, size_t ptr, dc_impl::blob ret)
std::vector< std::string > get_scheduler_names ()
 get all the scheduler names
std::string get_scheduler_names_str ()
 get all the scheduler names concated into a string
void print_scheduler_info (std::string s, std::ostream &out)
 Display the scheduler options for a particular scheduler.
template<typename OutArcType , typename RandomAccessIterator >
void serialize_iterator (OutArcType &oarc, RandomAccessIterator begin, RandomAccessIterator end)
 Serializes the contents between the iterators begin and end.
template<typename OutArcType , typename InputIterator >
void serialize_iterator (OutArcType &oarc, InputIterator begin, InputIterator end, size_t vsize)
 Serializes the contents between the iterators begin and end.
template<typename InArcType , typename T , typename OutputIterator >
void deserialize_iterator (InArcType &iarc, OutputIterator result)
 The accompanying function to serialize_iterator() Reads elements from the stream and writes it to the output iterator.
template<typename T >
std::string serialize_to_string (const T &t)
 Serializes a object to a string.
template<typename T >
void deserialize_from_string (const std::string &s, T &t)
 Deserializes a object from a string.
std::pair< std::string,
std::string > 
four_oh_four (std::map< std::string, std::string > &varmap)
std::pair< std::string,
std::string > 
echo (std::map< std::string, std::string > &varmap)
std::pair< std::string,
std::string > 
index_page (std::map< std::string, std::string > &varmap)
void add_metric_server_callback (std::string page, http_redirect_callback_type callback)
 This is used to map a URL on the mtrics server to a processing function.
void launch_metric_server ()
 Starts the metrics reporting server.
void stop_metric_server ()
 Stops the metrics reporting server if one is started.
void stop_metric_server_on_eof ()
 Waits for a ctrl-D on machine 0, and stops the metrics reporting server if one is started.
template<typename Target , typename Source >
boost::disable_if_c
< boost::is_convertible
< Source, Target >::value,
Target >::type 
robust_cast (const Source &h)
template<typename Iterator , typename sizetype >
void inplace_shuffle (Iterator begin, Iterator end, std::vector< sizetype > &targets)
template<typename Container , typename sizetype >
void outofplace_shuffle (Container &c, const std::vector< sizetype > &targets)
uint32_t integer_mix (uint32_t a)
bool str_to_ip (const char *c, uint32_t &out)
bool ip_to_str (uint32_t ip, std::string &out)
std::string get_local_ip_as_str (bool print)
uint32_t get_local_ip (bool print)
std::pair< size_t, int > get_free_tcp_port ()
template<size_t MAX_DIM, typename KeyT , typename ValueT >
std::ostream & operator<< (std::ostream &out, const graphlab::small_map< MAX_DIM, KeyT, ValueT > &map)
template<size_t MAX_DIM, typename T >
std::ostream & operator<< (std::ostream &out, const graphlab::small_set< MAX_DIM, T > &set)
template<typename T >
std::set< T > set_union (const std::set< T > &a, const std::set< T > &b)
template<typename T >
std::set< T > set_union (const std::set< T > &a, const T &b)
template<typename T >
std::set< T > set_intersect (const std::set< T > &a, const std::set< T > &b)
template<typename T >
std::set< T > set_difference (const std::set< T > &a, const std::set< T > &b)
template<typename T >
std::set< T > set_difference (const std::set< T > &a, const T &b)
template<typename T >
std::pair< std::set< T >
, std::set< T > > 
set_partition (const std::set< T > &s, const std::set< T > &partition)
template<typename T >
bool set_disjoint (const std::set< T > &a, const std::set< T > &b)
template<typename T >
bool set_equal (const std::set< T > &a, const std::set< T > &b)
template<typename T >
bool includes (const std::set< T > &a, const std::set< T > &b)
template<typename T >
bool is_subset (const std::set< T > &a, const std::set< T > &b)
template<typename T >
bool is_superset (const std::set< T > &a, const std::set< T > &b)
template<typename T >
std::ostream & operator<< (std::ostream &out, const std::set< T > &s)
 Writes a human representation of the set to the supplied stream.
template<typename Key , typename T >
const T & safe_get (const std::map< Key, T > &map, const Key &key)
template<typename Key , typename T >
const T safe_get (const std::map< Key, T > &map, const Key &key, const T default_value)
template<typename OldKey , typename NewKey , typename T >
std::map< NewKey, T > rekey (const std::map< OldKey, T > &map, const std::map< OldKey, NewKey > &key_map)
template<typename Key , typename OldT , typename NewT >
std::map< Key, NewT > remap (const std::map< Key, OldT > &map, const std::map< OldT, NewT > &val_map)
template<typename Key , typename T >
void remap (std::map< Key, T > &map, const std::map< T, T > &val_map)
template<typename Key , typename T >
std::map< Key, T > map_union (const std::map< Key, T > &a, const std::map< Key, T > &b)
template<typename Key , typename T >
std::map< Key, T > map_intersect (const std::map< Key, T > &a, const std::map< Key, T > &b)
template<typename Key , typename T >
std::map< Key, T > map_intersect (const std::map< Key, T > &m, const std::set< Key > &keys)
template<typename Key , typename T >
std::map< Key, T > map_difference (const std::map< Key, T > &a, const std::map< Key, T > &b)
template<typename Key , typename T >
std::set< Key > keys (const std::map< Key, T > &map)
template<typename Key , typename T >
std::vector< Key > keys_as_vector (const std::map< Key, T > &map)
template<typename Key , typename T >
std::set< T > values (const std::map< Key, T > &map)
template<typename Key , typename T >
std::vector< T > values (const std::map< Key, T > &m, const std::set< Key > &keys)
template<typename Key , typename T >
std::vector< T > values (const std::map< Key, T > &m, const std::vector< Key > &keys)
template<typename Key >
std::map< Key, Key > make_identity_map (const std::set< Key > &keys)
 Creates an identity map (a map from elements to themselves)
template<typename Key , typename T >
std::ostream & operator<< (std::ostream &out, const std::map< Key, T > &m)
 Writes a map to the supplied stream.
std::string trim (const std::string &str)
template<typename T >
std::string tostr (const T &t)
template<typename T >
fromstr (const std::string &str)
std::string pad_number (const size_t number, const size_t npad, const char pad_value= '0')
std::vector< std::string > strsplit (const std::string &str, const std::string &splitchars, const bool auto_trim=false)
void alarm_wakeup (int i)
unsigned long long estimate_ticks_per_second ()
gl_uint128_t fill_128b ()
std::ostream & operator<< (std::ostream &out, const gl_uint128_t &val)

Variables

void(* __thr_callback )() = NULL
const unsigned char STANDARD_CALL = 1
const unsigned char WAIT_FOR_REPLY = 4
const unsigned char CONTROL_PACKET = 16
const unsigned char REPLY_PACKET = 32
const unsigned char POD_CALL = 64
const size_t MAX_LOG_SIZE = 256
const size_t MAX_LOG_THREADS = 1024
const double TICK_FREQUENCY = 0.5
const double RECORD_FREQUENCY = 5.0
hundredms_timer hmstimer

Detailed Description

Copyright (c) 2009 Carnegie Mellon University. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

For more about this software visit:

 http://www.graphlab.ml.cmu.edu

Copyright (c) 2009 Carnegie Mellon University. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS
IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.  See the License for the specific language
governing permissions and limitations under the License.

For more about this software visit:

 http://www.graphlab.ml.cmu.edu

Also contains code that is Copyright 2011 Yahoo! Inc. All rights reserved.

Contributed under the iCLA for: Joseph Gonzalez (jegon.nosp@m.zal@.nosp@m.yahoo.nosp@m.-inc.nosp@m..com)

Copyright (c) 2011 Carnegie Mellon University. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

For more about this software visit:

 http://www.graphlab.ml.cmu.edu

Copyright (c) 2009 Carnegie Mellon University. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS
IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.  See the License for the specific language
governing permissions and limitations under the License.

For more about this software visit:

 http://www.graphlab.ml.cmu.edu

This class defines the dependencies among the shards when using a constrained partitioning algorithm.

In constrained partitioning, vertices are assgined to a master shard using hash function on the vids. Each shard S masters a partition of vertices: V_s.

Let Ai be the set of shards that Shard i depends on. Then the partitioning algorithm can only put edges with either ends in V_si into Ai. For example, Shard i is the master of vertex u, and Shard j is the master of vertex v, then edge u->v must be placed into Ai Aj.

This class currently has two implementations of the shard constraints. One construction is based on a grid, and the other is based on perfect difference set. Both algorithms guarentees that Ai Aj is non-empty.

Note:
: grid methods requires the number of shards to be a perfect square number. pds requires the number of shards to be p^2 + p + 1 where p is a prime number.

Copyright (c) 2009 Carnegie Mellon University. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS
IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.  See the License for the specific language
governing permissions and limitations under the License.

For more about this software visit:

 http://www.graphlab.ml.cmu.edu
Author:
jegonzal This class defines a multiqueue version of the priority scheduler.

Copyright (c) 2009 Carnegie Mellon University. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

For more about this software visit:

 http://www.graphlab.ml.cmu.edu

Also contains code that is Copyright 2011 Yahoo! Inc. All rights reserved.


Typedef Documentation

Identifier type of an edge which is only locally consistent. Guaranteed to be integral and consecutive.

Definition at line 49 of file graph_basic_types.hpp.

Proxy graph

Definition at line 66 of file org_graphlab_Updater.hpp.


Enumeration Type Documentation

Enumerator:
TCP_COMM 

TCP/IP.

SCTP_COMM 

SCTP (limited support)

Definition at line 37 of file dc_types.hpp.

The set of edges that are traversed during gather and scatter operations.

Enumerator:
NO_EDGES 

No edges implies that no edges are processed during the corresponding gather or scatter phase, essentially skipping that phase.

IN_EDGES 

In edges implies that only whose target is the center vertex are processed during gather or scatter.

OUT_EDGES 

Out edges implies that only whose source is the center vertex are processed during gather or scatter.

ALL_EDGES 

All edges implies that all adges adjacent to a the center vertex are processed on gather or scatter. Note that some neighbors may be encountered twice if there is both an in and out edge to that neighbor.

Definition at line 55 of file graph_basic_types.hpp.


Function Documentation

thread::tls_data* graphlab::create_tls_data ( size_t  thread_id = 0)

Create thread specific data

Definition at line 64 of file pthread_tools.cpp.

void graphlab::destroy_tls_data ( void *  ptr)

Create thread specific data

Definition at line 97 of file pthread_tools.cpp.

gl_uint128_t graphlab::fill_128b ( )
inline

Sets all 128bits of the the gl_uint128_t to 'true'. Or the 128-bit integer representation of "-1"

Definition at line 61 of file uint128.hpp.

template<typename T >
T graphlab::fromstr ( const std::string &  str)

Convenience function for using std streams to convert a string to anything

Definition at line 406 of file stl_util.hpp.

template<typename Iterator , typename sizetype >
void graphlab::inplace_shuffle ( Iterator  begin,
Iterator  end,
std::vector< sizetype > &  targets 
)

Shuffles a random access container inplace such at newcont[i] = cont[targets[i]] targets must be the same size as the container Both the container and the targets vector will be modified.

Definition at line 45 of file shuffle.hpp.

template<typename T >
bool graphlab::is_subset ( const std::set< T > &  a,
const std::set< T > &  b 
)

Returns true if $a b$

Definition at line 141 of file stl_util.hpp.

template<typename Key , typename T >
std::set<Key> graphlab::keys ( const std::map< Key, T > &  map)

Returns the set of keys in a map

Definition at line 302 of file stl_util.hpp.

template<typename Key , typename T >
std::vector<Key> graphlab::keys_as_vector ( const std::map< Key, T > &  map)

Get teh set of keys in a map as a vector

Definition at line 315 of file stl_util.hpp.

template<typename Key , typename T >
std::map<Key, T> graphlab::map_difference ( const std::map< Key, T > &  a,
const std::map< Key, T > &  b 
)

Computes the difference between two maps

Definition at line 285 of file stl_util.hpp.

template<typename Key , typename T >
std::map<Key, T> graphlab::map_intersect ( const std::map< Key, T > &  a,
const std::map< Key, T > &  b 
)

Computes the intersection of two maps

Definition at line 252 of file stl_util.hpp.

template<typename Key , typename T >
std::map<Key, T> graphlab::map_intersect ( const std::map< Key, T > &  m,
const std::set< Key > &  keys 
)

Returns the entries of a map whose keys show up in the set keys

Definition at line 269 of file stl_util.hpp.

template<typename Key , typename T >
std::map<Key, T> graphlab::map_union ( const std::map< Key, T > &  a,
const std::map< Key, T > &  b 
)

Computes the union of two maps

Definition at line 236 of file stl_util.hpp.

std::ostream& graphlab::operator<< ( std::ostream &  out,
const gl_uint128_t &  val 
)
inline

Prints the 128-bit integer as hexadecimal

Definition at line 71 of file uint128.hpp.

template<typename Container , typename sizetype >
void graphlab::outofplace_shuffle ( Container &  c,
const std::vector< sizetype > &  targets 
)

Shuffles a random access container inplace such at newcont[i] = cont[targets[i]] targets must be the same size as the container

Definition at line 80 of file shuffle.hpp.

std::string graphlab::pad_number ( const size_t  number,
const size_t  npad,
const char  pad_value = '0' 
)
inline

Returns a string representation of the number, padded to 'npad' characters using the pad_value character

Definition at line 418 of file stl_util.hpp.

template<typename OldKey , typename NewKey , typename T >
std::map<NewKey, T> graphlab::rekey ( const std::map< OldKey, T > &  map,
const std::map< OldKey, NewKey > &  key_map 
)

Transform each key in the map using the key_map transformation. The resulting map will have the form output[key_map[i]] = map[i]

Definition at line 192 of file stl_util.hpp.

template<typename Key , typename OldT , typename NewT >
std::map<Key, NewT> graphlab::remap ( const std::map< Key, OldT > &  map,
const std::map< OldT, NewT > &  val_map 
)

Transform each key in the map using the key_map transformation. The resulting map will have the form output[i] = remap[map[i]]

Definition at line 209 of file stl_util.hpp.

template<typename Key , typename T >
void graphlab::remap ( std::map< Key, T > &  map,
const std::map< T, T > &  val_map 
)

Inplace version of remap

Definition at line 223 of file stl_util.hpp.

template<typename Target , typename Source >
boost::enable_if_c< boost::is_convertible< Source, Target >::value, Target >::type graphlab::robust_cast ( const Source &  h)

robust_cast performs a static cast from type A to type B if a cast can be done. Return B() otherwise

Definition at line 36 of file robust_cast.hpp.

template<typename Key , typename T >
const T& graphlab::safe_get ( const std::map< Key, T > &  map,
const Key &  key 
)

constant lookup in a map. assertion failure of key not found in map

Definition at line 163 of file stl_util.hpp.

template<typename Key , typename T >
const T graphlab::safe_get ( const std::map< Key, T > &  map,
const Key &  key,
const T  default_value 
)

constant lookup in a map. If key is not found in map, 'default_value' is returned. Note that this can't return a reference and must return a copy

Definition at line 177 of file stl_util.hpp.

template<typename T >
std::pair<std::set<T>,std::set<T> > graphlab::set_partition ( const std::set< T > &  s,
const std::set< T > &  partition 
)
Returns:
2 sets: <s in partition, s not in partition>

Definition at line 114 of file stl_util.hpp.

template<typename T >
std::set<T> graphlab::set_union ( const std::set< T > &  a,
const std::set< T > &  b 
)

computes the union of two sets.

Definition at line 70 of file stl_util.hpp.

std::vector<std::string> graphlab::strsplit ( const std::string &  str,
const std::string &  splitchars,
const bool  auto_trim = false 
)
inline

Using splitchars as delimiters, splits the string into a vector of strings. if auto_trim is true, trim() is called on all the extracted strings before returning.

Definition at line 442 of file stl_util.hpp.

template<typename T >
std::string graphlab::tostr ( const T &  t)

Convenience function for using std streams to convert anything to a string

Definition at line 396 of file stl_util.hpp.

std::string graphlab::trim ( const std::string &  str)
inline

Removes white space (space and tabs) from the beginning and end of str, returning the resultant string

Definition at line 385 of file stl_util.hpp.

template<typename Key , typename T >
std::set<T> graphlab::values ( const std::map< Key, T > &  map)

Gets the values from a map

Definition at line 330 of file stl_util.hpp.


Variable Documentation

void(* graphlab::__thr_callback)() = NULL

Allow defining a callback when thread is destroyed. This is needed at least from Java JNI, where we have to detach thread from JVM before it dies.

Definition at line 181 of file pthread_tools.cpp.