Skip to content

New design : implementation independent API #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Aug 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d709c2a
Fix v0.6 warnings and drop v0.5
blegat Apr 26, 2017
32e00db
Updates for TypedPolynomials
blegat Apr 26, 2017
da4917d
Reenable poly.jl
blegat Apr 27, 2017
845b1fc
Updates for newer version of TypedPolynomials
blegat Apr 27, 2017
4e3e5a2
example1 and example2 now work
blegat May 25, 2017
85dfd80
Make exp/measure/rational implementation independent
blegat Jul 8, 2017
d9edc0c
Big rewrite
blegat Jul 10, 2017
122c35e
Fix rational
blegat Jul 12, 2017
2f95508
Fix comp
blegat Jul 13, 2017
bde13a5
Fix promote
blegat Jul 13, 2017
fae284b
Fix alg
blegat Jul 13, 2017
1daada8
Fix diff
blegat Jul 13, 2017
af934b2
Fix hash
blegat Jul 13, 2017
a009287
Fix div
blegat Jul 13, 2017
6dc4417
Add @set macro from PolyJuMP @joehuchette
blegat Jul 13, 2017
a9f95a6
Update substitution
blegat Aug 5, 2017
2ac42af
term -> constantterm
blegat Aug 6, 2017
cc82a87
Updates to make TypedPolynomials work
blegat Aug 7, 2017
49ce343
Improve show
blegat Aug 7, 2017
d963e63
Rename vars, nvars -> variables, nvariables
blegat Aug 8, 2017
09a8a58
Redesign tests
blegat Aug 8, 2017
b3dadf2
Add substitition credit
blegat Aug 8, 2017
4dedd45
Makes mono tests easier for TypedPoly
blegat Aug 8, 2017
e531772
Fix Julia v0.7 warning
blegat Aug 9, 2017
777f717
Makes TypedPolynomials pass mono.jl tests
blegat Aug 9, 2017
ac9df80
Make TypedPolynomials pass poly tests
blegat Aug 10, 2017
a6553b2
Make TypedPolynomials pass comp.jl tests
blegat Aug 10, 2017
f5acb12
Make TypedPolynomials pass alg tests
blegat Aug 10, 2017
0a2ebf5
TypedPolynomials pass everything up to subs
blegat Aug 11, 2017
336d477
WIP
blegat Aug 11, 2017
6948648
Make TypedPolynomials pass all the tests
blegat Aug 11, 2017
907ed6e
Remove MatMeasure
blegat Aug 11, 2017
987e6d8
Fix Travis, appveyor
blegat Aug 12, 2017
7e632ea
Add tests
blegat Aug 12, 2017
8ef75f7
Remove exp and measure
blegat Aug 12, 2017
c6ebd42
Fix appveyor.yml
blegat Aug 12, 2017
45bbc00
Add tests
blegat Aug 12, 2017
fa66e08
Add tests
blegat Aug 12, 2017
0567d8c
Add tests
blegat Aug 12, 2017
6875015
Add tests
blegat Aug 12, 2017
bdf5351
Add tests
blegat Aug 12, 2017
c7bec44
Add tests
blegat Aug 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ julia:
- nightly
notifications:
email: false
# uncomment the following lines to override the default test script
#script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'Pkg.clone(pwd()); Pkg.build("MultivariatePolynomials"); Pkg.test("MultivariatePolynomials"; coverage=true)'
matrix:
allow_failures:
- julia: nightly
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone(pwd()); Pkg.clone("https://github.com/blegat/DynamicPolynomials.jl"); Pkg.clone("https://github.com/rdeits/TypedPolynomials.jl"); Pkg.checkout("TypedPolynomials", "typed"); Pkg.build("MultivariatePolynomials"); Pkg.test("MultivariatePolynomials"; coverage=true)'
after_success:
# push coverage results to Coveralls
- julia -e 'cd(Pkg.dir("MultivariatePolynomials")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("MultivariatePolynomials")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
# update doc
- julia -e 'Pkg.add("Documenter")'
- julia -e 'cd(Pkg.dir("MultivariatePolynomials")); include(joinpath("docs", "make.jl"))'
3 changes: 1 addition & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
julia 0.5
Compat 0.17
julia 0.6
6 changes: 5 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"MultivariatePolynomials\"); Pkg.build(\"MultivariatePolynomials\")"
Pkg.clone(pwd(), \"MultivariatePolynomials\");
Pkg.clone(\"https://github.com/blegat/DynamicPolynomials.jl\");
Pkg.clone(\"https://github.com/rdeits/TypedPolynomials.jl\");
Pkg.checkout(\"TypedPolynomials\", \"typed\");
Pkg.build(\"MultivariatePolynomials\")"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"MultivariatePolynomials\")"
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
19 changes: 19 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Documenter, MultivariatePolynomials

makedocs(
format = :html,
sitename = "MultivariatePolynomials",
pages = [
"Introduction" => "index.md",
"Reference" => "apireference.md",
]
)

deploydocs(
repo = "github.com/blegat/MultivariatePolynomials.jl.git",
target = "build",
osname = "linux",
julia = "0.6",
deps = nothing,
make = nothing,
)
50 changes: 50 additions & 0 deletions docs/src/apireference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
```@meta
CurrentModule = MultivariatePolynomials
```

# API

## Variables

```@docs
name
```

## Terms

```@docs
term
zeroterm
coefficient
monomial
exponent
deg
isconstant
divides
```

## Polynomials

```@docs
terms
monomials
mindeg
maxdeg
extdeg
leadingterm
leadingcoefficient
leadingmonomial
removeleadingterm
removemonomials
vars
nvars
```

## Monomial Vectors

```@docs
monovec
monovectype
sortmonovec
mergemonovec
```
18 changes: 18 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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.

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.

Currently, the following implementations are available:

* [TypedPolynomials](https://github.com/rdeits/TypedPolynomials.jl)
* [DynamicPolynomials](https://github.com/blegat/DynamicPolynomials.jl)

```@contents
Pages = ["apireference.md"]
Depth = 3
```
42 changes: 23 additions & 19 deletions src/MultivariatePolynomials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,40 @@ __precompile__()

module MultivariatePolynomials

using Compat
#using DocStringExtensions

import Base: show, length, getindex, vect, isless, isempty, start, done, next, convert, dot, copy, eltype, zero, one
import Base: *, +, -, /, ^, ==,
promote_rule, convert, show, isless, size, getindex,
one, zero, transpose, isapprox, @pure, dot, copy

@compat abstract type PolyType{C} end
export iscomm
iscomm{C}(::PolyType{C}) = C
zero{C}(::Type{PolyType{C}}) = zero(Polynomial{C, Int})
one{C}(::Type{PolyType{C}}) = one(Polynomial{C, Int})
zero{C}(p::PolyType{C}) = zero(PolyType{C})
one{C}(p::PolyType{C}) = one(PolyType{C})
export AbstractPolynomialLike, AbstractTermLike, AbstractMonomialLike
abstract type AbstractPolynomialLike{T} end
abstract type AbstractTermLike{T} <: AbstractPolynomialLike{T} end
abstract type AbstractMonomialLike <: AbstractTermLike{Int} end

export AbstractVariable, AbstractMonomial, AbstractTerm, AbstractPolynomial
abstract type AbstractVariable <: AbstractMonomialLike end
abstract type AbstractMonomial <: AbstractMonomialLike end
abstract type AbstractTerm{T} <: AbstractTermLike{T} end
abstract type AbstractPolynomial{T} <: AbstractPolynomialLike{T} end

const APL{T} = AbstractPolynomialLike{T}

include("zip.jl")
include("mono.jl")
include("term.jl")
include("poly.jl")

include("rational.jl")
include("measure.jl")
include("exp.jl")

include("conversion.jl")
include("promote.jl")
include("substitution.jl")

include("operators.jl")
include("comp.jl")

include("alg.jl")
include("calg.jl")
include("ncalg.jl")

include("diff.jl")
include("subs.jl")
include("algebraicset.jl")
include("norm.jl")

include("div.jl")

include("show.jl")
Expand Down
27 changes: 0 additions & 27 deletions src/alg.jl

This file was deleted.

37 changes: 0 additions & 37 deletions src/algebraicset.jl

This file was deleted.

Loading