Skip to content

Commit

Permalink
Add tensor draft
Browse files Browse the repository at this point in the history
  • Loading branch information
Samayel committed Nov 1, 2015
1 parent d5eb641 commit 57cb505
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Notepad/tensor.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# https://github.com/JuliaLang/julia/issues/13333#issuecomment-143597032

module TensorOperators

export ++, ,

++(A::AbstractArray, B::AbstractArray) = vcat(A, B)
const = ++

(A::AbstractArray, B::AbstractArray) = kron(A, B)

end



using TensorOperators
([1,2,3] ++ [4,5,6]) [1 2 3 4 5 6]

#=
6x6 Array{Int64,2}:
1 2 3 4 5 6
2 4 6 8 10 12
3 6 9 12 15 18
4 8 12 16 20 24
5 10 15 20 25 30
6 12 18 24 30 36
=#

0 comments on commit 57cb505

Please sign in to comment.