Skip to content

Commit d1f41c5

Browse files
projekterblegat
andauthored
Complex-valued variables (#213)
* 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]>
1 parent 953a19b commit d1f41c5

9 files changed

+494
-9
lines changed

docs/src/types.md

+24
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ name_base_indices
1414
variable_union_type
1515
similar_variable
1616
@similar_variable
17+
conj(::AbstractVariable)
18+
real(::AbstractVariable)
19+
imag(::AbstractVariable)
20+
isreal(::AbstractVariable)
21+
isrealpart
22+
isimagpart
23+
isconj
24+
ordinary_variable
1725
```
1826

1927
## Monomials
@@ -47,6 +55,8 @@ coefficient_type
4755
monomial
4856
constant_term
4957
zero_term
58+
degree_complex
59+
halfdegree
5060
```
5161

5262
## Polynomials
@@ -75,6 +85,16 @@ monic
7585
map_coefficients
7686
map_coefficients!
7787
map_coefficients_to!
88+
conj(::_APL)
89+
real(::_APL)
90+
imag(::_APL)
91+
isreal(::_APL)
92+
mindegree_complex
93+
minhalfdegree
94+
maxdegree_complex
95+
maxhalfdegree
96+
extdegree_complex
97+
exthalfdegree
7898
```
7999

80100
## Rational Polynomial Function
@@ -90,4 +110,8 @@ monomial_vector_type
90110
empty_monomial_vector
91111
sort_monomial_vector
92112
merge_monomial_vectors
113+
conj(::AbstractVector{<:AbstractMonomial})
114+
real(::AbstractVector{<:AbstractMonomial})
115+
imag(::AbstractVector{<:AbstractMonomial})
116+
isreal(::AbstractVector{<:AbstractMonomial})
93117
```

src/MultivariatePolynomials.jl

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ include("hash.jl")
7777
include("promote.jl")
7878
include("conversion.jl")
7979

80+
include("complex.jl")
8081
include("operators.jl")
8182
include("comparison.jl")
8283

0 commit comments

Comments
 (0)