Skip to content

Commit c4462c5

Browse files
remove extra recursive_mean
1 parent 8869a6a commit c4462c5

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/utils.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,6 @@ function recursive_mean(vecvec::Vector{T}) where T<:AbstractArray
113113
out/length(vecvec)
114114
end
115115

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-
131116
# From Iterators.jl. Moved here since Iterators.jl is not precompile safe anymore.
132117

133118
# Concatenate the output of n iterators

test/utils_test.jl

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ data = convert(Array,randomized)
1010
A = [[1 2; 3 4],[1 3;4 6],[5 6;7 8]]
1111
@test recursive_mean(A) [2.33333333 3.666666666
1212
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]
2513

2614
A = zeros(5,5)
2715
recursive_unitless_eltype(A) == Float64

0 commit comments

Comments
 (0)