Sha256: c7bd1a78ea52a3e8d45a1d8b1a9636d6e4d9f685b54d0fde3bd8256bedebb8ad
Contents?: true
Size: 586 Bytes
Versions: 3
Compression:
Stored size: 586 Bytes
Contents
require 'bindata' # binary file format is # 4 bytes for the number of nodes in the graph # 8*(nb_nodes) bytes for the cumulative degree for each node: # deg(0)=degrees[0] # deg(k)=degrees[k]-degrees[k-1] # 4*(sum_degrees) bytes for the links # IF WEIGHTED 4*(sum_degrees) bytes for the weights in a separate file module FindCommunities class BinaryGraphRecord < BinData::Record endian :little uint32 :nb_nodes array :degrees, :type => :uint64, :initial_length => :nb_nodes array :links, :type => :uint32, :initial_length => lambda { degrees.last } end end
Version data entries
3 entries across 3 versions & 1 rubygems