{"id":13414767,"url":"https://github.com/ZacharyPatten/Towel","last_synced_at":"2025-03-14T22:32:07.495Z","repository":{"id":37271564,"uuid":"170810013","full_name":"ZacharyPatten/Towel","owner":"ZacharyPatten","description":"Throw in the towel.","archived":false,"fork":false,"pushed_at":"2024-01-06T21:18:40.000Z","size":20630,"stargazers_count":717,"open_issues_count":10,"forks_count":51,"subscribers_count":28,"default_branch":"main","last_synced_at":"2024-07-31T21:53:14.016Z","etag":null,"topics":["algorithm","avl-tree","command-line","console","csharp","data-structures","dotnet","extensions","framework","functional","library","mathematics","measurements","random","red-black-trees","sorting","towel","xml"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZacharyPatten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-02-15T06:00:53.000Z","updated_at":"2024-07-21T08:17:55.000Z","dependencies_parsed_at":"2024-02-01T17:48:23.590Z","dependency_job_id":null,"html_url":"https://github.com/ZacharyPatten/Towel","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZacharyPatten%2FTowel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZacharyPatten%2FTowel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZacharyPatten%2FTowel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZacharyPatten%2FTowel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZacharyPatten","download_url":"https://codeload.github.com/ZacharyPatten/Towel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658055,"owners_count":20326459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","avl-tree","command-line","console","csharp","data-structures","dotnet","extensions","framework","functional","library","mathematics","measurements","random","red-black-trees","sorting","towel","xml"],"created_at":"2024-07-30T21:00:36.132Z","updated_at":"2025-03-14T22:32:07.018Z","avatar_url":"https://github.com/ZacharyPatten.png","language":"C#","readme":"\u003cp align=\"center\"\u003e\n\t\u003ca href=\"#\"\u003e\u003cimg src=\"https://github.com/ZacharyPatten/Towel/blob/main/.github/Resources/Logo.svg?raw=true\" height=\"150\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n\tTowel\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\tA .NET library intended to make coding a bit more towelerable: data structures, algorithms, mathematics, metadata, extensions, console, and more. :)\n\u003c/p\u003e\n\n\u003e \"It's a tough galaxy. If you want to survive, you've gotta know... where your towel is.\" - Ford Prefect\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/ZacharyPatten/Towel\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-repo-%2324292e?logo=github\" title=\"Go To Github Repo\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://docs.microsoft.com/en-us/dotnet/csharp/\"\u003e\u003cimg src=\"https://img.shields.io/badge/language-C%23-%23178600\" title=\"Go To C# Documentation\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://dotnet.microsoft.com/download\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/xml?color=%23512bd4\u0026label=target\u0026query=%2F%2FTargetFramework%5B1%5D\u0026url=https%3A%2F%2Fraw.githubusercontent.com%2FZacharyPatten%2FTowel%2Fmain%2FSources%2FTowel%2FTowel.csproj\u0026logo=.net\" title=\"Go To .NET Download\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://www.nuget.org/packages/Towel\"\u003e\u003cimg src=\"https://img.shields.io/nuget/v/Towel.svg?logo=nuget\" title=\"Go To Nuget Package\" /\u003e\u003c/a\u003e\n\t\u003ca href=\"https://zacharypatten.github.io/Towel/index.html\"\u003e\u003cimg src=\"https://github.com/ZacharyPatten/Towel/blob/main/.github/Resources/docfx-badge.svg?raw=true\" title=\"Go To Docfx Documentation\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/ZacharyPatten/Towel/actions/workflows/Continuous%20Integration.yml\"\u003e\u003cimg src=\"https://github.com/ZacharyPatten/Towel/actions/workflows/Continuous%20Integration.yml/badge.svg\" title=\"Go To Action\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://zacharypatten.github.io/Towel/coveragereport/index.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/xml?color=yellow\u0026label=coverage\u0026query=%2F%2Fcoverage%5B1%5D%2F%40line-rate-percentage\u0026url=https%3A%2F%2Fraw.githubusercontent.com%2FZacharyPatten%2FTowel%2Fgh-pages%2Fcoveragereport%2Fcoverage.xml\" title=\"Go Test Coverage Report\" /\u003e\u003c/a\u003e\n\t\u003ca href=\"https://discord.gg/4XbQbwF\"\u003e\u003cimg src=\"https://img.shields.io/discord/557244925712924684?logo=discord\u0026logoColor=ffffff\u0026color=7389D8\" title=\"Go To Discord Server\" /\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/ZacharyPatten/Towel/blob/main/License.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-green.svg\" title=\"Go To License\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003e _**Note** This project has a goal of keeping up-to-date on modern coding practices rather than maintaining backwards compatibility such as targetting the latest non-preview version of .NET and embracing favorable breaking changes (\"Semantic Versioning\" is not being respected at this time)._\n\n## Getting Started\n\n\u003cdetails\u003e\n\u003csummary\u003e\nRun The Included Examples \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e Towel has [Examples](https://github.com/ZacharyPatten/Towel/tree/main/Examples) included in this repository.\n\u003e \n\u003e [Download](https://github.com/ZacharyPatten/Towel/archive/main.zip) this repository and unzip the contents.\n\u003e \n\u003e There are no custom build processes. Towel should build with any standard .NET build process, but one of the following is recommended:\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Visual Studio \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e 1. Install [Visual Studio](https://visualstudio.microsoft.com/) if not already installed.\n\u003e \u003e \n\u003e \u003e 2. Open the \u003csub\u003e\u003ca href=\"Towel.sln\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-16.svg\" title=\"File\"\u003e\u003c/a\u003e\u003c/sub\u003e **`Towel.sln`** file in Visual Studio.\n\u003e \u003e \n\u003e \u003e - _(optional) [Here are some settings you change in Visual Studio](https://gist.github.com/ZacharyPatten/693f35653f6c21fbe6c85444792e524b)._\n\u003e\n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Visual Studio Code \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e 1. Install the [.NET SDK](https://dotnet.microsoft.com/download) if not already installed.\n\u003e \u003e \n\u003e \u003e 2. Install [Visual Studio Code](https://visualstudio.microsoft.com/) if not already installed.\n\u003e \u003e \n\u003e \u003e 3. Open the \u003csub\u003e\u003ca href=\"#\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e **`root folder`** of the repository in Visual Studio Code.\n\u003e \u003e \n\u003e \u003e _The following files are included in the repository:_\n\u003e \u003e - `.vscode/extensions.json` \u003csub\u003erecommends Vistual Studio Code extension dependencies\u003c/sub\u003e\n\u003e \u003e - `.vscode/launch.json` \u003csub\u003eincludes the configurations for debugging the examples\u003c/sub\u003e\n\u003e \u003e - `.vscode/settings.json` \u003csub\u003eautomatically applies settings to the workspace\u003c/sub\u003e\n\u003e \u003e - `.vscode/tasks.json` \u003csub\u003eincludes the commands to build the projects\u003c/sub\u003e\n\u003e \u003e \n\u003e \u003e _Visual Studio Code Extensions (will be prompted to install these when you open the folder):_\n\u003e \u003e - `ms-vscode.csharp` \u003csub\u003eC# support\u003c/sub\u003e\n\u003e \u003e - `formulahendry.dotnet-test-explorer` _(optional)_ \u003csub\u003eMSTest unit testing support\u003c/sub\u003e\n\u003e \u003e - `aisoftware.tt-processor` _(optional)_ \u003csub\u003eT4 Template support\u003c/sub\u003e\n\u003e \u003e - `zbecknell.t4-support` _(optional)_ \u003csub\u003eT4 Template syntax highlighting\u003c/sub\u003e\n\u003e\n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nUse Towel In Your .NET Projects \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e - Your project must target the same or newer version of .NET as Towel. [See this documentation on how to check the current target of your project](https://docs.microsoft.com/en-us/dotnet/standard/frameworks). Towel targets the following version of .NET: \u003csub\u003e\u003csub\u003e\u003ca href=\"https://dotnet.microsoft.com/download\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/xml?color=%23512bd4\u0026label=target\u0026query=%2F%2FTargetFramework%5B1%5D\u0026url=https%3A%2F%2Fraw.githubusercontent.com%2FZacharyPatten%2FTowel%2Fmain%2FSources%2FTowel%2FTowel.csproj\u0026logo=.net\" title=\"Go To .NET Download\"\u003e\u003c/a\u003e\u003c/sub\u003e\u003c/sub\u003e\n\u003e\n\u003e - Towel has a nuget package: \u003csub\u003e\u003csub\u003e\u003ca href=\"https://www.nuget.org/packages/Towel\"\u003e\u003cimg src=\"https://img.shields.io/nuget/v/Towel.svg?logo=nuget\" title=\"Go To Nuget Package\"/\u003e\u003c/a\u003e\u003c/sub\u003e\u003c/sub\u003e\u003cbr/\u003eInstructions on how to reference the package are included on nuget.org _(click the badge)_.\n\u003e\n\u003e - If you use Towel and would be willing to show it, here is a badge you can copy-paste into your readme: \u003csub\u003e\u003csub\u003e\u003ca href=\"#\"\u003e\u003cimg src=\"https://github.com/ZacharyPatten/Towel/blob/main/.github/Resources/UsingTowel.svg?raw=true\" title=\"Go To Towel\"\u003e\u003c/a\u003e\u003c/sub\u003e\u003c/sub\u003e\n\u003e   ```html\n\u003e   \u003ca href=\"https://github.com/ZacharyPatten/Towel\"\u003e\u003cimg src=\"https://github.com/ZacharyPatten/Towel/blob/main/.github/Resources/UsingTowel.svg?raw=true\" title=\"Go To Towel\"\u003e\u003c/a\u003e\n\u003e   ```\n\u003e\n\u003e - Share your work. If you use Towel in one of your projects we want to hear about it. :)\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nView Documentation \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e - Change Log: https://github.com/ZacharyPatten/Towel/releases\n\u003e - [docfx](https://github.com/dotnet/docfx) generated API documentation reference: \u003csub\u003e\u003csub\u003e\u003ca href=\"https://zacharypatten.github.io/Towel/index.html\"\u003e\u003cimg src=\"https://github.com/ZacharyPatten/Towel/blob/main/.github/Resources/docfx-badge.svg?raw=true\" title=\"Go To Docfx Documentation\"\u003e\u003c/a\u003e\u003c/sub\u003e\u003c/sub\u003e\n\u003e - [Coverlet](https://github.com/coverlet-coverage/coverlet) + [ReportGenerator](https://github.com/danielpalme/ReportGenerator) generated test coverage report: \u003csub\u003e\u003csub\u003e\u003ca href=\"https://zacharypatten.github.io/Towel/coveragereport/index.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/dynamic/xml?color=yellow\u0026label=coverage\u0026query=%2F%2Fcoverage%5B1%5D%2F%40line-rate-percentage\u0026url=https%3A%2F%2Fraw.githubusercontent.com%2FZacharyPatten%2FTowel%2Fgh-pages%2Fcoveragereport%2Fcoverage.xml\" title=\"Go Test Coverage Report\"/\u003e\u003c/a\u003e\u003c/sub\u003e\u003c/sub\u003e\n\u003e - [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet) generated benchmarking: https://zacharypatten.github.io/Towel/articles/benchmarks.html\n\u003e \n\u003e Relevant Articles:\n\u003e\n\u003e - [MSDN Accessing XML Documentation Via Reflection](https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/october/csharp-accessing-xml-documentation-via-reflection)\u003c/br\u003e\n\u003e - [Beginner's Guide To Console Input In C#](https://gist.github.com/ZacharyPatten/798ed612d692a560bdd529367b6a7dbd)\u003c/br\u003e\n\u003e - [Generating Unique Random Data](https://gist.github.com/ZacharyPatten/c9b43a2c9e8a5a5523883e77410f742d)\u003c/br\u003e\n\u003e - [Random Generation (with efficient exclusions)](https://gist.github.com/ZacharyPatten/8de188b2bd358ab5c3517cbb55e83632)\u003c/br\u003e\n\u003e - [Omnitree](https://gist.github.com/ZacharyPatten/f21fc5c6835faea9be8ae4baab4e294e)\u003c/br\u003e\n\u003e - [C# Generic Math](https://gist.github.com/ZacharyPatten/8e1395a94928f2c7715cf939b0d0389c)\u003c/br\u003e\n\u003e\n\u003e File Structure Overview _(except for \u003csub\u003e\u003ca href=\"https://github.com/ZacharyPatten/Towel/tree/gh-pages\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/git-branch-16.svg\" title=\"Branch\"\u003e\u003c/a\u003e\u003c/sub\u003e `gh-pages`)_:\n\u003e\n\u003e - \u003csub\u003e\u003ca href=\".github\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `.github` \u003csub\u003econtent regarding the GitHub repoistory.\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\".github/ISSUE_TEMPLATE\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `ISSUE_TEMPLATE` \u003csub\u003etemplates for issue submissions to the GitHub repository\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\".github/Resources\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `Resources` \u003csub\u003eresources such as image files\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\".github/workflows\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `workflows` \u003csub\u003e[GitHub Actions](https://github.com/ZacharyPatten/Towel/actions) workflows\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\".github/workflows/Continuous Integration.yml\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/play-16.svg\" title=\"Action\"\u003e\u003c/a\u003e\u003c/sub\u003e `Continuous Integration.yml` \u003csub\u003eworkflow for checking that code compiles and unit tests pass\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\".github/workflows/Towel Deployment.yml\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/play-16.svg\" title=\"Action\"\u003e\u003c/a\u003e\u003c/sub\u003e `Towel Deployment.yml` \u003csub\u003eworkflow to manage [releases](https://github.com/ZacharyPatten/Towel/releases) and deploy [nuget packages](https://www.nuget.org/packages/Towel)\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\".github/workflows/Documentation.yml\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/play-16.svg\" title=\"Action\"\u003e\u003c/a\u003e\u003c/sub\u003e `Documentation.yml` \u003csub\u003eworkflow that runs [docfx](https://github.com/dotnet/docfx) + [Coverlet](https://github.com/coverlet-coverage/coverlet) + [ReportGenerator](https://github.com/danielpalme/ReportGenerator) to output [GitHub Pages](https://pages.github.com/) to \u003csub\u003e\u003ca href=\"https://github.com/ZacharyPatten/Towel/tree/gh-pages\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/git-branch-16.svg\" title=\"Branch\"\u003e\u003c/a\u003e\u003c/sub\u003e `gh-pages`\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\".github/pull_request_template.md\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-16.svg\" title=\"File\"\u003e\u003c/a\u003e\u003c/sub\u003e `pull_request_template.md` \u003csub\u003etemplate for when pull requests are created\u003c/sub\u003e\n\u003e - \u003csub\u003e\u003ca href=\".vscode\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `.vscode` \u003csub\u003econfirguration files for if the code is opened in [Visual Studio Code](https://visualstudio.microsoft.com/)\u003c/sub\u003e\n\u003e - \u003csub\u003e\u003ca href=\"Examples\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `Examples` \u003csub\u003eroot folder for all the example projects\u003c/sub\u003e\n\u003e - \u003csub\u003e\u003ca href=\"Sources\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `Sources` \u003csub\u003eroot folder for the source code of released nuget packages\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\"Sources/Towel\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e **`Towel` \u003csub\u003ethe root folder for all source code in the Towel nuget package\u003c/sub\u003e**\n\u003e - \u003csub\u003e\u003ca href=\"Tools\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `Tools` \u003csub\u003eroot folder for all support projects (not included in nuget packages)\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\"Tools/docfx_project\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `docfx_project` \u003csub\u003eroot folder for [docfx](https://github.com/dotnet/docfx) project (used in \u003csub\u003e\u003ca href=\".github/workflows/Documentation.yml\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/play-16.svg\" title=\"Action\"\u003e\u003c/a\u003e\u003c/sub\u003e `Documentation.yml`)\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\"Tools/docfx_project/articles\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `articles` \u003csub\u003eroot folder for all articless of the [docfx](https://github.com/dotnet/docfx) generated [GitHub Pages](https://pages.github.com/) website\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\"Tools/docfx_project/apidoc\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `apidoc` \u003csub\u003eroot folder for all api overrides of the [docfx](https://github.com/dotnet/docfx) generated [GitHub Pages](https://pages.github.com/) website\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\"Tools/docfx_project/docfx.json\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-16.svg\" title=\"File\"\u003e\u003c/a\u003e\u003c/sub\u003e `docfx.json` \u003csub\u003econfiguration file that controls [docfx](https://github.com/dotnet/docfx)\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\"Tools/docfx_project/index.md\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-16.svg\" title=\"File\"\u003e\u003c/a\u003e\u003c/sub\u003e `index.md` \u003csub\u003ehome page of the [docfx](https://github.com/dotnet/docfx) generated [GitHub Pages](https://pages.github.com/) website\u003c/sub\u003e\n\u003e     - \u003csub\u003e\u003ca href=\"Tools/docfx_project/toc.yml\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-16.svg\" title=\"File\"\u003e\u003c/a\u003e\u003c/sub\u003e `toc.yml` \u003csub\u003eprimary navigation for the [docfx](https://github.com/dotnet/docfx) generated [GitHub Pages](https://pages.github.com/) website\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\"Tools/Towel_Benchmarking\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `Towel_Benchmarking` \u003csub\u003eproject with all the benchmarking for the Towel project\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\"Tools/Towel_Generating\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `Towel_Generating` \u003csub\u003eproject with code generation for the Towel Project\u003c/sub\u003e\n\u003e   - \u003csub\u003e\u003ca href=\"Tools/Towel_Testing\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/file-directory-16.svg\" title=\"Directory\"\u003e\u003c/a\u003e\u003c/sub\u003e `Towel_Testing` \u003csub\u003eproject with all unit tests for the Towel project (used in \u003csub\u003e\u003ca href=\".github/workflows/Continuous Integration.yml\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/play-16.svg\" title=\"Action\"\u003e\u003c/a\u003e\u003c/sub\u003e `Continuous Integration.yml` and \u003csub\u003e\u003ca href=\".github/workflows/Documentation.yml\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ZacharyPatten/Towel/main/.github/Resources/play-16.svg\" title=\"Action\"\u003e\u003c/a\u003e\u003c/sub\u003e `Documentation.yml`)\u003c/sub\u003e\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nGet Involved \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e - The easiest way to support Towel is to star the github repository.\n\u003e\n\u003e - If you have any questions, you can [start a new discussion](https://github.com/ZacharyPatten/Towel/discussions/new).\n\u003e\n\u003e - If you notice anything in Towel that may be improved, please [create a new issue](https://github.com/ZacharyPatten/Towel/issues/new/choose).\u003cbr/\u003e\n\u003e   Feature requests are welcome.\n\u003e\n\u003e - You can chat with the developer(s) on discord: \u003csub\u003e\u003csub\u003e\u003ca href=\"https://discord.gg/4XbQbwF\"\u003e\u003cimg src=\"https://img.shields.io/discord/557244925712924684?logo=discord\u0026logoColor=ffffff\u0026color=7389D8\" title=\"Go To Discord Server\"/\u003e\u003c/a\u003e\u003c/sub\u003e\u003c/sub\u003e\n\u003e\n\u003e - If you want to contribute to Towel:\u003cbr/\u003e\u0026nbsp;\u0026nbsp;1. Fork this repository\u003cbr/\u003e\u0026nbsp;\u0026nbsp;2. Make some changes\u003cbr/\u003e\u0026nbsp;\u0026nbsp;3. Open a pull request\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## Overview\n\n\u003cdetails\u003e\n\u003csummary\u003e\nAlgorithms \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // supports System.Span\u003cT\u003e and any (non ref struct) int-indexed type\n\u003e IsPalindrome\u003c...\u003e(...);\n\u003e \n\u003e // supports System.ReadOnlySpan\u003cT\u003e\n\u003e IsInterleavedRecursive\u003c...\u003e(...);\n\u003e IsInterleavedIterative\u003c...\u003e(...);\n\u003e \n\u003e IsReorderOf\u003c...\u003e(...); // aka \"anagrams\"\n\u003e \n\u003e // supports System.Span\u003cT\u003e and any (non ref struct) int-indexed type\n\u003e SortShuffle\u003cT\u003e(...);\n\u003e SortBubble\u003cT\u003e(...);\n\u003e SortSelection\u003cT\u003e(...);\n\u003e SortInsertion\u003cT\u003e(...);\n\u003e SortQuick\u003cT\u003e(...);\n\u003e SortMerge\u003cT\u003e(...);\n\u003e SortHeap\u003cT\u003e(...);\n\u003e SortOddEven\u003cT\u003e(...);\n\u003e SortCocktail\u003cT\u003e(...);\n\u003e SortComb\u003cT\u003e(...);\n\u003e SortGnome\u003cT\u003e(...);\n\u003e SortShell\u003cT\u003e(...);\n\u003e SortBogo\u003cT\u003e(...);\n\u003e SortSlow\u003cT\u003e(...);\n\u003e SortCycle\u003cT\u003e(...);\n\u003e SortPancake\u003cT\u003e(...);\n\u003e SortStooge\u003cT\u003e(...);\n\u003e SortTim\u003cT\u003e(...);\n\u003e SortIntro\u003cT\u003e(...);\n\u003e SortCounting\u003cT\u003e(...); // uint-based (non-comparative sort)\n\u003e SortRadix\u003cT\u003e(...); // uint-based (non-comparative sort)\n\u003e SortPidgeonHole\u003cT\u003e(...); // int-based (non-comparative sort)\n\u003e \n\u003e // supports System.ReadOnlySpan\u003cT\u003e and any (non ref struct) int-indexed type\n\u003e SearchBinary\u003cT\u003e(...);\n\u003e \n\u003e // supports System.ReadOnlySpan\u003cT\u003e and any (non ref struct) int-indexed type\n\u003e int HammingDistanceIterative\u003c...\u003e(...);\n\u003e int LevenshteinDistanceRecursive\u003c...\u003e(...);\n\u003e int LevenshteinDistanceIterative\u003c...\u003e(...);\n\u003e \n\u003e // Permutations of sequences\n\u003e // supports System.Span\u003cT\u003e and any (non ref struct) int-indexed type\n\u003e void PermuteRecursive\u003c...\u003e(...);\n\u003e void PermuteIterative\u003c...\u003e(...);\n\u003e \n\u003e // Combinations of sequences\n\u003e void Combinations\u003c...\u003e(...);\n\u003e \n\u003e // Path Finding (Graph Search)\n\u003e // overloads for A*, Dijkstra, and Breadth-First-Search algorithms\n\u003e SearchGraph\u003c...\u003e(...);\n\u003e \n\u003e // Combines ranges without gaps between them\n\u003e IEnumerable\u003c(T A, T B)\u003e CombineRanges\u003cT\u003e(IEnumerable\u003c(T A, T B)\u003e ranges)\n\u003e ```\n\u003e \n\u003e \u003e [Sorting Algorithm Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/SortBenchmarks.html) \u003csub\u003eNote: not all permuations of the input are benchmarked, so take with a grain of salt.\u003c/sub\u003e\u003cbr/\u003e\n\u003e \u003e [Permute Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/PermuteBenchmarks.html)\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nExtensions \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // System.Random extensions to generate more random types\n\u003e // there are overloads to specify possible ranges\n\u003e string NextString(this Random random, int length);\n\u003e char NextChar(this Random random);\n\u003e decimal NextDecimal(this Random random);\n\u003e DateTime DateTime(this Random random);\n\u003e TimeSpan TimeSpan(this Random random);\n\u003e long NextLong(this Random random);\n\u003e int[] Next(this Random random, int count, int minValue, int maxValue, Span\u003cT\u003e excluded); // with exclusions\n\u003e int[] NextUnique(this Random random, int count, int minValue, int maxValue); // unique values\n\u003e int[] NextUnique(this Random random, int count, int minValue, int maxValue, Span\u003cT\u003e excluded); // unique values with exclusions\n\u003e T Next\u003cT\u003e(this Random random, IEnumerable\u003c(T Value, double Weight)\u003e pool); // weighted values\n\u003e void Shuffle\u003cT\u003e(this Random random, T[] array); // randomize arrays\n\u003e \n\u003e // Type conversion to string definition as appears in C# source code\n\u003e string ConvertToCSharpSourceDefinition(this Type type);\n\u003e // Example: typeof(List\u003cint\u003e) -\u003e \"System.Collections.Generic.List\u003cint\u003e\"\n\u003e \n\u003e string ToEnglishWords(this decimal @decimal);\n\u003e // Example: 42 -\u003e \"Forty-Two\"\n\u003e (bool Success, decimal Value) TryParseEnglishWordsToDecimal(string words);\n\u003e // Example: \"Forty-Two\" -\u003e 42\n\u003e \n\u003e int TryParseRomanNumeral(string @string);\n\u003e // Example: \"XLII\" -\u003e 42\n\u003e int TryToRomanNumeral(int value);\n\u003e // Example: 42 -\u003e \"XLII\"\n\u003e \n\u003e // Reflection Extensions To Access XML Documentation\n\u003e string GetDocumentation(this Type type);\n\u003e string GetDocumentation(this FieldInfo fieldInfo);\n\u003e string GetDocumentation(this PropertyInfo propertyInfo);\n\u003e string GetDocumentation(this EventInfo eventInfo);\n\u003e string GetDocumentation(this ConstructorInfo constructorInfo);\n\u003e string GetDocumentation(this MethodInfo methodInfo);\n\u003e string GetDocumentation(this MemberInfo memberInfo);\n\u003e string GetDocumentation(this ParameterInfo parameterInfo);\n\u003e ```\n\u003e \n\u003e \u003e [Weighted Random Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/WeightedRandomBenchmarks.html)\u003cbr/\u003e\n\u003e \u003e [Random With Exclusions Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/RandomWithExclusionsBenchmarks.html)\u003cbr/\u003e\n\u003e \u003e [decimal To English Words Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/ToEnglishWordsBenchmarks.html)\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nData Structures \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Heap \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // A heap is a binary tree that is sorted vertically using comparison methods. This is different\n\u003e \u003e // from AVL Trees or Red-Black Trees that keep their contents stored horizontally. The rule\n\u003e \u003e // of a heap is that no parent can be less than either of its children. A Heap using \"sifting up\"\n\u003e \u003e // and \"sifting down\" algorithms to move values vertically through the tree to keep items sorted.\n\u003e \u003e \n\u003e \u003e IHeap\u003cT\u003e heap = HeapArray.New\u003cT\u003e();\n\u003e \u003e \n\u003e \u003e // Visualization:\n\u003e \u003e //\n\u003e \u003e //    Binary Tree\n\u003e \u003e //\n\u003e \u003e //                      -7\n\u003e \u003e //                      / \\\n\u003e \u003e //                     /   \\\n\u003e \u003e //                    /     \\\n\u003e \u003e //                   /       \\\n\u003e \u003e //                  /         \\\n\u003e \u003e //                 /           \\\n\u003e \u003e //                /             \\\n\u003e \u003e //               /               \\\n\u003e \u003e //             -4                 1\n\u003e \u003e //             / \\               / \\     \n\u003e \u003e //            /   \\             /   \\    \n\u003e \u003e //           /     \\           /     \\   \n\u003e \u003e //         -1       3         6       4\n\u003e \u003e //         / \\     / \\       / \\     / \\ \n\u003e \u003e //        30  10  17  51    45  22  19  7\n\u003e \u003e //\n\u003e \u003e //    Flattened into an Array\n\u003e \u003e //\n\u003e \u003e //        Root = 1\n\u003e \u003e //        Left Child = 2 * Index\n\u003e \u003e //        Right Child = 2* Index + 1\n\u003e \u003e //         __________________________________________________________________________\n\u003e \u003e //        |0  |-7 |-4 |1  |-1 |3  |6  |4  |30 |10 |17 |51 |45 |22 |19 |7  |0  |0  |0  ...\n\u003e \u003e //         ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\n\u003e \u003e //         0   1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e AVL Tree \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // An AVL tree is a binary tree that is sorted using comparison methods and automatically balances\n\u003e \u003e // itself by tracking the heights of nodes and performing one of four specific algorithms: rotate\n\u003e \u003e // right, rotate left, double rotate right, or double rotate left. Any parent in an AVL Tree must\n\u003e \u003e // be greater than its left child but less than its right child (if the children exist). An AVL\n\u003e \u003e // tree is sorted in the same manor as a Red-Black Tree, but uses different algorithms to maintain\n\u003e \u003e // the balance of the tree.\n\u003e \u003e \n\u003e \u003e IAvlTree\u003cT\u003e avlTree = AvlTreeLinked.New\u003cT\u003e();\n\u003e \u003e \n\u003e \u003e // Visualization:\n\u003e \u003e //\n\u003e \u003e //    Binary Tree\n\u003e \u003e //\n\u003e \u003e //        Depth 0 ------------------\u003e    7\n\u003e \u003e //                                      / \\\n\u003e \u003e //                                     /   \\\n\u003e \u003e //                                    /     \\\n\u003e \u003e //                                   /       \\\n\u003e \u003e //                                  /         \\\n\u003e \u003e //                                 /           \\\n\u003e \u003e //                                /             \\\n\u003e \u003e //                               /               \\\n\u003e \u003e //        Depth 1 ---------\u003e    1                 22\n\u003e \u003e //                             / \\               / \\\n\u003e \u003e //                            /   \\             /   \\\n\u003e \u003e //                           /     \\           /     \\\n\u003e \u003e //        Depth 2 ----\u003e    -4       4         17      45\n\u003e \u003e //                         / \\     / \\       / \\     / \\\n\u003e \u003e //        Depth 3 ---\u003e   -7  -1   3   6     10  19  30  51\n\u003e \u003e //\n\u003e \u003e //    Flattened into an Array\n\u003e \u003e //\n\u003e \u003e //        Root = 1\n\u003e \u003e //        Left Child = 2 * Index\n\u003e \u003e //        Right Child = 2* Index + 1\n\u003e \u003e //         __________________________________________________________________________\n\u003e \u003e //        |0  |7  |1  |22 |-4 |4  |17 |45 |-7 |-1 |3  |6  |10 |19 |30 |51 |0  |0  |0  ...\n\u003e \u003e //         ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\n\u003e \u003e //         0   1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Red Black Tree \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // A Red-Black treeis a binary tree that is sorted using comparison methods and automatically \n\u003e \u003e // balances itself. Any parent in an Red-Black Tree must be greater than its left child but less\n\u003e \u003e // than its right child (if the children exist). A Red-Black tree is sorted in the same manor as\n\u003e \u003e // an AVL Tree, but uses different algorithms to maintain the balance of the tree.\n\u003e \u003e \n\u003e \u003e IRedBlackTree\u003cT\u003e redBlackTree = RedBlackTreeLinked.New\u003cT\u003e();\n\u003e \u003e \n\u003e \u003e // Visualization:\n\u003e \u003e //\n\u003e \u003e //    Binary Tree\n\u003e \u003e //\n\u003e \u003e //        Color Black ----------------\u003e    7\n\u003e \u003e //                                        / \\\n\u003e \u003e //                                       /   \\\n\u003e \u003e //                                      /     \\\n\u003e \u003e //                                     /       \\\n\u003e \u003e //                                    /         \\\n\u003e \u003e //                                   /           \\\n\u003e \u003e //                                  /             \\\n\u003e \u003e //                                 /               \\\n\u003e \u003e //        Color Red ---------\u003e    1                 22\n\u003e \u003e //                               / \\               / \\\n\u003e \u003e //                              /   \\             /   \\\n\u003e \u003e //                             /     \\           /     \\\n\u003e \u003e //        Color Black ---\u003e   -4       4         17      45\n\u003e \u003e //                           / \\     / \\       / \\     / \\\n\u003e \u003e //        Color Red ---\u003e   -7  -1   3   6     10  19  30  51\n\u003e \u003e //\n\u003e \u003e //    Flattened into an Array\n\u003e \u003e //\n\u003e \u003e //        Root = 1\n\u003e \u003e //        Left Child = 2 * Index\n\u003e \u003e //        Right Child = 2* Index + 1\n\u003e \u003e //         __________________________________________________________________________\n\u003e \u003e //        |0  |7  |1  |22 |-4 |4  |17 |45 |-7 |-1 |3  |6  |10 |19 |30 |51 |0  |0  |0  ...\n\u003e \u003e //         ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\n\u003e \u003e //         0   1   2   3   4   5   6   7   8   9   10  11  12  13  14  15  16  17  18\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Omnitree \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // An Omnitree is a Spacial Partitioning Tree (SPT) that works on an arbitrary number of dimensions.\n\u003e \u003e // It stores items sorted along multiple dimensions by dividing spaces into sub-spaces. A 3D\n\u003e \u003e // version of an SPT is often called an \"Octree\" and a 2D version of an SPT is often called a\n\u003e \u003e // \"Quadtree.\" There are two versions of the Omnitree: Points and Bounds. The Points version stores\n\u003e \u003e // vectors while the Bounds version stores spaces with a minimum and maximum vector.\n\u003e \u003e \n\u003e \u003e IOmnitreePoints\u003cT, A1, A2, A3...\u003e omnitreePoints =\n\u003e \u003e     new OmnitreePointsLinked\u003cT, A1, A2, A3...\u003e(\n\u003e \u003e         (T value, out A1 a1, out A2 a2, out A3 a3...) =\u003e { ... });\n\u003e \u003e         \n\u003e \u003e IOmnitreeBounds\u003cT, A1, A2, A3...\u003e omnitreeBounds =\n\u003e \u003e     new OmnitreeBoundsLinked\u003cT, A1, A2, A3...\u003e(\n\u003e \u003e         (T value,\n\u003e \u003e         out A1 min1, out A1 max1,\n\u003e \u003e         out A2 min2, out A2 max2,\n\u003e \u003e         out A3 min3, out A3 max3...) =\u003e { ... });\n\u003e \u003e \n\u003e \u003e // The maximum number of children any node can have is 2 ^ N where N is the number\n\u003e \u003e // of dimensions of the tree.\n\u003e \u003e //\n\u003e \u003e //    -------------------------------\n\u003e \u003e //    | Dimensions | Max # Children |\n\u003e \u003e //    |============|================|\n\u003e \u003e //    |     1      |   2 ^ 1 = 2    |\n\u003e \u003e //    |     2      |   2 ^ 2 = 4    |\n\u003e \u003e //    |     3      |   2 ^ 3 = 8    |\n\u003e \u003e //    |     4      |   2 ^ 4 = 16   |\n\u003e \u003e //    |    ...     |      ...       |\n\u003e \u003e //    -------------------------------\n\u003e \u003e //\n\u003e \u003e // Visualizations\n\u003e \u003e //\n\u003e \u003e // 1 Dimensional:\n\u003e \u003e //\n\u003e \u003e //  -1D |-----------|-----------| +1D        Children Indexes:\n\u003e \u003e //                                           -1D: 0\n\u003e \u003e //       \u003c--- 0 ---\u003e \u003c--- 1 ---\u003e             +1D: 1\n\u003e \u003e //\n\u003e \u003e // 2 Dimensional:\n\u003e \u003e //       _____________________\n\u003e \u003e //      |          |          |  +2D\n\u003e \u003e //      |          |          |   ^\n\u003e \u003e //      |     2    |     3    |   |        Children Indexes:\n\u003e \u003e //      |          |          |   |        -2D -1D: 0\n\u003e \u003e //      |----------|----------|   |        -2D +1D: 1\n\u003e \u003e //      |          |          |   |        +2D -1D: 2\n\u003e \u003e //      |          |          |   |        +2D +1D: 3\n\u003e \u003e //      |     0    |     1    |   |\n\u003e \u003e //      |          |          |   v\n\u003e \u003e //      |__________|__________|  -2D\n\u003e \u003e //\n\u003e \u003e //       -1D \u003c-----------\u003e +1D \n\u003e \u003e //\n\u003e \u003e // 3 Dimensional:\n\u003e \u003e //\n\u003e \u003e //            +3D     _____________________\n\u003e \u003e //           7       /         /          /|\n\u003e \u003e //          /       /    6    /     7    / |\n\u003e \u003e //         /       /---------/----------/  |                     Children Indexes:\n\u003e \u003e //        /       /    2    /     3    /|  |                     -3D -2D -1D: 0\n\u003e \u003e //       L       /_________/__________/ |  |                     -3D -2D +1D: 1\n\u003e \u003e //    -3D       |          |          | | /|          +2D        -3D +2D -1D: 2\n\u003e \u003e //              |          |          | |/ |           ^         -3D +2D +1D: 3\n\u003e \u003e //              |     2    |     3    | /  |           |         +3D -2D -1D: 4\n\u003e \u003e //              |          |          |/|  | \u003c-- 5     |         +3D -2D +1D: 5\n\u003e \u003e //              |----------|----------| |  |           |         +3D +2D -1D: 6\n\u003e \u003e //              |          |          | |  /           |         +3D +2D +1D: 7\n\u003e \u003e //              |          |          | | /            |\n\u003e \u003e //              |     0    |     1    | |/             |\n\u003e \u003e //              |          |          | /              v\n\u003e \u003e //              |__________|__________|/              -2D\n\u003e \u003e //             \n\u003e \u003e //                   ^\n\u003e \u003e //                   |\n\u003e \u003e //                   4 (behind 0)\n\u003e \u003e //\n\u003e \u003e //               -1D \u003c-----------\u003e +1D\n\u003e \u003e //\n\u003e \u003e // 4 Dimensional:\n\u003e \u003e //\n\u003e \u003e //     +1D         +2D         +3D         +4D       Children Indexes:\n\u003e \u003e //      ^           ^           ^           ^\n\u003e \u003e //      |           |           |           |        -4D -3D -2D -1D: 0   +4D -3D -2D -1D: 8\n\u003e \u003e //      |           |           |           |        -4D -3D -2D +1D: 1   +4D -3D -2D +1D: 9\n\u003e \u003e //      |           |           |           |        -4D -3D +2D -1D: 2   +4D -3D +2D -1D: 10\n\u003e \u003e //      |           |           |           |        -4D -3D +2D +1D: 3   +4D -3D +2D +1D: 11\n\u003e \u003e //      |           |           |           |        -4D +3D -2D -1D: 4   +4D +3D -2D -1D: 12\n\u003e \u003e //     ---         ---         ---         ---       -4D +3D -2D +1D: 5   +4D +3D -2D +1D: 13\n\u003e \u003e //      |           |           |           |        -4D +3D +2D -1D: 6   +4D +3D +2D -1D: 14\n\u003e \u003e //      |           |           |           |        -4D +3D +2D +1D: 7   +4D +3D +2D +1D: 15\n\u003e \u003e //      |           |           |           |\n\u003e \u003e //      |           |           |           |\n\u003e \u003e //      |           |           |           |\n\u003e \u003e //      v           v           v           v\n\u003e \u003e //     -1D         -2D         -3D         -4D\n\u003e \u003e //\n\u003e \u003e //     With a value that is in the (+1D, -2D, -3D, +4D)[Index 9] child:\n\u003e \u003e //\n\u003e \u003e //     +1D         +2D         +3D         +4D\n\u003e \u003e //      ^           ^           ^           ^\n\u003e \u003e //      |           |           |           |\n\u003e \u003e //      |           |           |           |\n\u003e \u003e //      O---        |           |        ---O\n\u003e \u003e //      |   \\       |           |       /   |\n\u003e \u003e //      |    \\      |           |      /    |\n\u003e \u003e //     ---    \\    ---         ---    /    ---\n\u003e \u003e //      |      \\    |           |    /      |\n\u003e \u003e //      |       \\   |           |   /       |\n\u003e \u003e //      |        ---O-----------O---        |\n\u003e \u003e //      |           |           |           |\n\u003e \u003e //      |           |           |           |\n\u003e \u003e //      v           v           v           v\n\u003e \u003e //     -1D         -2D         -3D         -4D\n\u003e \u003e \n\u003e \u003e // By default, the omnitree will sort items along each axis and use the median algorithm to determine\n\u003e \u003e // the point of divisions. However, you can override the subdivision algorithm. For numerical values,\n\u003e \u003e // the mean algorithm can be used (and is much faster than median). If you know the data set will be\n\u003e \u003e // relatively evenly distributed within a sub-space, you can even set the subdivision algorithm to\n\u003e \u003e // calculate the subdivision from parent spaces rather than looking at the current contents of the\n\u003e \u003e // space.\n\u003e \u003e \n\u003e \u003e // The depth of the omnitree is bounded by \"ln(count)\" the natural log of the current count. When adding\n\u003e \u003e // and item to the tree, if the number of items in the respective child is greater than ln(count) and \n\u003e \u003e // the depth bounding has not been reached, then the child will be subdivided. The goal is to achieve \n\u003e \u003e // Ω(ln(count)) runtime complexity when looking up values.\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e B-Tree \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // a B-tree is a self-balancing tree data structure that maintains \n\u003e \u003e // sorted data and allows searches, sequential access, insertions, \n\u003e \u003e // and deletions in logarithmic time. The B-tree generalizes the \n\u003e \u003e // binary search tree, allowing for nodes with more than two children.\n\u003e \u003e \n\u003e \u003e // There are two ways to Add and Remove elements in a B-Tree\n\u003e \u003e // 1) Pre-emptive: Search the tree from top to bottom (for place to add/ \n\u003e \u003e // \t\t\tnode to delete) and perform fixing of the B-Tree (Splitting\n\u003e \u003e //\t\t\tor Merging) in a single pass\n\u003e \u003e // 2) Non Pre-emptive: Add/Remove the required node and go up the tree to \n\u003e \u003e // \t\t\tfix the tree as needed\n\u003e \u003e //\n\u003e \u003e // Pre-emptive methods are optimal, especially if the Maximum Degree of\n\u003e \u003e // a node is set to an even number. This implementation of B-Tree \n\u003e \u003e // uses Pre-emptive modes of Add/Removal methods and therefore the \n\u003e \u003e // value of Maximum Degree is mandated to be even\n\u003e \u003e \n\u003e \u003e // This implementation is taken from Thomas H. Cormen's book \"Introduction \n\u003e \u003e // to Algorithms, 3rd edition\", Chapter 18: B-Trees\n\u003e \u003e \n\u003e \u003e BTree\u003cint\u003e tree = new BTree\u003cint\u003e(4); \n\u003e \u003e\n\u003e \u003e tree.Add(20);\n\u003e \u003e tree.Add(10);\n\u003e \u003e tree.Add(30);\n\u003e \u003e tree.Add(50);\n\u003e \u003e tree.Add(40);\n\u003e \u003e tree.Add(5);\n\u003e \u003e tree.Add(15);\n\u003e \u003e // \n\u003e \u003e //                       [20]\n\u003e \u003e //                      /    \\\n\u003e \u003e //                     /      \\\n\u003e \u003e //           [5, 10, 15]       [30, 40, 50]\n\u003e \u003e // \n\u003e \u003e // All elements added in the BTree, where each node can have a maximum\n\u003e \u003e // of 4 children (and therefore, a maximum of 3 elements)\n\u003e \u003e \n\u003e \u003e bool r1 = tree.TryRemove(50).Success; // r1 = true\n\u003e \u003e bool r2 = tree.TryRemove(50).Success; // r2 = false, 50 is no longer in the tree\n\u003e \u003e\n\u003e \u003e // \n\u003e \u003e //                       [20]\n\u003e \u003e //                      /    \\\n\u003e \u003e //                     /      \\\n\u003e \u003e //           [5, 10, 15]       [30, 40]\n\u003e \u003e\n\u003e \u003e int[] array = tree.ToArray(); // array = [5, 10, 15, 20, 30, 40]\n\u003e \u003e ```\n\u003e \u003e\n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Tree \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e ITree\u003cT\u003e treeMap = TreeMap.New\u003cT\u003e(...);\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Graph \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // A graph is a data structure that contains nodes and edges. They are useful\n\u003e \u003e // when you need to model real world scenarios. They also are generally used\n\u003e \u003e // for particular algorithms such as path finding. The GraphSetOmnitree is a\n\u003e \u003e // graph that stores nodes in a hashed set and the edges in a 2D omnitree (aka\n\u003e \u003e // quadtree).\n\u003e \u003e \n\u003e \u003e IGraph\u003cint\u003e graph = GraphSetOmnitree.New\u003cint\u003e();\n\u003e \u003e // add nodes\n\u003e \u003e graph.Add(0);\n\u003e \u003e graph.Add(1);\n\u003e \u003e graph.Add(2);\n\u003e \u003e graph.Add(3);\n\u003e \u003e // add edges\n\u003e \u003e graph.Add(0, 1);\n\u003e \u003e graph.Add(1, 2);\n\u003e \u003e graph.Add(2, 3);\n\u003e \u003e graph.Add(0, 3);\n\u003e \u003e // visualization\n\u003e \u003e //\n\u003e \u003e //     0 --------\u003e 1\n\u003e \u003e //     |           |\n\u003e \u003e //     |           |\n\u003e \u003e //     |           |\n\u003e \u003e //     v           v\n\u003e \u003e //     3 \u003c-------- 2\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e SkipList \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // A skip list is a probabilistic data structure that stores data \n\u003e \u003e // similar to a Linked List, but has additional layers which allow\n\u003e \u003e // the list to perform basic operations (add/search/delete) in \n\u003e \u003e // O(log n) average complexity\n\u003e \u003e \n\u003e \u003e SkipList\u003cint, SFunc\u003cint, int, CompareResult\u003e\u003e? list = SkipList.New\u003cint\u003e(5); // create a list with 5 levels\n\u003e \u003e list.Add(60);\n\u003e \u003e list.Add(20);\n\u003e \u003e list.Add(30);\n\u003e \u003e list.Add(40);\n\u003e \u003e list.Add(20);\n\u003e \u003e list.Add(90);\n\u003e \u003e list.Add(80);\n\u003e \u003e // #--------------------\u003e|  |---------------------------------\u003eNULL\n\u003e \u003e // #--------------------\u003e|  |---------------------------\u003e|  |-\u003eNULL\n\u003e \u003e // # -------------------\u003e|  |-------------------\u003e|  |---\u003e|  |-\u003eNULL\n\u003e \u003e // # -----------\u003e|  |---\u003e|  |---\u003e|  |-----------\u003e|  |---\u003e|  |-\u003eNULL\n\u003e \u003e // # ---\u003e|20|---\u003e|20|---\u003e|30|---\u003e|40|---\u003e|60|---\u003e|80|---\u003e|90|-\u003eNULL\n\u003e \u003e // \n\u003e \u003e // PS: SkipList nodes are assigned levels randomly, so this is one of the possible configurations obtainable\n\u003e \u003e bool result;\n\u003e \u003e result = list.Contains(40); //result = true\n\u003e \u003e result = list.Remove(40).Suceess; // result = true\n\u003e \u003e result = list.Contains(40); //result = false\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Trie \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e // A trie is a tree that stores values in a way that partial keys may be shared\n\u003e \u003e // amongst values to reduce redundant memory usage. They are generally used with\n\u003e \u003e // large data sets such as storing all the words in the English language. For\n\u003e \u003e // example, the words \"farm\" and \"fart\" both have the letters \"far\" in common.\n\u003e \u003e // A trie takes advantage of that and only stores the necessary letters for\n\u003e \u003e // those words ['f'-\u003e'a'-\u003e'r'-\u003e('t'||'m')]. A trie is not limited to string\n\u003e \u003e // values though. Any key type that can be broken into pieces (and shared),\n\u003e \u003e // could be used in a trie.\n\u003e \u003e //\n\u003e \u003e // There are two versions. One that only stores the values of the trie (ITrie\u003cT\u003e)\n\u003e \u003e // and one that stores the values of the trie plus an additional generic value\n\u003e \u003e // on the leaves (ITrie\u003cT, D\u003e).\n\u003e \u003e\n\u003e \u003e ITrie\u003cT\u003e trie = TrieLinkedHashLinked.New\u003cT\u003e();\n\u003e \u003e\n\u003e \u003e ITrie\u003cT, D\u003e trie = TrieLinkedHashLinked.New\u003cT, D\u003e();\n\u003e \u003e ```\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nGeneric Mathematics \u0026 Logic \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e How It Works \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e ```cs\n\u003e \u003e public static T Addition\u003cT\u003e(T a, T b)\n\u003e \u003e {\n\u003e \u003e \treturn AdditionImplementation\u003cT\u003e.Function(a, b);\n\u003e \u003e }\n\u003e \u003e \n\u003e \u003e internal static class AdditionImplementation\u003cT\u003e\n\u003e \u003e {\n\u003e \u003e \tinternal static Func\u003cT, T, T\u003e Function = (T a, T b) =\u003e\n\u003e \u003e \t{\n\u003e \u003e \t\tvar A = Expression.Parameter(typeof(T));\n\u003e \u003e \t\tvar B = Expression.Parameter(typeof(T));\n\u003e \u003e \t\tvar BODY = Expression.Add(A, B);\n\u003e \u003e \t\tFunction = Expression.Lambda\u003cFunc\u003cT, T, T\u003e\u003e(BODY, A, B).Compile();\n\u003e \u003e \t\treturn Function(a, b);\n\u003e \u003e \t};\n\u003e \u003e }\n\u003e \u003e ```\n\u003e \u003e \n\u003e \u003e You can break type safe-ness using generic types and runtime compilation, and you can store the runtime compilation in a delegate so the only overhead is the invocation of the delegate.\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e ```cs\n\u003e // Logic Fundamentals\n\u003e bool Equate\u003cT\u003e(T a , T b);\n\u003e bool LessThan\u003cT\u003e(T a, T b);\n\u003e bool GreaterThan\u003cT\u003e(T a, T b);\n\u003e CompareResult Compare\u003cT\u003e(T a, T b);\n\u003e \n\u003e // Mathematics Fundamentals\n\u003e T Negation\u003cT\u003e(T a);\n\u003e T Addition\u003cT\u003e(T a, T b);\n\u003e T Subtraction\u003cT\u003e(T a, T b);\n\u003e T Multiplication\u003cT\u003e(T a, T b);\n\u003e T Division\u003cT\u003e(T a, T b);\n\u003e T Remainder\u003cT\u003e(T a, T b);\n\u003e \n\u003e // More Logic\n\u003e bool IsPrime\u003cT\u003e(T a);\n\u003e bool IsEven\u003cT\u003e(T a);\n\u003e bool IsOdd\u003cT\u003e(T a);\n\u003e T Minimum\u003cT\u003e(T a, T b);\n\u003e T Maximum\u003cT\u003e(T a, T b);\n\u003e T Clamp\u003cT\u003e(T value, T floor, T ceiling);\n\u003e T AbsoluteValue\u003cT\u003e(T a);\n\u003e bool EqualityLeniency\u003cT\u003e(T a, T b, T leniency);\n\u003e \n\u003e // More Numerics\n\u003e void FactorPrimes\u003cT\u003e(T a, ...);\n\u003e T Factorial\u003cT\u003e(T a);\n\u003e T LinearInterpolation\u003cT\u003e(T x, T x0, T x1, T y0, T y1);\n\u003e T LeastCommonMultiple\u003cT\u003e(T a, T b, params T[] c);\n\u003e T GreatestCommonFactor\u003cT\u003e(T a, T b, params T[] c);\n\u003e LinearRegression2D\u003cT\u003e(..., out T slope, out T y_intercept);\n\u003e \n\u003e // Statistics\n\u003e T Mean\u003cT\u003e(T a, params T[] b);\n\u003e T Median\u003cT\u003e(params T[] values);\n\u003e Heap\u003cLink\u003cT, int\u003e\u003e Mode\u003cT\u003e(T a, params T[] b);\n\u003e void Range\u003cT\u003e(out T minimum, out T maximum, ...);\n\u003e T[] Quantiles\u003cT\u003e(int quantiles, ...);\n\u003e T GeometricMean\u003cT\u003e(...);\n\u003e T Variance\u003cT\u003e(...);\n\u003e T StandardDeviation\u003cT\u003e(...);\n\u003e T MeanDeviation\u003cT\u003e(...);\n\u003e \n\u003e // Vectors\n\u003e Vector\u003cT\u003e V1 = new Vector\u003cT\u003e(params T[] vector);\n\u003e Vector\u003cT\u003e V2 = new Vector\u003cT\u003e(params T[] vector);\n\u003e Vector\u003cT\u003e V3;\n\u003e T scalar;\n\u003e V3 = -V1;                   // Negate\n\u003e V3 = V1 + V2;               // Add\n\u003e V3 = V1 - V2;               // Subtract\n\u003e V3 = V1 * scalar;           // Multiply\n\u003e V3 = V1 / scalar;           // Divide\n\u003e scalar = V1.DotProduct(V2); // Dot Product\n\u003e V3 = V1.CrossProduct(V2);   // Cross Product\n\u003e V1.Magnitude;               // Magnitude\n\u003e V3 = V1.Normalize();        // Normalize\n\u003e bool equal = V1 == V2;      // Equal\n\u003e \n\u003e // Matrices\n\u003e Matrix\u003cT\u003e M1 = new Matrix\u003cT\u003e(int rows, int columns);\n\u003e Matrix\u003cT\u003e M2 = new Matrix\u003cT\u003e(int rows, int columns);\n\u003e Matrix\u003cT\u003e M3;\n\u003e Vector\u003cT\u003e V2 = new Vector\u003cT\u003e(params T[] vector);\n\u003e Vector\u003cT\u003e V3;\n\u003e T scalar;\n\u003e M3 = -M1;                               // Negate\n\u003e M3 = M1 + M2;                           // Add\n\u003e M3 = M1 - M2;                           // Subtract\n\u003e M3 = M1 * M2;                           // Multiply\n\u003e V3 = M1 * V2;                           // Multiply (vector)\n\u003e M3 = M1 * scalar;                       // Multiply (scalar)\n\u003e M3 = M1 / scalar;                       // Divide\n\u003e M3 = M1 ^ 3;                            // Power\n\u003e scalar = M1.Determinent();              // Determinent\n\u003e M3 = M1.Minor(int row, int column);     // Minor\n\u003e M3 = M1.Echelon();                      // Echelon Form (REF)\n\u003e M3 = M1.ReducedEchelon();               // Reduced Echelon Form (RREF)\n\u003e M3 = M1.Inverse();                      // Inverse\n\u003e M1.DecomposeLowerUpper(ref M2, ref M3); // Lower Upper Decomposition\n\u003e bool equal = M1 == M2;                  // Equal\n\u003e ```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nSymbolic Mathematics \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // Parsing From Linq Expression\n\u003e Expression\u003cFunc\u003cdouble, double\u003e\u003e exp1 = (x) =\u003e 2 * (x / 7);\n\u003e Symbolics.Expression symExp1 = Symbolics.Parse(exp1);\n\u003e \n\u003e // Parsing From String\n\u003e Symbolics.Expression symExp2 = Symbolics.Parse(\"2 * ([x] / 7)\");\n\u003e \n\u003e // Mathematical Simplification\n\u003e Symbolics.Expression simplified = symExp1.Simplify();\n\u003e \n\u003e // Variable Substitution\n\u003e symExp1.Substitute(\"x\", 5);\n\u003e ```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nMeasurement Mathematics \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e \u003cdetails\u003e\n\u003e \u003csummary\u003e\n\u003e Supported Measurements \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003e \u003c/summary\u003e\n\u003e \u003cp\u003e\n\u003e \n\u003e \u003e Here are the currently supported measurement types:\n\u003e \u003e \n\u003e \u003e ```cs\n\u003e \u003e //    Acceleration: Length/Time/Time\n\u003e \u003e //    AngularAcceleration: Angle/Time/Time\n\u003e \u003e //    Angle: Angle\n\u003e \u003e //    AngularSpeed: Angle/Time\n\u003e \u003e //    Area: Length*Length\n\u003e \u003e //    AreaDensity: Mass/Length/Length\n\u003e \u003e //    Density: Mass/Length/Length/Length\n\u003e \u003e //    ElectricCharge: ElectricCharge\n\u003e \u003e //    ElectricCurrent: ElectricCharge/Time\n\u003e \u003e //    Energy: Mass*Length*Length/Time/Time\n\u003e \u003e //    Force: Mass*Length/Time/Time\n\u003e \u003e //    Length: Length\n\u003e \u003e //    LinearDensity: Mass/Length\n\u003e \u003e //    LinearMass: Mass*Length\n\u003e \u003e //    LinearMassFlow: Mass*Length/Time\n\u003e \u003e //    Mass: Mass\n\u003e \u003e //    MassRate: Mass/Time\n\u003e \u003e //    Power: Mass*Length*Length/Time/Time/Time\n\u003e \u003e //    Pressure: Mass/Length/Time/Time\n\u003e \u003e //    Speed: Length/Time\n\u003e \u003e //    Tempurature: Tempurature\n\u003e \u003e //    Time: Time\n\u003e \u003e //    TimeArea: Time*Time\n\u003e \u003e //    Volume: Length*Length*Length\n\u003e \u003e //    VolumeRate: Length*Length*Length/Time\n\u003e \u003e ```\n\u003e \u003e \n\u003e \u003e The measurement types are generated in the *Towel/Measurements/MeasurementTypes.tt* T4 text template file. The unit (enum) definitions are in the *Towel/Measurements/MeasurementUnitDefinitions.cs* file. Both measurment types and unit definitions can be easily added. If you think a measurement type or unit type should be added, please [submit an enhancement issue](https://github.com/ZacharyPatten/Towel/issues/new/choose).\n\u003e \n\u003e \u003c/p\u003e\n\u003e \u003c/details\u003e\n\u003e \n\u003e ```cs\n\u003e // Towel has measurement types to help write scientific code: Acceleration\u003cT\u003e, Angle\u003cT\u003e, Area\u003cT\u003e, \n\u003e // Density\u003cT\u003e, Length\u003cT\u003e, Mass\u003cT\u003e, Speed\u003cT\u003e, Time\u003cT\u003e, Volume\u003cT\u003e, etc.\n\u003e \n\u003e // Automatic Unit Conversion\n\u003e // When you perform mathematical operations on measurements, any necessary unit conversions will\n\u003e // be automatically performed by the relative measurement type (in this case \"Angle\u003cT\u003e\").\n\u003e Angle\u003cdouble\u003e angle1 = (90d, Degrees);\n\u003e Angle\u003cdouble\u003e angle2 = (.5d, Turns);\n\u003e Angle\u003cdouble\u003e result1 = angle1 + angle2; // 270° \n\u003e \n\u003e // Type Safeness\n\u003e // The type safe-ness of the measurement types prevents the miss-use of the measurements. You cannot\n\u003e // add \"Length\u003cT\u003e\" to \"Angle\u003cT\u003e\" because that is mathematically invalid (no operator exists).\n\u003e Length\u003cdouble\u003e length1 = (2d, Yards);\n\u003e object result2 = angle1 + length1; // WILL NOT COMPILE!!!\n\u003e \n\u003e // Simplify The Syntax Even Further\n\u003e // You can use alias to remove the generic type if you want to simplify the syntax even further.\n\u003e using Speedf = Towel.Measurements.Speed\u003cfloat\u003e; // at top of file\n\u003e Speedf speed1 = (5, Meters / Seconds);\n\u003e \n\u003e // Vector + Measurements\n\u003e // You can use the measurement types inside Towel Vectors.\n\u003e Vector\u003cSpeed\u003cfloat\u003e\u003e velocity1 = new Vector\u003cSpeed\u003cfloat\u003e\u003e(\n\u003e \t(1f, Meters / Seconds),\n\u003e \t(2f, Meters / Seconds),\n\u003e \t(3f, Meters / Seconds));\n\u003e Vector\u003cSpeedf\u003e velocity2 = new Vector\u003cSpeedf\u003e(\n\u003e \t(1f, Centimeters / Seconds),\n\u003e \t(2f, Centimeters / Seconds),\n\u003e \t(3f, Centimeters / Seconds));\n\u003e Vector\u003cSpeed\u003cfloat\u003e\u003e velocity3 = velocity1 + velocity2;\n\u003e \n\u003e // Manual Unit Conversions\n\u003e // 1. Index Operator On Measurement Type\n\u003e double angle1_inRadians = angle1[Radians];\n\u003e float speed1_inMilesPerHour = speed1[Miles / Hours];\n\u003e // 2. Static Conversion Methods\n\u003e double angle3 = Angle\u003cdouble\u003e.Convert(7d,\n\u003e \tRadians,  // from\n\u003e \tDegrees); // to\n\u003e double speed2 = Speed\u003cdouble\u003e.Convert(8d,\n\u003e \tMeters / Seconds, // from\n\u003e \tMiles / Hours);   // to\n\u003e double force1 = Force\u003cdouble\u003e.Convert(9d,\n\u003e \tKilograms * Meters / Seconds / Seconds, // from\n\u003e \tGrams * Miles / Hours / Hours);         // to\n\u003e double angle4 = Measurement.Convert(10d,\n\u003e \tRadians,  // from\n\u003e \tDegrees); // to\n\u003e // The unit conversion on the Measurement class\n\u003e // is still compile-time-safe.\n\u003e \n\u003e // Measurement Parsing\n\u003e Speed\u003cfloat\u003e.TryParse(\"20.5 Meters / Seconds\",\n\u003e \tout Speed\u003cfloat\u003e parsedSpeed);\n\u003e Force\u003cdecimal\u003e.TryParse(\".1234 Kilograms * Meters / Seconds / Seconds\",\n\u003e \tout Force\u003cdecimal\u003e parsedForce);\n\u003e ```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nConsole Helpers \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // Just some helper methods for console applications...\n\u003e \n\u003e // wait for keypress to continue an intercept input\n\u003e ConsoleHelper.PromptPressToContinue(...);\n\u003e // generic method for retrieving validated console input\n\u003e ConsoleHelper.GetInput\u003cT\u003e(...);\n\u003e // animated ellipsis character to show processing\n\u003e ConsoleHelper.AnimatedEllipsis(...);\n\u003e // render progress bar in console\n\u003e ConsoleHelper.ProgressBar(...);\n\u003e // Console.ReadLine() with hidden input characters\n\u003e ConsoleHelper.HiddenReadLine();\n\u003e // easily manage int-based console menus\n\u003e ConsoleHelper.IntMenu(...);\n\u003e // preventing console input\n\u003e ConsoleHelper.FlushInputBuffer();\n\u003e ```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nTagAttribute \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // With TagAttribute's you can make value-based attributes so\n\u003e // you don't always have to make your own custom attribute types.\n\u003e // Just \"tag\" a code member with constant values.\n\u003e \n\u003e using System;\n\u003e using Towel;\n\u003e \n\u003e var (Found, Value) = typeof(MyClass).GetTag(\"My Tag\");\n\u003e Console.WriteLine(\"My Tag...\");\n\u003e Console.WriteLine(\"Found: \" + Found);\n\u003e Console.WriteLine(\"Value: \" + Value);\n\u003e \n\u003e [Tag(\"My Tag\", \"hello world\")]\n\u003e public class MyClass { }\n\u003e ```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nSLazy\u0026lt;T\u0026gt; + ValueLazy\u0026lt;T\u0026gt; \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // SLazy\u003cT\u003e is a faster Lazy\u003cT\u003e when using the default\n\u003e // LazyThreadSafetyMode.ExecutionAndPublication setting.\n\u003e \n\u003e SLazy\u003cstring\u003e slazy = new(() =\u003e \"hello world\");\n\u003e Console.WriteLine(slazy.IsValueCreated); // False\n\u003e Console.WriteLine(slazy.Value);          // hello world\n\u003e Console.WriteLine(slazy.IsValueCreated); // True\n\u003e \n\u003e // ValueLazy\u003cT\u003e is even faster than SLazy\u003cT\u003e but it \n\u003e // is unsafe as it will potentially call the factory\n\u003e // delegate multiple times if the struct is copied.\n\u003e // So please use ValueLazy\u003cT\u003e with caution.\n\u003e\n\u003e // There are various types for supporting no multithread lock,\n\u003e // no exception caching, and publication only locks.\n\u003e ```\n\u003e \n\u003e \u003e [Initialization Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/LazyInitializationBenchmarks.html)\u003cbr/\u003e\n\u003e \u003e [Caching Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/LazyCachingBenchmarks.html)\u003cbr/\u003e\n\u003e \u003e [Construction Benchmarks](https://zacharypatten.github.io/Towel/benchmarks/LazyConstructionBenchmarks.html)\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nSpanBuilder\u0026lt;T\u0026gt; + SStringBuilder \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // SpanBuilder\u003cchar\u003e is a small helper for initializing\n\u003e // stack allocated spans.\n\u003e SpanBuilder\u003cchar\u003e span = stackalloc char[10];\n\u003e span.AppendLine(\"ab\");\n\u003e\n\u003e // SStringBuilder is a small helper for initializing strings.\n\u003e // It will append to the span until the capacity is reached\n\u003e // and then it will revert to a StringBuilder if necessary\n\u003e // rather than throwing like SpanBuilder\u003cT\u003e does.\n\u003e SStringBuilder\u003cchar\u003e span = stackalloc char[10];\n\u003e span.AppendLine(\"abcdefghijklmnopqrstuvwxyz\");\n\u003e ```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\nCommand Line Parser \u003csub\u003e[Expand]\u003c/sub\u003e\n\u003c/summary\u003e\n\u003cp\u003e\n\n\u003e ```cs\n\u003e // Just put the [Command] attribute on any method you want to call\n\u003e // from the command line, and call the \"HandleArguments\" method.\n\u003e\n\u003e using System;\n\u003e using static Towel.CommandLine;\n\u003e\n\u003e public static class Program\n\u003e {\n\u003e \tpublic static void Main(string[] args)\n\u003e \t{\n\u003e \t\tHandleArguments(args);\n\u003e \t}\n\u003e\n\u003e \t[Command]\n\u003e \tpublic static void A(int a)\n\u003e \t{\n\u003e \t\tConsole.WriteLine(nameof(A) + \" called\");\n\u003e \t\tConsole.WriteLine(nameof(a) + \": \" + a);\n\u003e \t}\n\u003e }\n\u003e\n\u003e // output:\n\u003e // dotnet run A --a 7\n\u003e // A called\n\u003e // a: 7\n\u003e ```\n\n\u003c/p\u003e\n\u003c/details\u003e\n","funding_links":[],"categories":["Algorithms and Data structures","算法与数据结构","高性能数据结构和算法"],"sub_categories":["FPS"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZacharyPatten%2FTowel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZacharyPatten%2FTowel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZacharyPatten%2FTowel/lists"}