This module's API reference is not yet ready.
This API is bloated for no reason. It will be revised and simplified until there are more diverse use cases.
There is thought to move polynomials API to "Algebraic Extra" module.
Kone: Polynomial
This module extends module "algebraic" and provides the basic concept of working with univariate and multivariate polynomials and rational functions over any specified ring in so-called polynomial and rational functions spaces and their implementations.
Applying the dependencies
- Gradle Kotlin DSL
- Gradle Groovy DSL
- Maven
dependencies {
implementation("dev.lounres:kone.polynomial:0.0.0-experiment")
}
dependencies {
implementation 'dev.lounres:kone.polynomial:0.0.0-experiment'
}
<dependency>
<groupId>dev.lounres</groupId>
<artifactId>kone.polynomial</artifactId>
<version>0.0.0-experiment</version>
</dependency>
💭 Concept: "polynomial" and other terms
Let us remind common terms and introduce Kone-specific ones:
- Free variable or indeterminate is just a formal symbol. Like , , , , , , , etc.
In Kone variable can be described as absolutely arbitrary string wrapped in
LabeledVariable
value class. - Monomial or term of polynomial (over a ring ) is a formal finite (associative commutative) product of an element of and free variables. If used variables are , , ..., , then monomial is usually represented as a product for some natural . is called a coefficient of the monomial and mapping is called signature of the monomial.
- Polynomial (over a ring ) is a formal finite (associative commutative) sum of monomials.
- If a polynomial does not involve any variable (it is equal to an element of the ring ), it is called constant. If it involves a single variable, it is called univariate. If it involves several variables, it is called multivariate.
- Polynomials of variables , ..., over ring form a ring that is called polynomial space over and is denoted as .
- Given a total order on signatures, the term with the greatest signature is called a leading term of the polynomial. Its coefficient is called a leading coefficient of the polynomial. And its signature is called a leading signature of the polynomial.
Polynomial spaces interfaces
In a polynomial space over ring R
we specify algebraic operations on polynomials,
and algebraic operations on polynomials and constants.
See API reference for
PolynomialSpace
and MultivariatePolynomialSpace
.
There are also division operations in case of a field R
See PolynomialSpaceOverField
and MultivariatePolynomialSpaceOverField
.
Implementations of polynomial spaces
In Kone, there are two types of polynomial representation:
- One can represent a univariate polynomial as a list .
ListPolynomial
implements this behaviour. - One can represent a multivariate polynomial
as a map
where each is a signature of
and is represented as a map .
LabelledPolynomial
implements this behaviour.
Both types of polynomials have associated polynomial spaces (
ListPolynomialSpace
and LabelledPolynomial
)
that are constructed on provided ring.
Rational functions spaces interfaces
In a rational functions space over ring R
we specify algebraic operations on constants, polynomials, (variables,) and rational functions.
See API reference for
RationalFunctionSpace
and RationalFunctionSpaceOverField
.
Implementations of rational functions spaces
In Kone, there are two types of rational functions:
ListRationalFunction
and LabeledRationalFunction
.
They both are just represented as fractions of corresponding polynomial types.
Both types of rational functions have associated spaces (
ListRationalFunctionSpace
and LabeledRationalFunctionSpace
)
that are constructed on provided ring.