/// <summary>
 /// Resizes this array.
 /// </summary>
 /// <param name="size"></param>
 public void Resize(long size)
 {
     _index.Resize(size);
     if (_maxId >= size)
     {
         _maxId = size - 1;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Resizes this array.
        /// </summary>
        /// <param name="size"></param>
        public void Resize(long size)
        {
            _index.Resize(size);
            if (_maxId >= size)
            {
                _maxId = size - 1;
            }

            //this.Trim();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Increases the memory allocation.
        /// </summary>
        /// <param name="size"></param>
        private void IncreaseVertexSize(long size)
        {
            if (_readonly)
            {
                throw new Exception("Graph is readonly.");
            }

            var oldLength = _coordinates.Length;

            _coordinates.Resize(size);
            _vertices.Resize(size);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Increases the memory allocation.
        /// </summary>
        private void IncreaseEdgeSize(long size)
        {
            if (_readonly)
            {
                throw new Exception("Graph is readonly.");
            }

            var oldLength = _edges.Length;

            _edges.Resize(size);
            _edgeData.Resize(size / EDGE_SIZE);
            _edgeShapes.Resize(size / EDGE_SIZE);
        }
Ejemplo n.º 5
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>
 public DirectedGraph(long sizeEstimate, HugeArrayBase <GeoCoordinateSimple> coordinateArray,
                      HugeArrayBase <uint> vertexArray, HugeArrayBase <uint> edgesArray, HugeArrayBase <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);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Resizes this array.
 /// </summary>
 /// <param name="size"></param>
 public override void Resize(long size)
 {
     _baseArray.Resize(size * _elementSize);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Increases the size of the coordinates array.
 /// To be used when the ESTIMATED_SIZE has underestimated to average coordinate collection size.
 /// </summary>
 private void IncreaseCoordinates()
 {
     _coordinates.Resize(_coordinates.Length + (1 << 20));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Increases the size of this index.
 /// </summary>
 /// <param name="idx"></param>
 private void IncreaseSize(long idx)
 {
     _coordinates.Resize((idx * 2) + 100000);
 }