From b2373ef9a9a21050ad20fbeadeb564c762e6fb85 Mon Sep 17 00:00:00 2001 From: Seth Axen Date: Sun, 22 Jan 2023 17:47:13 +0100 Subject: [PATCH] Remove constructors from vector (#8) --- src/octonion.jl | 3 --- test/octonion.jl | 8 -------- 2 files changed, 11 deletions(-) diff --git a/src/octonion.jl b/src/octonion.jl index 193157e..4c9f006 100644 --- a/src/octonion.jl +++ b/src/octonion.jl @@ -16,8 +16,6 @@ Octonion{T}(o::Octonion) where {T<:Real} = Octonion(s::Real, v1::Real, v2::Real, v3::Real, v4::Real, v5::Real, v6::Real, v7::Real) = Octonion(promote(s, v1, v2, v3, v4, v5, v6, v7)...) Octonion(x::Real) = Octonion(x, zero(x), zero(x), zero(x), zero(x), zero(x), zero(x), zero(x)) -Octonion(s::Real, a::Vector) = Octonion(s, a[1], a[2], a[3], a[4], a[5], a[6], a[7]) -Octonion(a::Vector) = Octonion(0, a[1], a[2], a[3], a[4], a[5], a[6], a[7]) const OctonionF16 = Octonion{Float16} const OctonionF32 = Octonion{Float32} @@ -28,7 +26,6 @@ promote_rule(::Type{Octonion{T}}, ::Type{Octonion{S}}) where {T <: Real, S <: Re octo(p, v1, v2, v3, v4, v5, v6, v7) = Octonion(p, v1, v2, v3, v4, v5, v6, v7) octo(x) = Octonion(x) -octo(s, a) = Octonion(s, a) real(o::Octonion) = o.s imag_part(o::Octonion) = (o.v1, o.v2, o.v3, o.v4, o.v5, o.v6, o.v7) diff --git a/test/octonion.jl b/test/octonion.jl index 4978752..e2bac16 100644 --- a/test/octonion.jl +++ b/test/octonion.jl @@ -49,12 +49,6 @@ end @test @inferred(Octonion(o)) === o end end - @testset "from vector" begin - s = randn() - v = randn(7) - @test @inferred(Octonion(s, v)) === Octonion(s, v...) - @test @inferred(Octonion(v)) === Octonion(0, v) - end end @testset "==" begin @@ -83,8 +77,6 @@ end @test octo(1) === Octonion(1) @test octo(1, 2, 3, 4, 5, 6, 7, 8) === Octonion(1, 2, 3, 4, 5, 6, 7, 8) @test octo(Octonion(1, 2, 3, 4, 5, 6, 7, 8)) === Octonion(1, 2, 3, 4, 5, 6, 7, 8) - @test octo(1, collect(2:8)) === Octonion(1:8...) - @test octo(collect(2:8)) === Octonion(0, 2:8...) end @testset "random generation" begin