Пример #1
0
inline void
stinger_vertex_to_json(const stinger_vertices_t * vertices, stinger_physmap_t * phys, vindex_t v, FILE * out, int64_t indent_level) {
  const stinger_vertex_t * vout = VTX(v);

  JSON_INIT(out, indent_level);
  JSON_OBJECT_START_UNLABELED();
  JSON_INT64(vid, v);
  JSON_VTYPE(vtype, vout->type);
  JSON_VWEIGHT(vweight, vout->weight);
  JSON_INT64(inDegree, vout->inDegree);
  JSON_INT64(outDegree, vout->outDegree);
  JSON_SUBOBJECT(physID);
  stinger_physmap_id_to_json(phys, v, out, indent_level+1);
#if defined(STINGER_VERTEX_KEY_VALUE_STORE)
  /* TODO attributes */
#endif
  JSON_OBJECT_END();
  JSON_END();
}
Пример #2
0
inline void
stinger_vertex_to_json_with_type_strings(const stinger_vertices_t * vertices, const stinger_names_t * tn, stinger_physmap_t * phys, vindex_t v, FILE * out, int64_t indent_level) {
  const stinger_vertex_t * vout = VTX(v);

  JSON_INIT(out, indent_level);
  JSON_OBJECT_START_UNLABELED();
  JSON_INT64(vid, v);
  char * vtype = stinger_names_lookup_name(tn,vout->type);
  if(vtype) {
    JSON_STRING(vtype, vtype);
  } else {
    JSON_INT64(vtype, vout->type);
  }
  JSON_VWEIGHT(vweight, vout->weight);
  JSON_INT64(inDegree, vout->inDegree);
  JSON_INT64(outDegree, vout->outDegree);
  JSON_SUBOBJECT(physID);
  stinger_physmap_id_to_json(phys, v, out, indent_level+1);
#if defined(STINGER_VERTEX_KEY_VALUE_STORE)
  /* TODO attributes */
#endif
  JSON_OBJECT_END();
  JSON_END();
}
Пример #3
0
inline vweight_t
stinger_vertex_weight_increment(const stinger_vertices_t * vertices, vindex_t v, vweight_t weight)
{
  return stinger_vweight_fetch_add(&(VTX(v)->weight), weight);
}
Пример #4
0
inline vweight_t
stinger_vertex_weight_get(const stinger_vertices_t * vertices, vindex_t v)
{
  return VTX(v)->weight;
}
Пример #5
0
inline vweight_t
stinger_vertex_weight_set(const stinger_vertices_t * vertices, vindex_t v, vweight_t weight)
{
  return (VTX(v)->weight = weight);
}
Пример #6
0
inline vtype_t
stinger_vertex_type_get(const stinger_vertices_t * vertices, vindex_t v)
{
  return VTX(v)->type;
}
Пример #7
0
inline vtype_t
stinger_vertex_type_set(const stinger_vertices_t * vertices, vindex_t v, vtype_t type)
{
  return (VTX(v)->type = type);
}
Пример #8
0
inline adjacency_t
stinger_vertex_edges_get_and_lock(const stinger_vertices_t * vertices, vindex_t v)
{
  return readfe(&(VTX(v)->edges));
}
Пример #9
0
inline adjacency_t
stinger_vertex_edges_set(const stinger_vertices_t * vertices, vindex_t v, adjacency_t edges)
{
  return (VTX(v)->edges = edges);
}
Пример #10
0
inline adjacency_t *
stinger_vertex_edges_pointer_get(const stinger_vertices_t * vertices, vindex_t v)
{
  return &(VTX(v)->edges);
}
Пример #11
0
inline vdegree_t
stinger_vertex_outdegree_increment_atomic(const stinger_vertices_t * vertices, vindex_t v, vdegree_t degree)
{
  return stinger_vdegree_fetch_add_atomic(&(VTX(v)->outDegree), degree);
}
Пример #12
0
inline vdegree_t
stinger_vertex_outdegree_increment(const stinger_vertices_t * vertices, vindex_t v, vdegree_t degree)
{
  return (VTX(v)->outDegree += degree);
}
Пример #13
0
inline vdegree_t
stinger_vertex_outdegree_get(const stinger_vertices_t * vertices, vindex_t v)
{
  return VTX(v)->outDegree;
}
Пример #14
0
inline vdegree_t
stinger_vertex_indegree_set(const stinger_vertices_t * vertices, vindex_t v, vdegree_t degree)
{
  return (VTX(v)->inDegree = degree);
}