Skip to content

Commit 787e387

Browse files
committed
Add documentation for new differentiate behaviour
1 parent 7a7702a commit 787e387

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/differentiation.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ will help the compiler infer the return type.
1717
differentiate(p::AbstractArray{<:AbstractPolynomialLike, N}, vs, deg::Union{Int, Val}=1) where N
1818
1919
Differentiate the polynomials in `p` by the variables of the vector or tuple of variable `vs` and return an array of dimension `N+deg`.
20+
If `p` is an `AbstractVector` this returns the Jacobian of `p` where the i-th row containts the partial
21+
derivaties of `p[i]`.
2022
2123
### Examples
2224
@@ -25,6 +27,7 @@ p = 3x^2*y + x + 2y + 1
2527
differentiate(p, x) # should return 6xy + 1
2628
differentiate(p, x, Val{1}()) # equivalent to the above
2729
differentiate(p, (x, y)) # should return [6xy+1, 3x^2+1]
30+
differentiate( [x^2+y, z^2+4x], [x, y, z]) # should return [2x 1 0; 4 0 2z]
2831
```
2932
"""
3033
function differentiate end

0 commit comments

Comments
 (0)