@@ -11,32 +11,30 @@ to information stored in a single sample.
11
11
"""
12
12
function chainvec end
13
13
14
-
15
- function chainvec (nt:: NamedTuple , n= 1 )
16
- tv = TupleVector (undef, nt, n)
17
- @inbounds tv[1 ] = nt
18
- return tv
14
+ function chainvec (nt:: NamedTuple , n = 1 )
15
+ tv = TupleVector (undef, nt, n)
16
+ @inbounds tv[1 ] = nt
17
+ return tv
19
18
end
20
19
21
- function chainvec (x:: T , n= 1 ) where {T<: Real }
22
- ev = ElasticVector {T} (undef, n)
23
- @inbounds ev[1 ] = x
24
- return ev
20
+ function chainvec (x:: T , n = 1 ) where {T<: Real }
21
+ ev = ElasticVector {T} (undef, n)
22
+ @inbounds ev[1 ] = x
23
+ return ev
25
24
end
26
25
27
- function chainvec (x:: T , n= 1 ) where {T}
28
- if isstructtype (T)
29
- v = StructArrays. replace_storage (ElasticVector, StructVector {T} (undef, n))
30
- @inbounds v[1 ] = x
31
- return v
32
- end
33
- ev = ElasticVector {T} (undef, n)
34
- @inbounds ev[1 ] = x
35
- return ev
26
+ function chainvec (x:: T , n = 1 ) where {T}
27
+ if isstructtype (T)
28
+ v = StructArrays. replace_storage (ElasticVector, StructVector {T} (undef, n))
29
+ @inbounds v[1 ] = x
30
+ return v
31
+ end
32
+ @inbounds ev[1 ] = x
33
+ return ev
36
34
end
37
35
38
- function chainvec (x:: DenseArray{T,N} , n= 1 ) where {T,N}
39
- nv = nestedview (ElasticArray {T,N+ 1} (undef, size (x)... , n), N)
40
- @inbounds nv[1 ] = x
41
- return nv
42
- end
36
+ function chainvec (x:: DenseArray{T,N} , n = 1 ) where {T,N}
37
+ nv = nestedview (ElasticArray {T,N + 1} (undef, size (x)... , n), N)
38
+ @inbounds nv[1 ] = x
39
+ return nv
40
+ end
0 commit comments