You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since A_mul_B accepts SnpLike{2} for the matrix argument, I thought I could use view() to do multiplication on just a subset of my snparray. However the following shows this cannot be done.
S = SnpArray(rand(0:2, 10, 10))
b = rand(5)
answer = zeros(5)
Do multiplication on the top left corner:
julia> A_mul_B!(answer, view(S, 1:5, 1:5), b, similar(answer))
ERROR: type SubArray has no field A1
Stacktrace:
[1] A_mul_B!(::Array{Float64,1}, ::SubArray{Tuple{Bool,Bool},2,SnpArrays.SnpArray{2},Tuple{UnitRange{Int64},UnitRange{Int64}},false}, ::Array{Float64,1}, ::Array{Float64,1}) at /Users/biona001/.julia/v0.6/SnpArrays/src/SnpArrays.jl:728
edit:
Adding example to show that A_mul_B! works on subarrays without loading packages:
x = rand(10, 10)
b = rand(5)
answer = zeros(5)
julia> A_mul_B!(answer, view(x, 1:5, 1:5), b)
5-element Array{Float64,1}:
1.59663
1.19226
1.17276
0.675278
1.56565
The text was updated successfully, but these errors were encountered:
Since
A_mul_B
acceptsSnpLike{2}
for the matrix argument, I thought I could useview()
to do multiplication on just a subset of my snparray. However the following shows this cannot be done.Do multiplication on the top left corner:
edit:
Adding example to show that
A_mul_B!
works on subarrays without loading packages:The text was updated successfully, but these errors were encountered: