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

scale and scale! have redundant methods #13690

Closed
jiahao opened this issue Oct 20, 2015 · 4 comments
Closed

scale and scale! have redundant methods #13690

jiahao opened this issue Oct 20, 2015 · 4 comments
Labels
good first issue Indicates a good issue for first-time contributors to Julia

Comments

@jiahao
Copy link
Member

jiahao commented Oct 20, 2015

The base library contains many different methods for scale and scale! which look like they are pre- and post-multiplicative variants, but are actually not. For example:

scale(x::Number, y::Vector) = x * y
scale(x::Vector, y::Number) = x * y

These methods are redundant when the product is commutative, and they are wrong when it is not (e.g. quaternions, which are clearly <: Number).

We should either

  1. Delete half of these methods so that scale-ing only means either pre- or post-multiplication, or
  2. Fix the existing methods to not assume commutativity, i.e. distinguish between pre- or post-multiplications.
@StefanKarpinski
Copy link
Member

Fixing it to not assume commutativity seems best.

@kshyatt kshyatt added the good first issue Indicates a good issue for first-time contributors to Julia label Nov 25, 2015
@sarvghotra
Copy link
Contributor

Made a pull request #14402.

tkelman added a commit that referenced this issue Jan 6, 2016
RFC: Fixed scale and scale1 methods to not assume commutativity. Issue #13690
@pkofod
Copy link
Contributor

pkofod commented Apr 28, 2016

Fixed by #14425 ?

@ivarne
Copy link
Member

ivarne commented Apr 28, 2016

Seems like it was.

@ivarne ivarne closed this as completed Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors to Julia
Projects
None yet
Development

No branches or pull requests

6 participants