Skip to content

Commit

Permalink
Add cat for all dimensions (fixes #171)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeXing committed Aug 22, 2011
1 parent c31addf commit 2f92f4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions j/array.j
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function hcat{T}(A::Array{T,2}...)
end
end

return B
return B
end

function vcat{T}(A::Array{T,2}...)
Expand Down Expand Up @@ -270,7 +270,7 @@ function cat(catdim::Int, X...)
elseif catdim == 2
dimsC = (1, nargs)
else
# TODO
dimsC = tuple(ntuple(catdim-1, i->1)..., nargs)
end
C = Array(typeC, dimsC)

Expand All @@ -290,7 +290,7 @@ function cat(catdim::Int, A::Array...)
dimsA = map(size, A)
ndimsA = map(ndims, A)
d_max = max(ndimsA)
d_min = min(ndimsA)
#d_min = min(ndimsA)

cat_ranges = ntuple(nargs, i->(catdim <= ndimsA[i] ? dimsA[i][catdim] : 1))

Expand Down

0 comments on commit 2f92f4c

Please sign in to comment.