You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just came across this package. I like what I see and feel strongly reminded of the concatenation feature in LinearMaps.jl. Out of curiosity I did some benchmarks following your README:
using LinearAlgebra
d =512
n, m =3, 4
A = [randn(d, d) for i in1:n, j in1:m]
using BenchmarkTools
using BlockFactorizations
B =BlockFactorization(A)
x =randn(d*m)
y =randn(d*n)
using LinearMaps
import LinearMaps: LinearMap
functionblockmapify(A::Matrix{<:LinearMaps.MapOrVecOrMat})
m, n =size(A)
tA =permutedims(A)
hvcat(
Tuple(n for _ in1:m),
Tuple(LinearMaps.convert_to_lmaps_(a) for a in tA)...
)
endblockmapify(D::Diagonal{<:LinearMaps.MapOrVecOrMat}) =cat(LinearMaps.convert_to_lmaps_.(D.diag)..., dims=(1,2))
L =blockmapify(A)
@btimemul!($y, $B, $x)
@btimemul!($y, $L, $x)
A = [Diagonal(randn(d)) for i in1:n, j in1:m]
B =BlockFactorization(A)
L =blockmapify(A)
x =randn(d*m)
y =zeros(d*n)
@btimemul!($y, $B, $x)
@btimemul!($y, $L, $x)
d =512
n =16# testing Diagonal BlockFactorization
A =Diagonal([(randn(d, d)) for i in1:n])
B =BlockFactorization(A)
L =blockmapify(A)
x =randn(d*n)
y =zeros(d*n)
@btimemul!($y, $B, $x);
@btimemul!($y, $L, $x);
Allocations in the second example are due to an issue with Diagonal which is fixed on v1.8. Depending on your future plans, I was wondering if you would want to consider mapping your BlockFactorization to BlockMaps and develop there further depending on your needs? That would give you the additional advantage of having completely lazy "matrix" algebra, like scaling, addition, composition, etc. Note however that there is no guarantee for fast getindex and no plans for any kind of system solving (this is reserved to packages for iterative solvers). Anyway, I just wanted to reach out to see how different packages in the ecosystem can collaborate nicely and to avoid extra effort/join forces.
The text was updated successfully, but these errors were encountered:
I just came across this package. I like what I see and feel strongly reminded of the concatenation feature in LinearMaps.jl. Out of curiosity I did some benchmarks following your README:
and I get
Allocations in the second example are due to an issue with
Diagonal
which is fixed on v1.8. Depending on your future plans, I was wondering if you would want to consider mapping yourBlockFactorization
toBlockMap
s and develop there further depending on your needs? That would give you the additional advantage of having completely lazy "matrix" algebra, like scaling, addition, composition, etc. Note however that there is no guarantee for fastgetindex
and no plans for any kind of system solving (this is reserved to packages for iterative solvers). Anyway, I just wanted to reach out to see how different packages in the ecosystem can collaborate nicely and to avoid extra effort/join forces.The text was updated successfully, but these errors were encountered: