diophantine

package
v0.0.0-...-78fa8ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeLinearDiophantine

func ComputeLinearDiophantine[T constraints.Integer](a, b, c T) (hasSolutions bool, gcd T, x, y int)

See https://cp-algorithms.com/algebra/linear-diophantine-equation.html#algorithmic-solution Given ax+by=c returns: - if it has solutions (zero or infinite) - gcd(a,b) - one solution

func ExtendedEuclideanAlgorithm

func ExtendedEuclideanAlgorithm[T constraints.Integer](a, b T) (gcd T, x, y int)

gcd can be negative source: https://cp-algorithms.com/algebra/extended-euclid-algorithm.html#algorithm Assumptions: - At least one != 0

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL