Skip to content
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

Combine terms in multiplication and addition #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

magistere
Copy link
Contributor

No description provided.

@@ -137,6 +137,9 @@ function simplify(::SymbolParameter{:+}, args)
# Special Case: simplify(:(+x)) == x
elseif length(new_args) == 1
return new_args[1]
# Special Case: simplify(:(x + x + x)) == 3*x
elseif all(new_args .== new_args[1])
return Expr(:call, :*, new_args[1], length(new_args))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't this be just as good if you were using :.*?

@magistere
Copy link
Contributor Author

@ivarne, now there are no dotted * and ^ in package source code. Is it justified enough to complicate code with matrix operations usage? I'm not sure. In my view it will be better to restrict to real numbers as @johnmyleswhite said in #24 discussion. But this is still open question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants