/// <summary> /// Creates a new huge coordinate collection. /// </summary> /// <param name="coordinates"></param> /// <param name="startIdx"></param> /// <param name="size"></param> /// <param name="reverse"></param> public HugeCoordinateCollection(IHugeArray <float> coordinates, long startIdx, long size, bool reverse) { _startIdx = startIdx; _size = size; _coordinates = coordinates; _reverse = reverse; }
/// <summary> /// Disposes of all resources associated with this coordinate collection index. /// </summary> public void Dispose() { _index.Dispose(); _index = null; _coordinates.Dispose(); _coordinates = null; }
/// <summary> /// Disposes of all resources associated with this index. /// </summary> public void Dispose() { if (_coordinates != null) { _coordinates.Dispose(); _coordinates = null; } }
/// <summary> /// Creates a new huge coordinate index. /// </summary> /// <param name="coordinates"></param> private HugeCoordinateIndex(IHugeArray <float> coordinates) { _coordinates = coordinates; for (long idx = 0; idx < _coordinates.Length; idx++) { _coordinates[idx] = float.MaxValue; } }
/// <summary> /// Creates a new huge coordinate index. /// </summary> /// <param name="coordinates"></param> private HugeCoordinateIndex(IHugeArray<float> coordinates) { _coordinates = coordinates; for(long idx = 0; idx < _coordinates.Length; idx++) { _coordinates[idx] = float.MaxValue; } }
/// <summary> /// Creates a new memory mapped file dynamic graph. /// </summary> /// <param name="estimatedSize"></param> /// <param name="coordinates"></param> /// <param name="vertices"></param> /// <param name="edges"></param> /// <param name="edgeData"></param> /// <param name="edgeShapes"></param> public MemoryMappedFileDynamicGraph(long estimatedSize, MemoryMappedHugeArray <GeoCoordinateSimple> coordinates, MemoryMappedHugeArray <uint> vertices, MemoryMappedHugeArray <uint> edges, MemoryMappedHugeArray <TEdgeData> edgeData, IHugeArray <GeoCoordinateSimple[]> edgeShapes) : base(estimatedSize, coordinates, vertices, edges, edgeData, edgeShapes) { _coordinates = coordinates; _vertices = vertices; _edges = edges; _edgeData = edgeData; }
/// <summary> /// Creates a new huge coordinate index. /// </summary> /// <param name="size"></param> public HugeCoordinateCollectionIndex(long size) { _index = new HugeArray<ulong>(size); _coordinates = new HugeArray<float>(size * 2 * ESTIMATED_SIZE); for (long idx = 0; idx < _index.Length; idx++) { _index[idx] = 0; } for (long idx = 0; idx < _coordinates.Length; idx++) { _coordinates[idx] = float.MinValue; } }
/// <summary> /// Creates a new huge coordinate index. /// </summary> /// <param name="size"></param> public HugeCoordinateCollectionIndex(long size) { _index = new HugeArray <ulong>(size); _coordinates = new HugeArray <float>(size * 2 * ESTIMATED_SIZE); for (long idx = 0; idx < _index.Length; idx++) { _index[idx] = 0; } for (long idx = 0; idx < _coordinates.Length; idx++) { _coordinates[idx] = float.MinValue; } }
/// <summary> /// Creates a new huge coordinate index. /// </summary> /// <param name="factory"></param> /// <param name="size"></param> public HugeCoordinateCollectionIndex(MemoryMappedFileFactory factory, long size) { _index = new MemoryMappedHugeArray <ulong>(factory, size); _coordinates = new MemoryMappedHugeArray <float>(factory, size * 2 * ESTIMATED_SIZE); for (long idx = 0; idx < _index.Length; idx++) { _index[idx] = 0; } for (long idx = 0; idx < _coordinates.Length; idx++) { _coordinates[idx] = float.MinValue; } }
/// <summary> /// Creates a new in-memory graph. /// </summary> /// <param name="sizeEstimate"></param> /// <param name="coordinateArray"></param> /// <param name="vertexArray"></param> /// <param name="edgesArray"></param> /// <param name="edgeDataArray"></param> /// <param name="edgeShapeArray"></param> protected MemoryDirectedGraph(long sizeEstimate, IHugeArray <GeoCoordinateSimple> coordinateArray, IHugeArray <uint> vertexArray, IHugeArray <uint> edgesArray, IHugeArray <TEdgeData> edgeDataArray, HugeCoordinateCollectionIndex edgeShapeArray) { _nextVertexId = 1; _nextEdgeId = 0; _vertices = vertexArray; _vertices.Resize(sizeEstimate); _coordinates = coordinateArray; _coordinates.Resize(sizeEstimate); _edges = edgesArray; _edges.Resize(sizeEstimate * 3 * EDGE_SIZE); _edgeData = edgeDataArray; _edgeData.Resize(sizeEstimate * 3); _edgeShapes = edgeShapeArray; _edgeShapes.Resize(sizeEstimate * 3); }
/// <summary> /// Creates a new in-memory graph. /// </summary> /// <param name="sizeEstimate"></param> /// <param name="coordinateArray"></param> /// <param name="vertexArray"></param> /// <param name="edgesArray"></param> /// <param name="edgeDataArray"></param> /// <param name="edgeShapeArray"></param> protected MemoryDynamicGraph(long sizeEstimate, IHugeArray <GeoCoordinateSimple> coordinateArray, IHugeArray <uint> vertexArray, IHugeArray <uint> edgesArray, IHugeArray <TEdgeData> edgeDataArray, IHugeArray <GeoCoordinateSimple[]> edgeShapeArray) { _nextVertexId = 1; _nextEdgeId = 0; _vertices = vertexArray; _vertices.Resize(sizeEstimate); for (int idx = 0; idx < sizeEstimate; idx++) { _vertices[idx] = NO_EDGE; } _coordinates = coordinateArray; _coordinates.Resize(sizeEstimate); _edges = edgesArray; _edges.Resize(sizeEstimate * 3 * EDGE_SIZE); for (int idx = 0; idx < sizeEstimate * 3 * EDGE_SIZE; idx++) { _edges[idx] = NO_EDGE; } _edgeData = edgeDataArray; _edgeData.Resize(sizeEstimate * 3); _edgeShapes = edgeShapeArray; _edgeShapes.Resize(sizeEstimate * 3); }
/// <summary> /// Disposes of all resources associated with this index. /// </summary> public void Dispose() { if(_coordinates != null) { _coordinates.Dispose(); _coordinates = null; } }
/// <summary> /// Creates a new huge coordinate collection. /// </summary> /// <param name="coordinates"></param> /// <param name="startIdx"></param> /// <param name="size"></param> public HugeCoordinateCollection(IHugeArray<float> coordinates, long startIdx, long size) : this(coordinates, startIdx, size, false) { }
/// <summary> /// Creates a new huge coordinate collection. /// </summary> /// <param name="coordinates"></param> /// <param name="startIdx"></param> /// <param name="size"></param> /// <param name="reverse"></param> public HugeCoordinateCollection(IHugeArray<float> coordinates, long startIdx, long size, bool reverse) { _startIdx = startIdx; _size = size; _coordinates = coordinates; _reverse = reverse; }
/// <summary> /// Creates a new huge coordinate index. /// </summary> /// <param name="factory"></param> /// <param name="size"></param> public HugeCoordinateCollectionIndex(MemoryMappedFileFactory factory, long size) { _index = new MemoryMappedHugeArray<ulong>(factory, size); _coordinates = new MemoryMappedHugeArray<float>(factory, size * 2 * ESTIMATED_SIZE); for (long idx = 0; idx < _index.Length; idx++) { _index[idx] = 0; } for (long idx = 0; idx < _coordinates.Length; idx++) { _coordinates[idx] = float.MinValue; } }
/// <summary> /// Creates a new huge coordinate collection. /// </summary> /// <param name="coordinates"></param> /// <param name="startIdx"></param> /// <param name="size"></param> public HugeCoordinateCollection(IHugeArray <float> coordinates, long startIdx, long size) : this(coordinates, startIdx, size, false) { }
/// <summary> /// Disposes of all resources associated with this coordinate collection index. /// </summary> public void Dispose() { _index.Dispose(); _index = null; _coordinates.Dispose(); _coordinates = null; }