• What is Elements?
  • API Documentation
  • Release Notes

    Show / Hide Table of Contents
    • Elements
      • BaseCeiling
      • BaseError
      • Beam
      • Brace
      • BuiltInMaterials
      • Column
      • ContentCatalog
      • ContentElement
      • CoplanarSetClassification
      • DirectionalLight
      • Domain1d
      • DomainExtensions
      • EdgeDisplayDashMode
      • EdgeDisplaySettings
      • EdgeDisplayWidthMode
      • Element
      • ElementError
      • ElementInstance
      • ElementProxy
      • ElementProxy<T>
      • ElementProxyExtensions
      • Floor
      • FontSize
      • Frame
      • GeometricElement
      • GeometryReference
      • GridLine
      • Identity
      • ImportMeshElement
      • IOverride
      • Joist
      • Light
      • LightType
      • LocalClassification
      • MappingBase
      • Mass
      • Material
      • MeshElement
      • Model
      • ModelArrows
      • ModelCurve
      • ModelCurveExtensions
      • ModelExtensions
      • ModelLines
      • ModelPoints
      • ModelText
      • OpenCeiling
      • Opening
      • Panel
      • PointLight
      • PriorityQueue<T>
      • RandomExtensions
      • SetClassification
      • SetOperations
      • SolidCeiling
      • Space
      • SpotLight
      • StandardWall
      • StringExtensions
      • StructuralFraming
      • Symbol
      • SymbolCameraPosition
      • TiledCeiling
      • Topography
      • Units
      • Units.CardinalDirection
      • Units.LengthUnit
      • Units.UnitType
      • Wall
      • WallByProfile
    • Elements.Analysis
      • AnalysisImage
      • AnalysisMesh
      • ColorScale
    • Elements.Annotations
      • AlignedDimension
      • Annotation
      • ContinuousDimension
      • IOverrideLinked
      • LinearDimension
      • LinkedPropertyInfo
      • Message
      • MessageSeverity
    • Elements.GeoJSON
      • Feature
      • FeatureCollection
      • Geometry
      • GeometryCollection
      • Line
      • LineString
      • MultiLineString
      • MultiPoint
      • MultiPolygon
      • Point
      • Polygon
      • Position
    • Elements.Geometry
      • Arc
      • BBox3
      • Bezier
      • BooleanMode
      • BoundedCurve
      • Box
      • Circle
      • Color
      • Colors
      • Containment
      • Contour
      • ConvexHull
      • Curve
      • Ellipse
      • EllipticalArc
      • EndType
      • FrameType
      • GraphicsBuffers
      • IndexedPolycurve
      • InfiniteLine
      • Line
      • LineExtensions
      • LineSegmentExtensions
      • Matrix
      • Mesh
      • NormalizationType
      • Plane
      • Polygon
      • Polyline
      • Profile
      • ProfileExtensions
      • Ray
      • RayIntersectionResult
      • RelationToPlane
      • Representation
      • Transform
      • Triangle
      • TrimmedCurve<TBasis>
      • UV
      • Vector3
      • Vector3Extensions
      • Vertex
      • VoidTreatment
      • WideFlangeProfileType
    • Elements.Geometry.Interfaces
      • IBoundedCurve
      • IConic
      • ICurve
      • ITessellate
      • ITransformable<T>
      • ITrimmedCurve<TBasis>
    • Elements.Geometry.Profiles
      • CProfile
      • CProfileFactory
      • CProfileType
      • HorizontalAlignment
      • HSSPipeProfile
      • HSSPipeProfileFactory
      • HSSPipeProfileType
      • HSSProfile
      • HSSProfileFactory
      • HSSProfileType
      • LProfile
      • LProfileFactory
      • LProfileType
      • MCProfile
      • MCProfileFactory
      • MCProfileType
      • ParametricProfile
      • ParametricProfileFactory<TProfileType, TProfile>
      • ProfileFactoryBase<TProfileType, TProfile>
      • RHSProfile
      • RHSProfileFactory
      • RHSProfileType
      • SHSProfile
      • SHSProfileFactory
      • SHSProfileType
      • STProfile
      • STProfileFactory
      • STProfileType
      • VectorExpression
      • VerticalAlignment
      • WideFlangeProfile
      • WideFlangeProfileFactory
      • WProfile
      • WProfileFactory
      • WProfileType
      • WTProfile
      • WTProfileFactory
      • WTProfileType
    • Elements.Geometry.Solids
      • ConstructedSolid
      • Edge
      • Extrude
      • Face
      • HalfEdge
      • Lamina
      • Loop
      • Solid
      • SolidOperation
      • Sweep
      • Vertex
    • Elements.Interfaces
      • IHasOpenings
    • Elements.Search
      • DirectionComparer
      • DistanceComparer
      • DoubleToleranceComparer
      • LocalEdge
      • Network<T>
      • PointOctree<T>
    • Elements.Serialization
      • MappingConfiguration
      • MappingConfiguration.ElementColorSetting
      • MappingConfiguration.Layer
    • Elements.Serialization.glTF
      • GltfBufferExtensions
      • GltfExtensions
    • Elements.Serialization.JSON
      • JsonInheritanceConverter
      • MeshConverter
    • Elements.Spatial
      • EvenDivisionMode
      • FixedDivisionMode
      • Grid1d
      • Grid2d
      • GridDirection
      • HalfEdgeGraph2d
      • MercatorProjection
      • PatternMode
      • WebMercatorProjection
    • Elements.Spatial.AdaptiveGrid
      • AdaptiveGraphRouting
      • AdaptiveGraphRouting.RoutingFilter
      • AdaptiveGrid
      • AdaptiveGrid.VerticesInsertionMethod
      • BranchSide
      • ConnectVertexStrategy
      • ConnectVertexWithAngleStrategy
      • Edge
      • EdgeFlags
      • EdgeInfo
      • IAddVertexStrategy
      • Obstacle
      • RoutingConfiguration
      • RoutingHintLine
      • RoutingVertex
      • TreeNode
      • TreeOrder
      • Vertex
      • WeightModifier
    • Elements.Spatial.CellComplex
      • Cell
      • CellComplex
      • ChildBase<ChildClass, GeometryType>
      • Edge
      • EdgeBase<ChildClass>
      • Face
      • Orientation
      • Vertex
      • VertexBase<ChildClass>
    • Elements.Spatial.CellComplex.Interfaces
      • IDistanceTo
      • IHasNeighbors<ChildClass, GeometryType>
    • Elements.Validators
      • ArcValidator
      • ColorValidator
      • ElementValidator
      • ExtrudeValidator
      • GeometricElementValidator
      • IValidator
      • LaminaValidator
      • LineValidator
      • MaterialValidator
      • MatrixValidator
      • PlaneValidator
      • PolygonValidator
      • PolylineValidator
      • ProfileValidator
      • SweepValidator
      • Validator
      • Vector3Validator

    Class PriorityQueue<T>

    PriorityQueue is a collection that allows you to retrieve the item with the lowest priority in constant time and be able update priority of an item with log complexity. Items are unique within the collection but priorities can have duplicate values.

    Inheritance
    System.Object
    PriorityQueue<T>
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Elements
    Assembly: Hypar.Elements.dll
    Syntax
    public class PriorityQueue<T>
        where T : IComparable<T>
    Type Parameters
    Name Description
    T

    Type of the item. Must support hash and comparing.

    Constructors

    PriorityQueue()

    Creates an empty collection.

    Declaration
    public PriorityQueue()

    PriorityQueue(IEnumerable<T>)

    Creates collection from input list. First item in the list is set to priority 0, others with double.MaxValue.

    Declaration
    public PriorityQueue(IEnumerable<T> uniqueCollection)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> uniqueCollection

    List of ids.

    Methods

    AddOrUpdate(T, Double)

    Adds a new item to the collection. If an item with id already exist in collection - it's priority will be updated.

    Declaration
    public void AddOrUpdate(T id, double priority)
    Parameters
    Type Name Description
    T id

    Id of the item.

    System.Double priority

    New priority.

    Contains(T)

    Checks if certain Id is in the queue.

    Declaration
    public bool Contains(T id)
    Parameters
    Type Name Description
    T id
    Returns
    Type Description
    System.Boolean

    Empty()

    Is collection empty.

    Declaration
    public bool Empty()
    Returns
    Type Description
    System.Boolean

    PopMin()

    Returns the lowest priority item from collection. Throws an exception if called on an empty collection.

    Declaration
    public T PopMin()
    Returns
    Type Description
    T

    Id of the item with lowest priority.

    UpdatePriority(T, Double)

    Sets priority for the item with given id. Does nothing if item is not present in the queue.

    Declaration
    public void UpdatePriority(T id, double priority)
    Parameters
    Type Name Description
    T id

    Id of the item.

    System.Double priority

    New priority.

    In This Article
    • Constructors
      • PriorityQueue()
      • PriorityQueue(IEnumerable<T>)
    • Methods
      • AddOrUpdate(T, Double)
      • Contains(T)
      • Empty()
      • PopMin()
      • UpdatePriority(T, Double)