-
Notifications
You must be signed in to change notification settings - Fork 64
Closed
Labels
LinearOperatorsFor issues relating to defining linear operators on AbstractDifferentialsFor issues relating to defining linear operators on AbstractDifferentialsStructural TangentRelated to the `Tangent` type for structured (composite) valuesRelated to the `Tangent` type for structured (composite) valuesenhancementNew feature or requestNew feature or request
Description
Should we define a reverse method for Composite?
julia> t = (1, 2, 3.0);
julia> T = typeof(t)
Tuple{Int64,Int64,Float64}
julia> reverse(t)
(3.0, 2, 1)
julia> c = Composite{T}(t)
Composite{Tuple{Int64,Int64,Float64}}((1, 2, 3.0),)
julia> reverse(c)
ERROR: MethodError: no method matching reverse(::Composite{Tuple{Int64,Int64,Float64},Tuple{Tuple{Int64,Int64,Float64}}})
It should be pointed out that reverse does not work on NamedTuples:
julia> nt = (a=1, b=2, c=3.0)
(a = 1, b = 2, c = 3.0)
julia> reverse(nt)
ERROR: MethodError: no method matching reverse(::NamedTuple{(:a, :b, :c),Tuple{Int64,Int64,Float64}})
I guess we could support it for Composites whose primal type is reverse-ible?
Metadata
Metadata
Assignees
Labels
LinearOperatorsFor issues relating to defining linear operators on AbstractDifferentialsFor issues relating to defining linear operators on AbstractDifferentialsStructural TangentRelated to the `Tangent` type for structured (composite) valuesRelated to the `Tangent` type for structured (composite) valuesenhancementNew feature or requestNew feature or request