@testset "util" begin

A = Int[7 0 -1 0 -4 0 3; -9 4 2 -5 3 1 0; 0 0 2 0 1 -7 -2; 0 0 0 0 0 0 0; 2 2 2 2 2 2 2]


@testset "normalizemean" begin
    ans = Float64[6.285714285714286 -0.7142857142857142 -1.7142857142857142 -0.7142857142857142 -4.714285714285714 -0.7142857142857142 2.2857142857142856; -8.428571428571429 4.571428571428571 2.571428571428571 -4.428571428571429 3.571428571428571 1.5714285714285714 0.5714285714285714; 0.8571428571428571 0.8571428571428571 2.857142857142857 0.8571428571428571 1.8571428571428572 -6.142857142857143 -1.1428571428571428; 0 0 0 0 0 0 0; 0 0 0 0 0 0 0]

    B = normalizemean(A)
    @test mean(B,dims=2) ≈ zeros(5,1) atol=1e-9
    @test B ≈ ans

    C = Float64.(A)
    normalizemean!(C)
    @test mean(C,dims=2) ≈ zeros(5,1) atol=1e-9
    @test C ≈ ans
end

@testset "normalizemeanstd" begin
    ans = Float64[1.8217730766638152 -0.20701966780270625 -0.496847202726495 -0.20701966780270625 -1.3663298074978614 -0.20701966780270625 0.6624629369686601; -1.785421221372967 0.9683640522700837 0.5447047794019221 -0.9381026756366437 0.7565344158360029 0.33287514296784126 0.12104550653376046; 0.28878657066713365 0.28878657066713365 0.962621902223779 0.28878657066713365 0.6257042364454564 -2.069637089781125 -0.38504876088951157; 0 0 0 0 0 0 0; 0 0 0 0 0 0 0]

    B = normalizemeanstd(A)
    @test mean(B,dims=2) ≈ zeros(5,1) atol=1e-9
    @test std(B,dims=2).-[1,1,1,0,0] ≈ zeros(5,1) atol=1e-9
    @test B ≈ ans

    C = Float64.(A)
    normalizemeanstd!(C)
    @test mean(C,dims=2) ≈ zeros(5,1) atol=1e-9
    @test std(C,dims=2).-[1,1,1,0,0] ≈ zeros(5,1) atol=1e-9
    @test C ≈ ans
end

end
