Coder Social home page Coder Social logo

stingerwrapper.jl's Introduction

StingerWrapper

Build Status

This is a Julia wrapper around the STINGER library for processing streaming/dynamic graphs. This wrapper focuses on the dev branch of the stinger repository.

Setup

If you have the libstinger_core shared library in a custom path, please configure the environment variable STINGER_LIB_PATH with the path to the folder containing the library.

The Stinger type

The Stinger type can be used to create a new STINGER data structure. Due to the use of variable length attributes in the C STINGER data structure, we are unable to use a Julia type to directly map to a STINGER type (http://docs.julialang.org/en/release-0.4/manual/calling-c-and-fortran-code/#struct-type-correspondences). So we use the C pointer handle to interact with the STINGER library in the implementation.

Creating STINGER graphs

s = Stinger() #Creates a new datastructure
#Alternatively, to initialize a stinger graph with initial edges (stinger_set_initial_edges)
s = Stinger(5, 0, [0 for i=1:6], [i%5 for i=1:5], [2 for i=1:5], Int64[], Int64[], -2)

We have registered finalizers with Julia that automatically frees your STINGER data structure, the next time the gc runs after it goes out of scope.

Adding and Removing edges

Use the insert_edge! and remove_edge! to add and remove edges respectively. They return the value of 1 on success.

s = Stinger(5, 0, [0 for i=1:6], [i%5 for i=1:5], [2 for i=1:5], Int64[], Int64[], -2)
insert_edge!(s, 0, 1, 4, 2, 2)
remove_edge!(s, 0, 1, 4)

Consistency Checks

The STINGER graph can be checked for consistency using the consistency_check function. It returns true if consistent or false if inconsistent.

stingerwrapper.jl's People

Contributors

jpfairbanks avatar rohitvarkey avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.