Class DirectedGraph
An directed graph.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public sealed class DirectedGraph : IDisposable
Constructors
DirectedGraph(MemoryMap, Int32, Int64, Action<UInt32, UInt32>)
Creates a new graph using the given memorymapped file.
Declaration
public DirectedGraph(MemoryMap file, int edgeDataSize, long sizeEstimate, Action<uint, uint> switchEdge)
Parameters
|
MemoryMap
file
|
|
System.Int32
edgeDataSize
|
|
System.Int64
sizeEstimate
|
|
Action<System.UInt32, System.UInt32>
switchEdge
|
DirectedGraph(Int32)
Creates a new graph.
Declaration
public DirectedGraph(int edgeDataSize)
Parameters
|
System.Int32
edgeDataSize
|
DirectedGraph(Int32, Action<UInt32, UInt32>)
Creates a new graph.
Declaration
public DirectedGraph(int edgeDataSize, Action<uint, uint> switchEdge)
Parameters
|
System.Int32
edgeDataSize
|
|
Action<System.UInt32, System.UInt32>
switchEdge
|
DirectedGraph(Int32, Int64)
Creates a new graph.
Declaration
public DirectedGraph(int edgeDataSize, long sizeEstimate)
Parameters
|
System.Int32
edgeDataSize
|
|
System.Int64
sizeEstimate
|
DirectedGraph(Int32, Int64, Action<UInt32, UInt32>)
Creates a new graph.
Declaration
public DirectedGraph(int edgeDataSize, long sizeEstimate, Action<uint, uint> switchEdge)
Parameters
|
System.Int32
edgeDataSize
|
|
System.Int64
sizeEstimate
|
|
Action<System.UInt32, System.UInt32>
switchEdge
|
Properties
EdgeCount
Returns the number of edges in this graph.
Declaration
public uint EdgeCount { get; }
Property Value
|
System.UInt32
|
EdgeDataSize
Gets the edge data size.
Declaration
public int EdgeDataSize { get; }
Property Value
|
System.Int32
|
EdgeSpaceCount
Returns the space used in edges.
Declaration
public uint EdgeSpaceCount { get; }
Property Value
|
System.UInt32
|
IsReadonly
Returns the readonly flag.
Declaration
public bool IsReadonly { get; }
Property Value
|
System.Boolean
|
VertexCount
Returns the number of vertices in this graph.
Declaration
public uint VertexCount { get; }
Property Value
|
System.UInt32
|
Methods
AddEdge(UInt32, UInt32, UInt32)
Adds an edge with the associated data.
Declaration
public uint AddEdge(uint vertex1, uint vertex2, uint data)
Parameters
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
System.UInt32
data
|
Returns
|
System.UInt32
|
AddEdge(UInt32, UInt32, UInt32[])
Adds an edge with the associated data.
Declaration
public uint AddEdge(uint vertex1, uint vertex2, params uint[] data)
Parameters
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
System.UInt32[]
data
|
Returns
|
System.UInt32
|
Compress()
Compresses the data in this graph to it's smallest size.
Declaration
public void Compress()
Compress(Boolean)
Compresses the data in this graph to it's smallest size.
Declaration
public void Compress(bool toReadonly)
Parameters
|
System.Boolean
toReadonly
|
Compress(Boolean, out Int64)
Compresses the data in this graph to it's smallest size.
Declaration
public void Compress(bool toReadonly, out long maxEdgeId)
Parameters
|
System.Boolean
toReadonly
|
|
System.Int64
maxEdgeId
|
Deserialize(Stream, DirectedGraphProfile)
Deserializes a graph from the given stream.
Declaration
public static DirectedGraph Deserialize(Stream stream, DirectedGraphProfile profile)
Parameters
|
System.IO.Stream
stream
|
|
DirectedGraphProfile
profile
|
Returns
|
DirectedGraph
|
Dispose()
Releases unmanaged resources associated with this graph.
Declaration
public void Dispose()
GetEdgeEnumerator()
Returns an empty edge enumerator.
Declaration
public DirectedGraph.EdgeEnumerator GetEdgeEnumerator()
Returns
|
DirectedGraph.EdgeEnumerator
|
GetEdgeEnumerator(UInt32)
Returns all edges starting at the given vertex.
Declaration
public DirectedGraph.EdgeEnumerator GetEdgeEnumerator(uint vertex)
Parameters
|
System.UInt32
vertex
|
Returns
|
DirectedGraph.EdgeEnumerator
|
RemoveEdge(UInt32, UInt32)
Deletes the edge between the two given vertices.
Declaration
public int RemoveEdge(uint vertex1, uint vertex2)
Parameters
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
Returns
|
System.Int32
|
Remarks
Only deletes edge vertex1->vertex2 NOT vertex2 -> vertex1.
RemoveEdges(UInt32)
Deletes all edges leading from/to the given vertex.
Declaration
public int RemoveEdges(uint vertex)
Parameters
|
System.UInt32
vertex
|
Returns
|
System.Int32
|
Remarks
Only deletes all edges vertex->* NOT *->vertex
Serialize(Stream)
Serializes this graph to disk.
Declaration
public long Serialize(Stream stream)
Parameters
|
System.IO.Stream
stream
|
Returns
|
System.Int64
|
Serialize(Stream, Boolean)
Serializes this graph to disk.
Declaration
public long Serialize(Stream stream, bool compress)
Parameters
|
System.IO.Stream
stream
|
|
System.Boolean
compress
|
Returns
|
System.Int64
|
Trim()
Trims the internal data structures of this graph.
Declaration
public void Trim()
Trim(out Int64)
Trims the internal data structures of this graph.
Declaration
public void Trim(out long maxEdgeId)
Parameters
|
System.Int64
maxEdgeId
|
UpdateEdge(UInt32, UInt32, Func<UInt32[], Boolean>, UInt32[])
Updates and edge's associated data.
Declaration
public uint UpdateEdge(uint vertex1, uint vertex2, Func<uint[], bool> update, params uint[] data)
Parameters
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
Func<System.UInt32[], System.Boolean>
update
|
|
System.UInt32[]
data
|
Returns
|
System.UInt32
|
UpdateEdgeIfBetter(UInt32, UInt32, Func<UInt32[], Boolean>, UInt32[])
Updates and edge's associated data.
Declaration
public uint UpdateEdgeIfBetter(uint vertex1, uint vertex2, Func<uint[], bool> update, params uint[] data)
Parameters
|
System.UInt32
vertex1
|
|
System.UInt32
vertex2
|
|
Func<System.UInt32[], System.Boolean>
update
|
|
System.UInt32[]
data
|
Returns
|
System.UInt32
|