Skip to content

Commit 08d7fa7

Browse files
authored
Merge pull request #32 from fredrikekre/fe/julia-1.2
Updates for Julia 1.0, 1.1 and 1.2
2 parents 14bcda9 + 7cb4a90 commit 08d7fa7

File tree

9 files changed

+30
-13
lines changed

9 files changed

+30
-13
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/Manifest.toml
2+
/test/coverage/Manifest.toml

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ os:
33
- linux
44
- osx
55
julia:
6-
- 0.6
7-
- 0.7
6+
- 1.0
7+
- 1.1
88
- nightly
99

1010
matrix:
@@ -15,4 +15,5 @@ notifications:
1515
email: false
1616

1717
after_success:
18-
- julia -e 'cd(Pkg.dir("Quaternions")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
18+
- julia --project=test/coverage -e 'using Pkg; Pkg.instantiate();
19+
using Coverage; Coveralls.submit(Coveralls.process_folder())'

Project.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name = "Quaternions"
2+
uuid = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0"
3+
version = "0.4.0"
4+
5+
[deps]
6+
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
7+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
8+
9+
[compat]
10+
DualNumbers = "0.5, 0.6"
11+
julia = "1"
12+
13+
[extras]
14+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
15+
16+
[targets]
17+
test = ["Test"]

REQUIRE

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/Quaternion.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ imag(q::Quaternion) = [q.v1, q.v2, q.v3]
4747

4848
conj(q::Quaternion) = Quaternion(q.s, -q.v1, -q.v2, -q.v3, q.norm)
4949
abs(q::Quaternion) = sqrt(q.s * q.s + q.v1 * q.v1 + q.v2 * q.v2 + q.v3 * q.v3)
50+
float(q::Quaternion{T}) where T = convert(Quaternion{float(T)}, q)
5051
abs_imag(q::Quaternion) = sqrt(q.v1 * q.v1 + q.v2 * q.v2 + q.v3 * q.v3)
5152
abs2(q::Quaternion) = q.s * q.s + q.v1 * q.v1 + q.v2 * q.v2 + q.v3 * q.v3
5253
inv(q::Quaternion) = q.norm ? conj(q) : conj(q) / abs2(q)

src/Quaternions.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ __precompile__()
22

33
module Quaternions
44

5-
using Compat
6-
75
import Base: +, -, *, /, ^
86
import Base: abs, abs2, angle, conj, cos, exp, inv, isfinite, log, real, sin, sqrt
9-
import Base: convert, promote_rule
10-
import Compat.LinearAlgebra: norm, normalize
7+
import Base: convert, promote_rule, float
8+
import LinearAlgebra: norm, normalize
119

1210
include("Quaternion.jl")
1311
include("Octonion.jl")

test/coverage/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[deps]
2+
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037"

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Compat.Test
1+
using Test
22
using Quaternions
33

44
test_associative(x, y, z, ) = @test (x y) z x (y z)

test/test_Quaternion.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
using Quaternions: argq
3-
using Compat
4-
using Compat.LinearAlgebra
3+
using LinearAlgebra
54

65
# creating random examples
76
sample(QT::Type{Quaternion{T}}) where {T <: Integer} = QT(rand(-100:100, 4)..., false)

0 commit comments

Comments
 (0)