Skip to content

Commit

Permalink
Complex-valued variables (#213)
Browse files Browse the repository at this point in the history
* First draft for complex-valued interface

* Adjust imaginary part

* Slight updates

* Add exports

* Rename ordvar to ordinary_variable

* Change assert to error

* Code style

* Remove real_coefficient_type_polynomial_like

* Change comparisons to comparison functions

* Explain _show in comment

* Shortcuts for conj

* Add explicit isreal/iscomplex for monomial vectors

* Fix

* Improve real/imag of APL

* Replace zip by powers

Co-authored-by: Benoît Legat <[email protected]>

* Fix

* Explain choice of function signature

* Format

* Documentation

* Fix iscomplex detection

* Docstring update, new function spelling

* Test for complex case

* Remove missing references to Base functions

* Format test

* Format

* Compatibility in tests

* Fix adjoint issues with new interface

* Revert APL adjoint implementation (mutable coefficients would be aliased)

* Add copy_if_mutable safeguards

* Remove complex branch CI

* Update src/complex.jl

Co-authored-by: Benoît Legat <[email protected]>

* Update src/complex.jl

Co-authored-by: Benoît Legat <[email protected]>

* Update src/complex.jl

Co-authored-by: Benoît Legat <[email protected]>

* Avoid splatting

* Remove iscomplex

* Improve documentation

---------

Co-authored-by: Benoît Legat <[email protected]>
  • Loading branch information
projekter and blegat authored Oct 6, 2023
1 parent 953a19b commit d1f41c5
Show file tree
Hide file tree
Showing 9 changed files with 494 additions and 9 deletions.
24 changes: 24 additions & 0 deletions docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ name_base_indices
variable_union_type
similar_variable
@similar_variable
conj(::AbstractVariable)
real(::AbstractVariable)
imag(::AbstractVariable)
isreal(::AbstractVariable)
isrealpart
isimagpart
isconj
ordinary_variable
```

## Monomials
Expand Down Expand Up @@ -47,6 +55,8 @@ coefficient_type
monomial
constant_term
zero_term
degree_complex
halfdegree
```

## Polynomials
Expand Down Expand Up @@ -75,6 +85,16 @@ monic
map_coefficients
map_coefficients!
map_coefficients_to!
conj(::_APL)
real(::_APL)
imag(::_APL)
isreal(::_APL)
mindegree_complex
minhalfdegree
maxdegree_complex
maxhalfdegree
extdegree_complex
exthalfdegree
```

## Rational Polynomial Function
Expand All @@ -90,4 +110,8 @@ monomial_vector_type
empty_monomial_vector
sort_monomial_vector
merge_monomial_vectors
conj(::AbstractVector{<:AbstractMonomial})
real(::AbstractVector{<:AbstractMonomial})
imag(::AbstractVector{<:AbstractMonomial})
isreal(::AbstractVector{<:AbstractMonomial})
```
1 change: 1 addition & 0 deletions src/MultivariatePolynomials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ include("hash.jl")
include("promote.jl")
include("conversion.jl")

include("complex.jl")
include("operators.jl")
include("comparison.jl")

Expand Down
Loading

0 comments on commit d1f41c5

Please sign in to comment.