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

VectorTranspose * Vector broken #36

Closed
oxinabox opened this issue Jun 3, 2019 · 1 comment · Fixed by #49
Closed

VectorTranspose * Vector broken #36

oxinabox opened this issue Jun 3, 2019 · 1 comment · Fixed by #49

Comments

@oxinabox
Copy link
Member

oxinabox commented Jun 3, 2019

julia> x = NamedDimsArray{(:a,)}([1,2,3])
3-element NamedDimsArray{(:a,),Int64,1,Array{Int64,1}}:
 1
 2
 3


julia> x'*x
ERROR: MethodError: no method matching NamedDimsArray{(:_,),T,N,A} where A<:AbstractArray{T,N} where N where T(::Int64)

Correct answer is:
14
Not a Array at all, just a scalar.

@nickrobinson251
Copy link
Contributor

I presume we want to require names match? so (once fixed) this should error?

a = NamedDimsArray{(:a,)}([1,2,3])
b = NamedDimsArray{(:b,)}([1,2,3])
a' * b

What about for dot? Would we want dot(a, b) to error?

Note that dot ignores dimensionality (and check only length), so dot(a, a) == dot(a', a) == dot(a, a') == dot(a', a') (which is probably the correct behaviour, but may not be JuliaLang/LinearAlgebra.jl#641 ...and is anyway maybe surprising at first)

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 a pull request may close this issue.

2 participants