Class EuclideanAlgorithm<E>
java.lang.Object
dk.jonaslindstrom.ruffini.common.algorithms.EuclideanAlgorithm<E>
- Type Parameters:
E
- Element type.
Implementation of the Euclidean algorithm for computing the greatest common divisor of two elements
in a Euclidean domain.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyExtended
(E... inputs) applyExtended
(E a, E b) Calculate the greatest common divisor d of a and b, and the coefficients x,y of the Bezout identity ax + by = d .applyExtended
(List<E> inputs)
-
Constructor Details
-
EuclideanAlgorithm
-
-
Method Details
-
apply
-
apply
-
apply
-
applyExtended
Calculate the greatest common divisor d of a and b, and the coefficients x,y of the Bezout identity ax + by = d .- Returns:
- The triple (d, x, y).
-
applyExtended
-
applyExtended
-