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

Can add vector to 1xn matrix #141

Closed
ghost opened this issue Jul 22, 2011 · 6 comments
Closed

Can add vector to 1xn matrix #141

ghost opened this issue Jul 22, 2011 · 6 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@ghost
Copy link

ghost commented Jul 22, 2011

You can in Julia, can't in MATLAB.

@StefanKarpinski
Copy link
Member

Is this a bug or what?

@JeffBezanson
Copy link
Member

Just a difference from matlab to consider.

@ViralBShah
Copy link
Member

This whole equating of vectors to a 1xn or nx1 matrix is going to create more such issues. Do we have a view on this? I am inclined to keep it simple (which may make matlab users unhappy) for the first release.

@JeffBezanson
Copy link
Member

We can fix this and #152 in one pass by adding size checks.

@StefanKarpinski
Copy link
Member

We still need a policy that will be

a) not annoying
b) not introduce confusing edge cases like the ones that Matlab is full of

Between these two, I'm starting to reconsider the option of filling in an arbitrary number of trailing dimensions of size 1. That would automatically make vectors and column matrices the same thing, and 1x1 matrices the same thing as scalars. It really, really messes with the type system though.

Maybe less drastic than that, we can just automatically fill in trailing ones for parallel ops like +. In that case, vectors and column matrices could just be added, but not vectors and row matrices. Which seems acceptable.

I also think that it makes sense to allow mxn ./ mx1 and replicate the 1 dimension of the second matrix. This makes it much easier to take row-normalized and column-normalized matrices without unnecessarily making huge, repetitive matrices of normalization factors.

@ViralBShah
Copy link
Member

For now, commit 7a8960f fixes this bug.

StefanKarpinski pushed a commit that referenced this issue Feb 8, 2018
KristofferC pushed a commit to KristofferC/julia that referenced this issue Feb 18, 2018
Update stuff for SHA moving to stdlib
cmcaine pushed a commit to cmcaine/julia that referenced this issue Sep 24, 2020
JuliaLang#141)

* replaced grains tests with canonical-data tests and fixed example script

* split grains testsets and added comment about cononical data
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Oct 11, 2021
Update to changes in Base's cov and cor
NHDaly pushed a commit that referenced this issue May 22, 2024
A common idiom used throughout the codebase is to get a pointer to
thread-local-state through `jl_current_task->ptls`.

Create a phantom task for GC threads so that we can make use of this
idiom when running in the GC threads as well.

Idea originally suggested by @vchuravy, bugs are mine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants