julialinearalgebra / matrixfactorizations.jl Goto Github PK
View Code? Open in Web Editor NEWA Julia package to contain non-standard matrix factorizations
License: Other
A Julia package to contain non-standard matrix factorizations
License: Other
Hello,
I wrote a function for computing the Cholesky factor and its inverse in one pass. For small matrices this appears considerably faster than computing the Cholesky factor and inverting it with LinearAlgebra. Would that be interesting for this package?
For the moment being i am hosting it in the PosDefManifold.jl package
as the choInv function
Here is a quick benchmark:
using PosDefManifold, BenchmarkTools
P=randP(10)
using LinearAlgebra
function t(P)
C=cholesky(P)
return C.L, inv(C.L)
end
julia> @benchmark(t(P))
BenchmarkTools.Trial:
memory estimate: 3.69 KiB
allocs estimate: 12
--------------
minimum time: 40.800 μs (0.00% GC)
median time: 47.201 μs (0.00% GC)
mean time: 48.117 μs (0.00% GC)
maximum time: 291.300 μs (0.00% GC)
--------------
samples: 10000
evals/sample: 1
using function choInv
julia> @benchmark(choInv(P))
BenchmarkTools.Trial:
memory estimate: 6.09 KiB
allocs estimate: 23
--------------
minimum time: 1.530 μs (0.00% GC)
median time: 1.690 μs (0.00% GC)
mean time: 2.883 μs (14.91% GC)
maximum time: 563.430 μs (98.69% GC)
--------------
samples: 10000
evals/sample: 10
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
Which license does this package have?
With Julia +1.9.
Note that, the issue doesn't appear with v2.1.0.
Repro:
] add FastAlmostBandedMatrix, MatrixFactorizations@2.1.1
Or,
] add NonlinearSolve, MatrixFactorizations@2.1.1
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
[ Info: Precompiling NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec]
WARNING: Method definition *(MatrixFactorizations.LayoutQ{T} where T, MatrixFactorizations.LayoutQ{T} where T) in module MatrixFactorizations at C:\Users\user\.julia\packages\MatrixFactorizations\wSXzP\src\MatrixFactorizations.jl:124 overwritten at C:\Users\user\.julia\packages\MatrixFactorizations\wSXzP\src\MatrixFactorizations.jl:70.
** incremental compilation may be fatally broken for this module **
WARNING: Method definition *(MatrixFactorizations.LayoutQ{T} where T, MatrixFactorizations.LayoutQ{T} where T) in module MatrixFactorizations at C:\Users\user\.julia\packages\MatrixFactorizations\wSXzP\src\MatrixFactorizations.jl:124 overwritten at C:\Users\user\.julia\packages\MatrixFactorizations\wSXzP\src\MatrixFactorizations.jl:70.
** incremental compilation may be fatally broken for this module **
ERROR: LoadError: UndefRefError: access to undefined reference
Stacktrace:
[1] getindex
@ .\essentials.jl:13 [inlined]
[2] invalidation_leaves(invlist::Vector{Any})
@ PrecompileTools C:\Users\user\.julia\packages\PrecompileTools\L8A3n\src\invalidations.jl:42
[3] recompile_invalidations(__module__::Module, expr::Any)
@ PrecompileTools C:\Users\user\.julia\packages\PrecompileTools\L8A3n\src\invalidations.jl:23
[4] top-level scope
@ C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\NonlinearSolve.jl:10
[5] include
@ .\Base.jl:457 [inlined]
[6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
@ Base .\loading.jl:2049
[7] top-level scope
@ stdin:3
in expression starting at C:\Users\user\.julia\packages\NonlinearSolve\KlGj2\src\NonlinearSolve.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile NonlinearSolve [8913a72c-1f9b-4ce2-8d82-65094dcecaec] to "C:\\Users\\user\\.julia\\compiled\\v1.9\\NonlinearSolve\\jl_83D6.tmp".
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:2294
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611
See Here's the relevant commit: JuliaLang/julia@e0ecc55#diff-8d1e6cd3179ba632a02c2d34dbd7a98dad914325c262d7d7e2ddb84a3a6496af
MatrixFactorizations = v"0.9.6"
LinearAlgebra = v"0.0.0" ?!? #sorry but I don't why this is reporting 0.0.0
Julia = v"1.6.7"
using MatrixFactorizations,LinearAlgebra,Test
A=randn(8,4)
Q, L = ql(A)
@test norm(Q*L-A)<1e-14 #Fine with typeof(Q) == QLPackedQ
QM=Matrix(Q)
@test norm(QM*L-A)<1e-14 #Fails after unpacking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.