コード例 #1
0
        /// <summary>
        /// Increases the memory allocation.
        /// </summary>
        /// <param name="size"></param>
        private void IncreaseVertexSize(long size)
        {
            var oldLength = _coordinates.Length;

            _coordinates.Resize(size);
            _vertices.Resize(size);
        }
コード例 #2
0
        /// <summary>
        /// Increases the memory allocation.
        /// </summary>
        private void IncreaseEdgeSize(long size)
        {
            var oldLength = _edges.Length;

            _edges.Resize(size);
            _edgeData.Resize(size / EDGE_SIZE);
            _edgeShapes.Resize(size / EDGE_SIZE);
        }
コード例 #3
0
        /// <summary>
        /// Increases the memory allocation.
        /// </summary>
        /// <param name="size"></param>
        private void IncreaseVertexSize(long size)
        {
            var oldLength = _coordinates.Length;

            _coordinates.Resize(size);
            _vertices.Resize(size);
            for (long idx = oldLength; idx < size; idx++)
            {
                _vertices[idx] = NO_EDGE;
            }
        }
コード例 #4
0
        /// <summary>
        /// Resizes this array.
        /// </summary>
        /// <param name="size"></param>
        public void Resize(long size)
        {
            _index.Resize(size);

            long bestSize = size * 2 * ESTIMATED_SIZE;

            if (bestSize < _coordinates.Length)
            { // make sure all coordinate data is saved.
                bestSize = _coordinates.Length;
            }
            _coordinates.Resize(bestSize);
        }
コード例 #5
0
        /// <summary>
        /// Increases the memory allocation.
        /// </summary>
        private void IncreaseEdgeSize(long size)
        {
            var oldLength = _edges.Length;

            _edges.Resize(size);
            for (long idx = oldLength; idx < size; idx++)
            {
                _edges[idx] = NO_EDGE;
            }
            _edgeData.Resize(size / EDGE_SIZE);
            _edgeShapes.Resize(size / EDGE_SIZE);
        }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 /// <summary>
 /// Increases the size of this index.
 /// </summary>
 /// <param name="idx"></param>
 private void IncreaseSize(long idx)
 {
     _coordinates.Resize((idx * 2) + 100000);
 }