File tree Expand file tree Collapse file tree 2 files changed +0
-27
lines changed Expand file tree Collapse file tree 2 files changed +0
-27
lines changed Original file line number Diff line number Diff line change @@ -113,21 +113,6 @@ function recursive_mean(vecvec::Vector{T}) where T<:AbstractArray
113
113
out/ length (vecvec)
114
114
end
115
115
116
- function recursive_mean (matarr:: Matrix{T} ,region= 0 ) where T<: AbstractArray
117
- if region == 0
118
- return recursive_mean (vec (matarr))
119
- elseif region == 1
120
- out = [zeros (matarr[1 ,i]) for i in 1 : size (matarr,2 )]
121
- for j in 1 : size (matarr,2 ), i in 1 : size (matarr,1 )
122
- out[j] += matarr[i,j]
123
- end
124
- return out/ size (matarr,1 )
125
- elseif region == 2
126
- return recursive_mean (matarr' ,1 )
127
- end
128
- end
129
-
130
-
131
116
# From Iterators.jl. Moved here since Iterators.jl is not precompile safe anymore.
132
117
133
118
# Concatenate the output of n iterators
Original file line number Diff line number Diff line change @@ -10,18 +10,6 @@ data = convert(Array,randomized)
10
10
A = [[1 2 ; 3 4 ],[1 3 ;4 6 ],[5 6 ;7 8 ]]
11
11
@test recursive_mean (A) ≈ [2.33333333 3.666666666
12
12
4.6666666666 6.0 ]
13
- B = Matrix {Matrix{Int64}} (2 ,3 )
14
- B[1 ,:] = [[1 2 ; 3 4 ],[1 3 ;4 6 ],[5 6 ;7 8 ]]
15
- B[2 ,:] = [[1 2 ; 3 4 ],[1 5 ;4 3 ],[5 8 ;2 1 ]]
16
-
17
- a = [[1 2 ; 3 4 ],[1 4 ; 4 4.5 ],[5 7 ; 4.5 4.5 ]]
18
- @test recursive_mean (B,1 )[1 ] ≈ a[1 ]
19
- @test recursive_mean (B,1 )[2 ] ≈ a[2 ]
20
- @test recursive_mean (B,1 )[3 ] ≈ a[3 ]
21
-
22
- a = [[2.333333333333 4.666666666666 ; 3.6666666666666 6.0 ], [2.3333333 3.0 ; 5.0 2.6666666 ]]
23
- @test_broken recursive_mean (B,2 )[1 ] ≈ a[1 ]
24
- @test_broken recursive_mean (B,2 )[2 ] ≈ a[2 ]
25
13
26
14
A = zeros (5 ,5 )
27
15
recursive_unitless_eltype (A) == Float64
You can’t perform that action at this time.
0 commit comments