Skip to content

Commit

Permalink
Merge pull request #187 from JuliaSymbolics/myb/expand
Browse files Browse the repository at this point in the history
Overload expand
  • Loading branch information
YingboMa authored Apr 7, 2021
2 parents 27eca59 + abd3217 commit d08deed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Symbolics"
uuid = "0c5d862f-8b57-4792-8d23-62f2024744c7"
authors = ["Shashi Gowda <[email protected]>"]
version = "0.1.16"
version = "0.1.17"

[deps]
AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
Expand Down
1 change: 1 addition & 0 deletions src/num.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function Base.show(io::IO, z::Complex{<:Num})
end

SymbolicUtils.simplify(n::Num; kw...) = Num(SymbolicUtils.simplify(value(n); kw...))
SymbolicUtils.expand(n::Num) = Num(SymbolicUtils.expand(value(n)))
"""
substitute(expr, s::Dict)
Expand Down
3 changes: 3 additions & 0 deletions test/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,6 @@ x = Num.(randn(10))
@test isequal(norm(x, Inf), max(abs(x[1]), abs(x[2])))
@test isequal(norm(x, 1), abs(x[1]) + abs(x[2]))
@test isequal(norm(x, 1.2), (abs(x[1])^1.2 + abs(x[2])^1.2)^(1/1.2))

@variables x y
@test isequal(expand((x+y)^2), x^2 + y^2 + 2x*y)

2 comments on commit d08deed

@YingboMa
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/33737

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.17 -m "<description of version>" d08deedaa5c519b71e3a35cfbec5d524ef61ea78
git push origin v0.1.17

Please sign in to comment.