-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSerializedArraysLinearAlgebraExt.jl
More file actions
51 lines (44 loc) · 1.06 KB
/
SerializedArraysLinearAlgebraExt.jl
File metadata and controls
51 lines (44 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module SerializedArraysLinearAlgebraExt
using LinearAlgebra: LinearAlgebra, mul!
using SerializedArrays: AbstractSerializedMatrix, memory
function mul_serialized!(
a_dest::AbstractMatrix, a1::AbstractMatrix, a2::AbstractMatrix, α::Number, β::Number
)
mul!(a_dest, memory(a1), memory(a2), α, β)
return a_dest
end
function LinearAlgebra.mul!(
a_dest::AbstractMatrix,
a1::AbstractSerializedMatrix,
a2::AbstractSerializedMatrix,
α::Number,
β::Number,
)
return mul_serialized!(a_dest, a1, a2, α, β)
end
function LinearAlgebra.mul!(
a_dest::AbstractMatrix,
a1::AbstractMatrix,
a2::AbstractSerializedMatrix,
α::Number,
β::Number,
)
return mul_serialized!(a_dest, a1, a2, α, β)
end
function LinearAlgebra.mul!(
a_dest::AbstractMatrix,
a1::AbstractSerializedMatrix,
a2::AbstractMatrix,
α::Number,
β::Number,
)
return mul_serialized!(a_dest, a1, a2, α, β)
end
for f in [:eigen, :qr, :svd]
@eval begin
function LinearAlgebra.$f(a::AbstractSerializedMatrix; kwargs...)
return LinearAlgebra.$f(copy(a))
end
end
end
end