Skip to content

Commit 5b346e9

Browse files
author
Зелёный Андрей Сергеевич
committed
Добавлена библиотека ConcurrentPriorityQueue для использования очереди с приоритетом.
Добавлен класс MyDoubleComparer реализующий IComparer<double> для сравнения двух вещественных чисел
1 parent 525c9b4 commit 5b346e9

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

DijkstraAlgorithm.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
3535
<ItemGroup>
36+
<Reference Include="ConcurrentPriorityQueue, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
37+
<HintPath>packages\PriorityQueue.0.1.0\lib\net45\ConcurrentPriorityQueue.dll</HintPath>
38+
</Reference>
3639
<Reference Include="System" />
3740
<Reference Include="System.Core" />
3841
<Reference Include="System.Xml.Linq" />
@@ -45,6 +48,7 @@
4548
<ItemGroup>
4649
<Compile Include="GaussianParameter.cs" />
4750
<Compile Include="Graph.cs" />
51+
<Compile Include="MyDoubleComparer.cs" />
4852
<Compile Include="Obstacle.cs" />
4953
<Compile Include="Point2D.cs" />
5054
<Compile Include="Program.cs" />
@@ -54,6 +58,7 @@
5458
</ItemGroup>
5559
<ItemGroup>
5660
<None Include="App.config" />
61+
<None Include="packages.config" />
5762
<None Include="README.md" />
5863
</ItemGroup>
5964
<ItemGroup />

MyDoubleComparer.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Collections.Generic;
2+
3+
namespace DijkstraAlgorithm
4+
{
5+
/// <summary>
6+
/// Реализует интерфейс сравнения двух вещественных чисел
7+
/// </summary>
8+
class MyDoubleComparer : IComparer<double>
9+
{
10+
public int Compare(double x, double y)
11+
{
12+
if (x < y)
13+
return 1;
14+
if (x > y)
15+
return -1;
16+
else
17+
return 0;
18+
}
19+
}
20+
}

packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="PriorityQueue" version="0.1.0" targetFramework="net472" />
4+
</packages>

0 commit comments

Comments
 (0)