diff --git a/src/TensorValues.jl b/src/TensorValues.jl index c2e6bb5..0d9f33b 100644 --- a/src/TensorValues.jl +++ b/src/TensorValues.jl @@ -9,6 +9,7 @@ export VectorValue export inner, outer, meas export det, inv +export mutable import Base: show import Base: zero, one diff --git a/src/Types.jl b/src/Types.jl index 1c59edf..3601d32 100644 --- a/src/Types.jl +++ b/src/Types.jl @@ -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} + diff --git a/test/TypesTests.jl b/test/TypesTests.jl index a5d8ead..4873bda 100644 --- a/test/TypesTests.jl +++ b/test/TypesTests.jl @@ -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