-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
230 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Differentiation | ||
|
||
Given a polynomial, say ``p(x, y) = 3x^2y + x + 2y + 1``, we can differentiate it by a variable, say ``x`` and get ``\partial p(x, y) / \partial x = 6xy + 1``. | ||
We can also differentiate it by both of its variable and get the vector ``[6xy+1, 3x^2+1]``. | ||
|
||
```@docs | ||
differentiate | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Division | ||
|
||
The `gcd` and `lcm` functions of `Base` have been implemented for monomials, you have for example `gcd(x^2*y^7*z^3, x^4*y^5*z^2)` returning `x^2*y^5*z^2` and `lcm(x^2*y^7*z^3, x^4*y^5*z^2)` returning `x^4*y^7*z^3`. | ||
|
||
Given two polynomials, ``p`` and ``d``, there are unique ``r`` and ``q`` such that ``p = q d + r`` and the leading term of ``d`` does not divide the leading term of ``r``. | ||
You can obtain ``q`` using the `div` function and ``r`` using the `rem` function. | ||
The `divrem` function returns ``(q, r)``. | ||
|
||
Given a polynomial ``p`` and divisors ``d_1, \ldots, d_n``, one can find ``r`` and ``q_1, \ldots, q_n`` such that ``p = q_1 d_1 + \cdots + q_n d_n + r`` and none of the leading terms of ``q_1, \ldots, q_n`` divide the leading term of ``r``. | ||
You can obtain the vector ``[q_1, \ldots, q_n]`` using `div(p, d)` where ``d = [d_1, \ldots, d_n]`` and ``r`` using the `rem` function with the same arguments. | ||
The `divrem` function returns ``(q, r)``. | ||
|
||
```@docs | ||
divides | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
# MultivariatePolynomials | ||
|
||
[MultivariatePolynomials.jl](https://github.com/blegat/MultivariatePolynomials.jl) is an implementation independent library for manipulating multivariate polynomials. | ||
It defines abstract types and an API for multivariate monomials, terms, polynomials, moments and measures and gives default implementation for common operations on them using the API. | ||
If you want to manipulate multivariate polynomials easily and efficiently while being able to easily switch between different implementations, this library is exactly what you are looking for. | ||
It defines abstract types and an API for multivariate monomials, terms, polynomials and gives default implementation for common operations on them using the API. | ||
|
||
Supported operations are : basic arithmetic, rational polynomials, differentiation and evaluation/substitution, division and duality operations between polynomials and moments. | ||
There is also support for solving systems of equations (soon!) and building (semi)algebraic sets. | ||
On the one hand, This packages allows you to implement algorithms on multivariate polynomials that will be independant on the representation of the polynomial that will be chosen by the user. | ||
On the other hand, it allows the user to easily switch between different representations of polynomials to see which one is faster for the algorithm that he is using. | ||
|
||
Currently, the following implementations are available: | ||
Supported operations are : basic arithmetic, rational polynomials, evaluation/substitution, differentiation and division. | ||
|
||
* [TypedPolynomials](https://github.com/rdeits/TypedPolynomials.jl) | ||
* [DynamicPolynomials](https://github.com/blegat/DynamicPolynomials.jl) | ||
The following packages provide representations of multivariate polynomials that implement the interface: | ||
|
||
* [TypedPolynomials](https://github.com/rdeits/TypedPolynomials.jl) : Commutative polynomials of arbitrary coefficient types | ||
* [DynamicPolynomials](https://github.com/blegat/DynamicPolynomials.jl) : Commutative and non-commutative polynomials of arbitrary coefficient types | ||
|
||
The following packages extend the interface and/or implement algorithms using the interface: | ||
|
||
* [SemialgebraicSets](https://github.com/blegat/SemialgebraicSets.jl) : Sets defined by inequalities and equalities between polynomials and algorithms for solving polynomial systems of equations. | ||
* [HomotopyContinuation](https://github.com/saschatimme/HomotopyContinuation.jl) : Solving systems of polynomials via homotopy continuation. | ||
* [MultivariateMoments](https://github.com/blegat/MultivariateMoments.jl) : Moments of multivariate measures and their scalar product with polynomials. | ||
* [PolyJuMP](https://github.com/JuliaOpt/PolyJuMP.jl) : A [JuMP](https://github.com/JuliaOpt/JuMP.jl) extension for Polynomial Optimization. | ||
* [SumOfSquares](https://github.com/JuliaOpt/SumOfSquares.jl) : Certifying the nonnegativity of polynomials, minimizing/maximizing polynomials and optimization over sum of squares polynomials using Sum of Squares Programming. | ||
|
||
## Contents | ||
```@contents | ||
Pages = ["apireference.md"] | ||
Pages = ["types.md", "substitution.md", "differentiation.md", "division.md"] | ||
Depth = 3 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Subtitution | ||
|
||
Given a polynomial, say ``p(x, y) = 3x^2y + x + 2y + 1``, one can evaluate it at a given point, e.g. ``p(2, 1) = 12 + 2 + 2 + 1 = 17`` or substitute one or more variable by a value or polynomial, e.g. ``p(x, xy^2 + 1) = 3x^2(xy^2+1) + x + 2(xy^2+1) + 1 = 3x^3y^2 + 2xy^2 + 3x^2 + x + 3``. | ||
We distinguish the two operation as follows | ||
|
||
* We call an evaluation an operation where **every** variable should be replace by a new value or polynomial, the syntax is `p(x => 2, y => 1)`. | ||
* We call a subsitution an operation where **some** (or all variables) are subtituted into a new value or polynomial, the syntax is `subs(p, y => x*y^2 + 1)`. | ||
|
||
The distinction is important for type stability for some implementations (it is important for [DynamicPolynomials](https://github.com/blegat/DynamicPolynomials.jl) but not for [TypedPolynomials](https://github.com/rdeits/TypedPolynomials.jl)). | ||
Indeed consider a polynomial with `Int` coefficients for which we ask to replace some variables with `Int` values. If all the variables are replaced with `Int`s, the return type should be `Int`. | ||
However, if some variables only are replaced by `Int` then the return type should be a polynomial with `Int` coefficients. | ||
|
||
```@docs | ||
subs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.