/// <summary> /// Resizes this array. /// </summary> /// <param name="size"></param> public void Resize(long size) { _index.Resize(size); if (_maxId >= size) { _maxId = size - 1; } }
/// <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(); }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// Resizes this array. /// </summary> /// <param name="size"></param> public override void Resize(long size) { _baseArray.Resize(size * _elementSize); }
/// <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)); }
/// <summary> /// Increases the size of this index. /// </summary> /// <param name="idx"></param> private void IncreaseSize(long idx) { _coordinates.Resize((idx * 2) + 100000); }