Skip to content

Commit

Permalink
combine vec methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed May 6, 2023
1 parent 8fac81d commit 6ffe1d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/FillArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ end
promote_rule(::Type{<:AbstractFill{T, N, Axes}}, ::Type{<:AbstractFill{V, N, Axes}}) where {T,V,N,Axes} = Fill{promote_type(T,V),N,Axes}

"""
fillsimilar(a::AbstractFill, axes)
fillsimilar(a::AbstractFill, axes...)
creates a fill object that has the same fill value as `a` but
with the specified axes.
Expand Down
4 changes: 1 addition & 3 deletions src/fillalgebra.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
## vec

vec(a::Ones{T}) where T = Ones{T}(length(a))
vec(a::Zeros{T}) where T = Zeros{T}(length(a))
vec(a::Fill{T}) where T = Fill{T}(a.value,length(a))
vec(a::AbstractFill) = fillsimilar(a, length(a))

## Transpose/Adjoint
# cannot do this for vectors since that would destroy scalar dot product
Expand Down

0 comments on commit 6ffe1d2

Please sign in to comment.