Packages

A high-performance implementation of the greatest common divisor (GCD) algorithm that combines binary GCD with Lehmer's algorithm for optimal performance on large integers.

Current section

Files

Jump to
Raw

mix.exs

defmodule BinaryLehmerGcd.MixProject do
use Mix.Project
def project do
[
app: :binary_lehmer_gcd,
version: "1.0.0",
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
name: "Binary lehmer gcd",
description:
"A high-performance implementation of the greatest common divisor (GCD) algorithm that combines binary GCD with Lehmer's algorithm for optimal performance on large integers.",
docs: docs(),
package: package(),
aliases: aliases(),
dialyzer: dialyzer()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
]
end
def docs do
[
main: "readme",
extras: ["README.md", "LICENSE.md", "CHANGELOG.md"],
before_closing_head_tag: &before_closing_head_tag/1,
before_closing_body_tag: &before_closing_body_tag/1
]
end
defp before_closing_head_tag(:html) do
"""
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/katex-copytex@1.0.2/dist/katex-copytex.min.css" rel="stylesheet" type="text/css">
<script defer src="https://cdn.jsdelivr.net/npm/katex-copytex@1.0.2/dist/katex-copytex.min.js" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script>
<script>
window.addEventListener("exdoc:loaded", () => {
renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
]
})
})
</script>
"""
end
defp before_closing_head_tag(:epub), do: ""
defp before_closing_body_tag(:html) do
"""
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/katex-copytex@1.0.2/dist/katex-copytex.min.css" rel="stylesheet" type="text/css">
<script defer src="https://cdn.jsdelivr.net/npm/katex-copytex@1.0.2/dist/katex-copytex.min.js" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.4/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script>
<script>
window.addEventListener("exdoc:loaded", () => {
renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
]
})
})
</script>
"""
end
defp before_closing_body_tag(:epub), do: ""
def package do
[
name: :binary_lehmer_gcd,
licenses: ["Apache-2.0"],
links: %{"GitHub" => "https://github.com/zacky1972/binary_lehmer_gcd"}
]
end
def aliases do
[
check: [
"hex.audit",
"compile --warnings-as-errors --force",
"format --check-formatted",
"credo",
"deps.unlock --check-unused",
"spellweaver.check",
"dialyzer"
]
]
end
def dialyzer do
[
plt_add_apps: [:mix],
ignore_warnings: ".dialyzer_ignore.exs"
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:bit_length, "~> 1.0"},
{:trailing_zeros, "~> 1.0"},
{:nstandard, "~> 0.1"},
{:lehmer_gcd, "~> 1.0", only: [:test], runtime: false},
{:ex_doc, "~> 0.31", only: [:dev, :test], runtime: false},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:spellweaver, "~> 0.1", only: [:dev, :test], runtime: false}
# {:dep_from_hexpm, "~> 0.3.0"},
# {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
]
end
end