Where is lufact()?

Hi All. Apologies for this, but after 2 years of Julia usage, I still feel like a ‘newbie’ sometimes.

I see reference all over the place to ‘lufact()’ but I have tried adding package after package (LinearAlgebra, LinAlg, etc.) but no matter what I do, I get

UndefVarError: lufact not defined

I usually don’t need this so haven’t used it before.

I wonder, firstly, if someone can help me with this, and secondly, if in general there is a ‘reverse directory’ for commonly-used functions - in order to find out which package one needs to load. Believe it or not, most documentation in Julia referring to functions seems to omit this (vital) piece of information.

Thanks for any help!

1 Like

It is just called lu now (since Julia 1.0). It is defined in the standard library LinearAlgebra, so you need to import that.


Thank you!

Is there a way to find which functions are in which package? [Or maybe even deprecations?]

For this particular case you can use the Julia 0.7 release to figure it out (0.7 is just 1.0 with deprecations):

julia> lufact(rand(2,2))
WARNING: Base.lufact is deprecated: it has been moved to the standard library package `LinearAlgebra`.
Add `using LinearAlgebra` to your imports.
 in module Main
┌ Warning: `lufact(A::Union{AbstractMatrix{T}, AbstractMatrix{Complex{T}}}, pivot::Union{Val{false}, Val{true}}=Val(true)) where T <: AbstractFloat` is deprecated, use `lu(A, pivot)` instead.
│   caller = lufact(::Array{Float64,2}) at deprecated.jl:54
└ @ LinearAlgebra ./deprecated.jl:54

In general I would just look at the imports of the code where you find a function. You could also check out the code search and repo search from JuliaHub. I don’t know what the difference is.

1 Like

OK - thanks - I’ll try those latter.