diff --git a/.gitignore b/.gitignore index d88d337..310c02c 100644 --- a/.gitignore +++ b/.gitignore @@ -261,3 +261,5 @@ FakesAssemblies/ # Visual Studio 6 workspace options file *.opt + +.idea \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 51420ac..8c30ca6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "booksum", - "overround" + "overround", + "Overrounds" ] } \ No newline at end of file diff --git a/App/App.csproj b/App/App.csproj index 27854a7..d3ce00d 100644 --- a/App/App.csproj +++ b/App/App.csproj @@ -10,7 +10,7 @@ - + diff --git a/App/Program.cs b/App/Program.cs index d7448d9..24a34c4 100644 --- a/App/Program.cs +++ b/App/Program.cs @@ -1,4 +1,4 @@ -using Overround; +using Overrounds; double[] fairPrices = [1 / 0.01, 1 / 0.29, 1 / 0.3, 1 / 0.4]; double fairBooksum = Booksum.FromPrices(fairPrices); diff --git a/Overround.Tests/AdditiveTest.cs b/Overrounds.Tests/AdditiveTest.cs similarity index 92% rename from Overround.Tests/AdditiveTest.cs rename to Overrounds.Tests/AdditiveTest.cs index 336300b..0b8c095 100644 --- a/Overround.Tests/AdditiveTest.cs +++ b/Overrounds.Tests/AdditiveTest.cs @@ -1,11 +1,11 @@ -namespace Overround.Tests; +namespace Overrounds.Tests; [TestClass] public class AdditiveTest { private const double Delta = 1e-3; - private IOverroundMethod method = new Additive(); + private readonly IOverroundMethod method = new Additive(); [TestMethod] public void TestApplyNoOverround() diff --git a/Overround.Tests/ArrayAssert.cs b/Overrounds.Tests/ArrayAssert.cs similarity index 86% rename from Overround.Tests/ArrayAssert.cs rename to Overrounds.Tests/ArrayAssert.cs index 152def1..836e879 100644 --- a/Overround.Tests/ArrayAssert.cs +++ b/Overrounds.Tests/ArrayAssert.cs @@ -1,6 +1,6 @@ -namespace Overround.Tests; +namespace Overrounds.Tests; -class ArrayAssert +static class ArrayAssert { internal static void AreEqual(double[] expected, double[] actual, double delta) { diff --git a/Overround.Tests/BooksumTest.cs b/Overrounds.Tests/BooksumTest.cs similarity index 89% rename from Overround.Tests/BooksumTest.cs rename to Overrounds.Tests/BooksumTest.cs index 7d2afe9..5f0472f 100644 --- a/Overround.Tests/BooksumTest.cs +++ b/Overrounds.Tests/BooksumTest.cs @@ -1,4 +1,4 @@ -namespace Overround.Tests; +namespace Overrounds.Tests; [TestClass] public class BooksumTest diff --git a/Overround.Tests/GlobalUsings.cs b/Overrounds.Tests/GlobalUsings.cs similarity index 100% rename from Overround.Tests/GlobalUsings.cs rename to Overrounds.Tests/GlobalUsings.cs diff --git a/Overround.Tests/MultiplicativeTest.cs b/Overrounds.Tests/MultiplicativeTest.cs similarity index 92% rename from Overround.Tests/MultiplicativeTest.cs rename to Overrounds.Tests/MultiplicativeTest.cs index f9dbc24..efd468b 100644 --- a/Overround.Tests/MultiplicativeTest.cs +++ b/Overrounds.Tests/MultiplicativeTest.cs @@ -1,11 +1,11 @@ -namespace Overround.Tests; +namespace Overrounds.Tests; [TestClass] public class MultiplicativeTest { private const double Delta = 1e-3; - private IOverroundMethod method = new Multiplicative(); + private readonly IOverroundMethod method = new Multiplicative(); [TestMethod] public void TestApplyNoOverround() diff --git a/Overround.Tests/OddsRatioTest.cs b/Overrounds.Tests/OddsRatioTest.cs similarity index 92% rename from Overround.Tests/OddsRatioTest.cs rename to Overrounds.Tests/OddsRatioTest.cs index d171438..0a9e560 100644 --- a/Overround.Tests/OddsRatioTest.cs +++ b/Overrounds.Tests/OddsRatioTest.cs @@ -1,11 +1,11 @@ -namespace Overround.Tests; +namespace Overrounds.Tests; [TestClass] public class OddsRatioTest { private const double Delta = 1e-3; - private IOverroundMethod method = new OddsRatio(); + private readonly IOverroundMethod method = new OddsRatio(); [TestMethod] public void TestApplyNoOverround() diff --git a/Overround.Tests/Overround.Tests.csproj b/Overrounds.Tests/Overrounds.Tests.csproj similarity index 84% rename from Overround.Tests/Overround.Tests.csproj rename to Overrounds.Tests/Overrounds.Tests.csproj index 950d6aa..c68a355 100644 --- a/Overround.Tests/Overround.Tests.csproj +++ b/Overrounds.Tests/Overrounds.Tests.csproj @@ -9,6 +9,7 @@ true false false + Overround.Tests @@ -19,7 +20,7 @@ - + diff --git a/Overround.Tests/PowerTest.cs b/Overrounds.Tests/PowerTest.cs similarity index 92% rename from Overround.Tests/PowerTest.cs rename to Overrounds.Tests/PowerTest.cs index 72a0f1f..f23b98e 100644 --- a/Overround.Tests/PowerTest.cs +++ b/Overrounds.Tests/PowerTest.cs @@ -1,11 +1,11 @@ -namespace Overround.Tests; +namespace Overrounds.Tests; [TestClass] public class PowerTest { private const double Delta = 1e-3; - private IOverroundMethod method = new Power(); + private readonly IOverroundMethod method = new Power(); [TestMethod] public void TestApplyNoOverround() diff --git a/Overround.Tests/SolverTest.cs b/Overrounds.Tests/SolverTest.cs similarity index 95% rename from Overround.Tests/SolverTest.cs rename to Overrounds.Tests/SolverTest.cs index 820673b..8d23636 100644 --- a/Overround.Tests/SolverTest.cs +++ b/Overrounds.Tests/SolverTest.cs @@ -1,4 +1,4 @@ -namespace Overround.Tests; +namespace Overrounds.Tests; [TestClass] public class SolverTest diff --git a/Overround/Additive.cs b/Overrounds/Additive.cs similarity index 95% rename from Overround/Additive.cs rename to Overrounds/Additive.cs index 81202cd..14c38b8 100644 --- a/Overround/Additive.cs +++ b/Overrounds/Additive.cs @@ -1,6 +1,6 @@ using System.Net.NetworkInformation; -namespace Overround; +namespace Overrounds; public class Additive : IOverroundMethod { diff --git a/Overround/Booksum.cs b/Overrounds/Booksum.cs similarity index 91% rename from Overround/Booksum.cs rename to Overrounds/Booksum.cs index 9ea3183..4158095 100644 --- a/Overround/Booksum.cs +++ b/Overrounds/Booksum.cs @@ -1,4 +1,4 @@ -namespace Overround; +namespace Overrounds; public class Booksum { diff --git a/Overround/IOverroundMethod.cs b/Overrounds/IOverroundMethod.cs similarity index 82% rename from Overround/IOverroundMethod.cs rename to Overrounds/IOverroundMethod.cs index 584360f..8da398e 100644 --- a/Overround/IOverroundMethod.cs +++ b/Overrounds/IOverroundMethod.cs @@ -1,4 +1,4 @@ -namespace Overround; +namespace Overrounds; public interface IOverroundMethod { diff --git a/Overround/Multiplicative.cs b/Overrounds/Multiplicative.cs similarity index 94% rename from Overround/Multiplicative.cs rename to Overrounds/Multiplicative.cs index 1cbd805..970d822 100644 --- a/Overround/Multiplicative.cs +++ b/Overrounds/Multiplicative.cs @@ -1,6 +1,6 @@ using System.Net.NetworkInformation; -namespace Overround; +namespace Overrounds; public class Multiplicative : IOverroundMethod { diff --git a/Overround/OddsRatio.cs b/Overrounds/OddsRatio.cs similarity index 98% rename from Overround/OddsRatio.cs rename to Overrounds/OddsRatio.cs index b04288f..70ec060 100644 --- a/Overround/OddsRatio.cs +++ b/Overrounds/OddsRatio.cs @@ -1,4 +1,4 @@ -namespace Overround; +namespace Overrounds; public class OddsRatio : IOverroundMethod { diff --git a/Overround/Overround.csproj b/Overrounds/Overrounds.csproj similarity index 83% rename from Overround/Overround.csproj rename to Overrounds/Overrounds.csproj index c8f422a..cc3ff09 100644 --- a/Overround/Overround.csproj +++ b/Overrounds/Overrounds.csproj @@ -5,6 +5,7 @@ enable enable false + Overround diff --git a/Overround/Power.cs b/Overrounds/Power.cs similarity index 98% rename from Overround/Power.cs rename to Overrounds/Power.cs index c177f81..6d74307 100644 --- a/Overround/Power.cs +++ b/Overrounds/Power.cs @@ -1,4 +1,4 @@ -namespace Overround; +namespace Overrounds; public class Power : IOverroundMethod { diff --git a/Overround/Solver.cs b/Overrounds/Solver.cs similarity index 96% rename from Overround/Solver.cs rename to Overrounds/Solver.cs index e01d567..523e2cd 100644 --- a/Overround/Solver.cs +++ b/Overrounds/Solver.cs @@ -1,4 +1,4 @@ -namespace Overround; +namespace Overrounds; public class Solution(double value, double error, int iterations) { @@ -14,7 +14,7 @@ public override string ToString() } } -public class Solver +public static class Solver { public static Solution Solve(double initEstimate, double initStep, double errorThreshold, int maxIterations, Func lossFunc) { diff --git a/README.md b/README.md index 109c326..bd19e8c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A collection of overround application methods: _Multiplicative_, _Additive_, _Po # Examples ```csharp -using Overround; +using Overrounds; double[] fairPrices = [1 / 0.1, 1 / 0.2, 1 / 0.3, 1 / 0.4]; double fairBooksum = Booksum.FromPrices(fairPrices); diff --git a/overround-methods.sln b/overround-methods.sln index 4c53b44..b9b1731 100644 --- a/overround-methods.sln +++ b/overround-methods.sln @@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.5.002.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Overround", "Overround\Overround.csproj", "{DEF254B1-9AB7-40EF-97E3-1181C6965539}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Overrounds", "Overrounds\Overrounds.csproj", "{DEF254B1-9AB7-40EF-97E3-1181C6965539}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "App\App.csproj", "{5CC997ED-8A82-4551-8774-B595037D217F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Overround.Tests", "Overround.Tests\Overround.Tests.csproj", "{7AF1A5D1-9FB0-4398-AFA8-3C0139D9BA5E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Overrounds.Tests", "Overrounds.Tests\Overrounds.Tests.csproj", "{7AF1A5D1-9FB0-4398-AFA8-3C0139D9BA5E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution