@@ -29,6 +29,10 @@
Loading
29 29
    end
30 30
end
31 31
32 +
# Julia v1.0 has some weird bug that prevents this from working
33 +
@static if VERSION >= v"1.1"
34 +
    @inline SizedArray(a::StaticArray{S,T,N}) where {S<:Tuple,T,N} = SizedArray{S,T,N}(a)
35 +
end
32 36
@inline function SizedArray{S,T,N}(
33 37
    a::TData,
34 38
) where {S,T,N,M,TData<:AbstractArray{T,M}}
@@ -123,6 +127,7 @@
Loading
123 127
124 128
const SizedVector{S,T} = SizedArray{Tuple{S},T,1,1}
125 129
130 +
SizedVector(a::StaticVector{N,T}) where {N,T} = SizedVector{N,T}(a)
126 131
@inline function SizedVector{S}(a::TData) where {S,T,TData<:AbstractVector{T}}
127 132
    return SizedArray{Tuple{S},T,1,1,TData}(a)
128 133
end
@@ -142,6 +147,10 @@
Loading
142 147
143 148
const SizedMatrix{S1,S2,T} = SizedArray{Tuple{S1,S2},T,2}
144 149
150 +
# Julia v1.0 has some weird bug that prevents this from working
151 +
@static if VERSION >= v"1.1"
152 +
    SizedMatrix(a::StaticMatrix{N,M,T}) where {N,M,T} = SizedMatrix{N,M,T}(a)
153 +
end
145 154
@inline function SizedMatrix{S1,S2}(
146 155
    a::TData,
147 156
) where {S1,S2,T,M,TData<:AbstractArray{T,M}}

@@ -71,7 +71,7 @@
Loading
71 71
    end
72 72
end
73 73
74 -
@inline MArray(a::StaticArray) = MArray{size_tuple(Size(a))}(Tuple(a))
74 +
@inline MArray(a::StaticArray{S,T}) where {S<:Tuple,T} = MArray{S,T}(Tuple(a))
75 75
76 76
####################
77 77
## MArray methods ##

@@ -58,7 +58,7 @@
Loading
58 58
    sacollect(SMatrix{M, N}, gen)
59 59
60 60
@inline convert(::Type{SMatrix{S1,S2}}, a::StaticArray{<:Tuple, T}) where {S1,S2,T} = SMatrix{S1,S2,T}(Tuple(a))
61 -
@inline SMatrix(a::StaticMatrix{S1, S2}) where {S1, S2} = SMatrix{S1, S2}(Tuple(a))
61 +
@inline SMatrix(a::StaticMatrix{S1, S2, T}) where {S1, S2, T} = SMatrix{S1, S2, T}(Tuple(a))
62 62
63 63
# Some more advanced constructor-like functions
64 64
@inline one(::Type{SMatrix{N}}) where {N} = one(SMatrix{N,N})

@@ -52,7 +52,7 @@
Loading
52 52
end
53 53
54 54
@inline convert(::Type{MMatrix{S1,S2}}, a::StaticArray{<:Tuple, T}) where {S1,S2,T} = MMatrix{S1,S2,T}(Tuple(a))
55 -
@inline MMatrix(a::StaticMatrix) = MMatrix{size(typeof(a),1),size(typeof(a),2)}(Tuple(a))
55 +
@inline MMatrix(a::StaticMatrix{N,M,T}) where {N,M,T} = MMatrix{N,M,T}(Tuple(a))
56 56
57 57
# Some more advanced constructor-like functions
58 58
@inline one(::Type{MMatrix{N}}) where {N} = one(MMatrix{N,N})

@@ -16,6 +16,7 @@
Loading
16 16
"""
17 17
const MVector{S, T} = MArray{Tuple{S}, T, 1, S}
18 18
19 +
@inline MVector(a::StaticVector{N,T}) where {N,T} = MVector{N,T}(a)
19 20
@inline MVector(x::NTuple{S,Any}) where {S} = MVector{S}(x)
20 21
@inline MVector{S}(x::NTuple{S,T}) where {S, T} = MVector{S, T}(x)
21 22
@inline MVector{S}(x::NTuple{S,Any}) where {S} = MVector{S, promote_tuple_eltype(typeof(x))}(x)

@@ -106,7 +106,7 @@
Loading
106 106
@inline (::Type{SA})(gen::Base.Generator) where {SA <: StaticArray} =
107 107
    sacollect(SA, gen)
108 108
109 -
@inline SArray(a::StaticArray) = SArray{size_tuple(Size(a))}(Tuple(a))
109 +
@inline SArray(a::StaticArray{S,T}) where {S<:Tuple,T} = SArray{S,T}(Tuple(a))
110 110
111 111
####################
112 112
## SArray methods ##

@@ -15,6 +15,7 @@
Loading
15 15
"""
16 16
const SVector{S, T} = SArray{Tuple{S}, T, 1, S}
17 17
18 +
@inline SVector(a::StaticVector{N,T}) where {N,T} = SVector{N,T}(a)
18 19
@inline SVector(x::NTuple{S,Any}) where {S} = SVector{S}(x)
19 20
@inline SVector{S}(x::NTuple{S,T}) where {S, T} = SVector{S,T}(x)
20 21
@inline SVector{S}(x::T) where {S, T <: Tuple} = SVector{S,promote_tuple_eltype(T)}(x)
Files Coverage
src 93.25%
Project Totals (42 files) 93.25%
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled
Untitled

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading