Skip to content

Commit

Permalink
Added mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo committed Oct 14, 2019
1 parent e6f03aa commit 6c0aab2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/TensorValues.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export VectorValue

export inner, outer, meas
export det, inv
export mutable

import Base: show
import Base: zero, one
Expand Down
4 changes: 4 additions & 0 deletions src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,7 @@ function show(io::IO,::MIME"text/plain",v::MultiValue)
print(io,v.array.data)
end

# Misc

mutable(::Type{MultiValue{S,T,N,L}}) where {S,T,N,L} = MArray{S,T,N,L}

8 changes: 8 additions & 0 deletions test/TypesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,12 @@ v = MultiValue{Tuple{3,2},Float64}(1,2,3,4,5,6)
s = "(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)"
@test string(v) == s

# Misc

M = mutable(VectorValue{3,Int})
@test M == MVector{3,Int}
m = zero(M)
v = VectorValue(m)
@test isa(v,VectorValue{3,Int})

end # module TypesTests

0 comments on commit 6c0aab2

Please sign in to comment.