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

Vectors should be compatible with columns wherever possible #113

Closed
alexdubbs opened this issue Jul 15, 2011 · 4 comments
Closed

Vectors should be compatible with columns wherever possible #113

alexdubbs opened this issue Jul 15, 2011 · 4 comments
Labels
kind:bug Indicates an unexpected problem or unintended behavior

Comments

@alexdubbs
Copy link

You need to double-transpose vectors to make them into 1-column matrices so that
you can add them to 1-column matrices or multiply them with one-row matrices (on
either side).

@ViralBShah
Copy link
Member

We need a general way to address this throughout our array implementation.

@JeffBezanson
Copy link
Sponsor Member

I tried the following cases and they all worked:

a=rand(3,3); v= rand(3);
a[:,1]=v
a[1,:]=v
a[:,1]+v
a[1,:]*v
v*a[1,:]

And this works but there's an issue saying maybe it shouldn't:

a[1,:]+v

Can we find any examples of cases that are still failing?

@JeffBezanson
Copy link
Sponsor Member

Due to our improved error checking, this happens:

julia> [1 2 3]' + [1,2,3]
argument dimensions must match
in +, /home/jeff/src/julia2/julia/j/abstractarray.j:203

Should we define dims_match(a,b) that allows dims to match in the presence of trailing ones?

@JeffBezanson
Copy link
Sponsor Member

Duplicate of #231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants