GenericLinearAlgebra.jl icon indicating copy to clipboard operation
GenericLinearAlgebra.jl copied to clipboard

Need to include `using LinearAlgebra` for `svd` to work

Open gvdeynde opened this issue 3 years ago • 3 comments

using GenericLinearAlgebra
svd(big.([1,2;3,4]))

returns

UndefVarError: svd not defined

Stacktrace:
 [1] top-level scope
   @ In[2]:1
 [2] eval
   @ .\boot.jl:373 [inlined]
 [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base .\loading.jl:1196

If I add using LinearAlgebra before using GenericLinearAlgebra, it works.

This is, to me, a bit counter-intuitive.

gvdeynde avatar Jun 01 '22 17:06 gvdeynde

Yeah. It would make sense to reexport LinearAlgebra. It's unlikely that you'd only like to load this package without LinearAlgebra.

andreasnoack avatar Jun 02 '22 09:06 andreasnoack

I don't know. My use-case: I only needed a bigfloat svd decomposition...

gvdeynde avatar Jun 02 '22 12:06 gvdeynde

The svd function is defined in LinearAlgebra, so unfortunately with the current design you will need LinearAlgebra for that. On the other hand, unless you are manually excising packages from the sysimg you need LinearAlgebra for println("hello world").

Tangentially related: https://github.com/JuliaLang/julia/issues/48098

LilithHafner avatar Jan 03 '23 15:01 LilithHafner