Skip to content

Commit

Permalink
Merge pull request #58 from FugroRoames/fbot/deps
Browse files Browse the repository at this point in the history
Run femtocleaner
  • Loading branch information
tkoolen authored Jun 24, 2018
2 parents cffb0c3 + 8e4f0e7 commit f5617c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/angleaxis_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ end

# StaticArrays will take over *all* the constructors and put everything in a tuple...
# but this isn't quite what we mean when we have 4 inputs (not 9).
@inline (::Type{RodriguesVec})(x::X, y::Y, z::Z) where {X,Y,Z} = RodriguesVec{promote_type(promote_type(X, Y), Z)}(x, y, z)
@inline RodriguesVec(x::X, y::Y, z::Z) where {X,Y,Z} = RodriguesVec{promote_type(promote_type(X, Y), Z)}(x, y, z)

# These functions are enough to satisfy the entire StaticArrays interface:
@inline (::Type{RV})(t::NTuple{9}) where {RV <: RodriguesVec} = convert(RV, Quat(t))
Expand Down
10 changes: 5 additions & 5 deletions src/core_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ for N = 2:3
L = N*N
RotMatrixN = Symbol(:RotMatrix, N)
@eval begin
@inline (::Type{RotMatrix})(t::NTuple{$L}) = RotMatrix(SMatrix{$N,$N}(t))
@inline RotMatrix(t::NTuple{$L}) = RotMatrix(SMatrix{$N,$N}(t))
@inline (::Type{RotMatrix{$N}})(t::NTuple{$L}) = RotMatrix(SMatrix{$N,$N}(t))
@inline (::Type{RotMatrix{$N,T}})(t::NTuple{$L}) where {T} = RotMatrix(SMatrix{$N,$N,T}(t))
@inline (::Type{RotMatrix{$N,T,$L}})(t::NTuple{$L}) where {T} = RotMatrix(SMatrix{$N,$N,T}(t))
@inline RotMatrix{$N,T}(t::NTuple{$L}) where {T} = RotMatrix(SMatrix{$N,$N,T}(t))
@inline RotMatrix{$N,T,$L}(t::NTuple{$L}) where {T} = RotMatrix(SMatrix{$N,$N,T}(t))
const $RotMatrixN{T} = RotMatrix{$N, T, $L}
end
end
Base.@propagate_inbounds Base.getindex(r::RotMatrix, i::Int) = r.mat[i]
@inline Tuple(r::RotMatrix) = Tuple(r.mat)

@inline (::Type{RotMatrix})::Real) = RotMatrix(@SMatrix [cos(θ) -sin(θ); sin(θ) cos(θ)])
@inline RotMatrix::Real) = RotMatrix(@SMatrix [cos(θ) -sin(θ); sin(θ) cos(θ)])
@inline (::Type{RotMatrix{2}})(θ::Real) = RotMatrix(@SMatrix [cos(θ) -sin(θ); sin(θ) cos(θ)])
@inline (::Type{RotMatrix{2,T}})::Real) where {T} = RotMatrix(@SMatrix T[cos(θ) -sin(θ); sin(θ) cos(θ)])
@inline RotMatrix{2,T}::Real) where {T} = RotMatrix(@SMatrix T[cos(θ) -sin(θ); sin(θ) cos(θ)])

# A rotation is more-or-less defined as being an orthogonal (or unitary) matrix
inv(r::RotMatrix) = RotMatrix(r.mat')
Expand Down

0 comments on commit f5617c6

Please sign in to comment.