Gapotchenko.FX.Math.Geometry
2022.2.7
Prefix Reserved
Install-Package Gapotchenko.FX.Math.Geometry -Version 2022.2.7
dotnet add package Gapotchenko.FX.Math.Geometry --version 2022.2.7
<PackageReference Include="Gapotchenko.FX.Math.Geometry" Version="2022.2.7" />
paket add Gapotchenko.FX.Math.Geometry --version 2022.2.7
#r "nuget: Gapotchenko.FX.Math.Geometry, 2022.2.7"
// Install Gapotchenko.FX.Math.Geometry as a Cake Addin
#addin nuget:?package=Gapotchenko.FX.Math.Geometry&version=2022.2.7
// Install Gapotchenko.FX.Math.Geometry as a Cake Tool
#tool nuget:?package=Gapotchenko.FX.Math.Geometry&version=2022.2.7
Overview
The module provides primitives and operations for geometry math.
StringMetrics
StringMetrics
static class provides a variety of metric functions for measuring the distance between two strings of symbols.
The notion of a string is purely abstract.
So it is not limited to just characters like System.String
; it can be a string of anything in form of IEnumerable<T>
.
In this way, Gapotchenko.FX.Math.Geometry
module achieves the right degree of abstraction desirable for a versatile math toolkit.
Edit Distance
Edit distance is a string metric reflecting the minimum number of operations required to transform one string into the other. There are several ways to measure the edit distance.
The table below compares edit distance measurement functions provided by StringMetrics
class:
Metric Function | Insertion | Deletion | Substitution | Transposition |
---|---|---|---|---|
Levenshtein distance | ✓ | ✓ | ✓ | |
Longest common subsequence (LCS) distance | ✓ | ✓ | ||
Hamming distance | ✓ | |||
Damerau–Levenshtein distance | ✓ | ✓ | ✓ | ✓ |
Optimal string alignment (OSA) distance | ✓ | ✓ | ✓ | ✓ |
Jaro distance | ✓ |
Levenshtein Distance
StringMetrics.LevenshteinDistance
method allows to calculate the Levenshtein distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.LevenshteinDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 2
Longest Common Subsequence (LCS) Distance
StringMetrics.LcsDistance
method allows to calculate the longest common subsequence (LCS) distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.LcsDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 2
Hamming Distance
StringMetrics.HammingDistance
method allows to calculate the Hamming distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.HammingDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 2
Damerau-Levenshtein Distance
StringMetrics.DamerauLevenshteinDistance
method allows to calculate the Damerau–Levenshtein distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.DamerauLevenshteinDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 1
Optimal String Alignment (OSA) Distance
StringMetrics.OsaDistance
method allows to calculate the optimal string alignment (OSA) distance between two strings of symbols.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
int distance = StringMetrics.OsaDistance("ABC", "BAC");
Console.WriteLine("Distance is {0}.", distance); // distance = 1
Jaro Distance
StringMetrics.JaroDistance
method allows to calculate the Jaro distance between two strings of symbols.
Although the Jaro distance is often referred to as an edit distance metric, its value does not represent a number of edit operations and varies between 0 and 1 such that 0 is an exact match and 1 equates to no similarities.
Consider the example:
using Gapotchenko.FX.Math.Geometry;
double distance = StringMetrics.JaroDistance("ABC", "BAC");
Console.WriteLine("Distance is {0.00}.", distance); // distance = 0.44
Commonly Used Types
- Gapotchenko.FX.Math.Geometry.StringMetrics
Other Modules
Let's continue with a look at some other modules provided by Gapotchenko.FX:
- Gapotchenko.FX
- Gapotchenko.FX.AppModel.Information
- Gapotchenko.FX.Collections
- Gapotchenko.FX.Console
- Gapotchenko.FX.Data
- Gapotchenko.FX.Diagnostics
- Gapotchenko.FX.IO
- Gapotchenko.FX.Linq
- Gapotchenko.FX.Math
- Gapotchenko.FX.Memory
- Gapotchenko.FX.Security.Cryptography
- Gapotchenko.FX.Text
- Gapotchenko.FX.Threading
Or look at the full list of modules.
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net46 net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETCoreApp 2.0
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
.NETCoreApp 2.1
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
.NETCoreApp 3.0
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
.NETFramework 4.6
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
.NETFramework 4.7.1
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
.NETFramework 4.7.2
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
.NETStandard 2.0
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
.NETStandard 2.1
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
net5.0
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
net6.0
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
-
net7.0
- Gapotchenko.FX.Collections (>= 2022.2.7)
- Gapotchenko.FX.Linq (>= 2022.2.7)
- Gapotchenko.FX.Math (>= 2022.2.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.