File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -176,13 +176,12 @@ end
176
176
177
177
# For arrays of numbers, just store one projector:
178
178
function ProjectTo (x:: AbstractArray{T} ) where {T<: Number }
179
- element = T <: Irrational ? ProjectTo {Real} () : ProjectTo (zero (T))
180
- if element isa ProjectTo{<: AbstractZero }
181
- return ProjectTo {NoTangent} () # short-circuit if all elements project to zero
182
- else
183
- return ProjectTo {AbstractArray} (; element= element, axes= axes (x))
184
- end
179
+ return ProjectTo {AbstractArray} (; element= _eltype_projectto (T), axes= axes (x))
185
180
end
181
+ ProjectTo (x:: AbstractArray{Bool} ) = ProjectTo {NoTangent} ()
182
+
183
+ _eltype_projectto (:: Type{T} ) where {T<: Number } = ProjectTo (zero (T))
184
+ _eltype_projectto (:: Type{<:Irrational} ) = ProjectTo {Real} ()
186
185
187
186
# In other cases, store a projector per element:
188
187
function ProjectTo (xs:: AbstractArray )
You can’t perform that action at this time.
0 commit comments