Skip to content

Commit

Permalink
remove scalem
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Oct 27, 2018
1 parent 4804557 commit a0af20c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
9 changes: 0 additions & 9 deletions src/SDiagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@

import Base: ==, -, +, *, /, \, abs, real, imag, conj

@generated function scalem(a::StaticMatrix{M,N}, b::StaticVector{N}) where {M, N}
expr = vec([:(a[$j,$i]*b[$i]) for j=1:M, i=1:N])
:(@_inline_meta; let val1 = ($(expr[1])); similar_type(SMatrix{M,N},typeof(val1))(val1, $(expr[2:end]...)); end)
end
@generated function scalem(a::StaticVector{M}, b::StaticMatrix{M, N}) where {M, N}
expr = vec([:(b[$j,$i]*a[$j]) for j=1:M, i=1:N])
:(@_inline_meta; let val1 = ($(expr[1])); similar_type(SMatrix{M,N},typeof(val1))(val1, $(expr[2:end]...)); end)
end

const SDiagonal = Diagonal{T,SVector{N,T}} where {N,T}
SDiagonal(x...) = Diagonal(SVector(x...))

Expand Down
3 changes: 0 additions & 3 deletions test/SDiagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ using StaticArrays, Test, LinearAlgebra

@testset "Methods" begin

@test StaticArrays.scalem(@SMatrix([1 1 1;1 1 1; 1 1 1]), @SVector [1,2,3]) === @SArray [1 2 3; 1 2 3; 1 2 3]
@test StaticArrays.scalem(@SVector([1,2,3]),@SMatrix [1 1 1;1 1 1; 1 1 1])' === @SArray [1 2 3; 1 2 3; 1 2 3]

m = SDiagonal(@SVector [11, 12, 13, 14])

@test diag(m) === m.diag
Expand Down

0 comments on commit a0af20c

Please sign in to comment.