Skip to content

Commit

Permalink
Base.LinAlg to new LinearAlgebra stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Jan 17, 2018
1 parent d6f079a commit d2dbcce
Show file tree
Hide file tree
Showing 126 changed files with 2,567 additions and 2,414 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,9 @@ Deprecated or removed

* Sparse array functionality has moved to the `SparseArrays` standard library module ([#25249]).

* Linear algebra functionality, and specifically the `LinAlg` module has moved to the
`LinearAlgebra` standard library module ([#25571]).

* `@printf` and `@sprintf` have been moved to the `Printf` standard library ([#23929],[#25056]).

* The aliases `Complex32`, `Complex64` and `Complex128` have been deprecated in favor of `ComplexF16`,
Expand Down
7 changes: 6 additions & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ end
function _one(unit::T, x::AbstractMatrix) where T
m,n = size(x)
m==n || throw(DimensionMismatch("multiplicative identity defined only for square matrices"))
Matrix{T}(I, m, m)
# Matrix{T}(I, m, m)
I = zeros(T, m, m)
for i in 1:m
I[i,i] = 1
end
I
end

one(x::AbstractMatrix{T}) where {T} = _one(one(T), x)
Expand Down
1,501 changes: 129 additions & 1,372 deletions base/deprecated.jl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ julia> sizeof(ComplexF64)
If `T` does not have a specific size, an error is thrown.
```jldoctest
julia> sizeof(Base.LinAlg.LU)
julia> sizeof(Base.SubArray)
ERROR: argument is an abstract type; size is indeterminate
Stacktrace:
[...]
Expand Down
193 changes: 96 additions & 97 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ export
StackTraces,
Sys,
Libc,
LinAlg,
BLAS,
LAPACK,
# BLAS,
# LAPACK,
Serializer,
Docs,
Markdown,
Expand All @@ -29,7 +28,7 @@ export
AbstractVecOrMat,
Array,
AbstractDict,
Bidiagonal,
# Bidiagonal,
BigFloat,
BigInt,
BitArray,
Expand All @@ -46,22 +45,22 @@ export
ComplexF64,
ComplexF32,
ComplexF16,
ConjVector,
ConjMatrix,
# ConjVector,
# ConjMatrix,
DenseMatrix,
DenseVecOrMat,
DenseVector,
DevNull,
Diagonal,
# Diagonal,
Dict,
Dims,
EachLine,
Enum,
Enumerate,
ExponentialBackOff,
Factorization,
Hermitian,
UniformScaling,
# Factorization,
# Hermitian,
# UniformScaling,
IndexCartesian,
IndexLinear,
IndexStyle,
Expand All @@ -70,7 +69,7 @@ export
IOBuffer,
IOStream,
LinSpace,
LowerTriangular,
# LowerTriangular,
Irrational,
Matrix,
MergeSort,
Expand All @@ -94,8 +93,8 @@ export
RoundNearestTiesUp,
RoundToZero,
RoundUp,
Adjoint,
Transpose,
# Adjoint,
# Transpose,
AbstractSerializer,
SerializationState,
Set,
Expand All @@ -108,12 +107,12 @@ export
StridedVector,
SubArray,
SubString,
Symmetric,
SymTridiagonal,
# Symmetric,
# SymTridiagonal,
Timer,
Tridiagonal,
# Tridiagonal,
UnitRange,
UpperTriangular,
# UpperTriangular,
Val,
VecOrMat,
Vector,
Expand Down Expand Up @@ -178,7 +177,7 @@ export
im,
π, pi,
ℯ,
I,
# I,

# Operators
!,
Expand Down Expand Up @@ -500,88 +499,88 @@ export
searchsortedlast,
startswith,

# linear algebra
bkfact!,
bkfact,
chol,
cholfact!,
cholfact,
cond,
condskeel,
cross,
adjoint!,
# # linear algebra
# bkfact!,
# bkfact,
# chol,
# cholfact!,
# cholfact,
# cond,
# condskeel,
# cross,
# adjoint!,
adjoint,
det,
diag,
diagind,
diagm,
diff,
dot,
eig,
eigfact!,
eigfact,
eigmax,
eigmin,
eigvals,
eigvals!,
eigvecs,
factorize,
givens,
hessfact!,
hessfact,
isdiag,
ishermitian,
isposdef!,
isposdef,
issymmetric,
istril,
istriu,
# det,
# diag,
# diagind,
# diagm,
# diff,
# dot,
# eig,
# eigfact!,
# eigfact,
# eigmax,
# eigmin,
# eigvals,
# eigvals!,
# eigvecs,
# factorize,
# givens,
# hessfact!,
# hessfact,
# isdiag,
# ishermitian,
# isposdef!,
# isposdef,
# issymmetric,
# istril,
# istriu,
kron,
ldltfact,
ldltfact!,
linreg,
logabsdet,
logdet,
lu,
lufact!,
lufact,
lyap,
norm,
normalize,
normalize!,
nullspace,
ordschur!,
ordschur,
peakflops,
pinv,
qr,
qrfact!,
qrfact,
lq,
lqfact!,
lqfact,
rank,
scale!,
schur,
schurfact!,
schurfact,
svd,
svdfact!,
svdfact,
svdvals!,
svdvals,
sylvester,
trace,
transpose!,
# ldltfact,
# ldltfact!,
# linreg,
# logabsdet,
# logdet,
# lu,
# lufact!,
# lufact,
# lyap,
# norm,
# normalize,
# normalize!,
# nullspace,
# ordschur!,
# ordschur,
# peakflops,
# pinv,
# qr,
# qrfact!,
# qrfact,
# lq,
# lqfact!,
# lqfact,
# rank,
# scale!,
# schur,
# schurfact!,
# schurfact,
# svd,
# svdfact!,
# svdfact,
# svdvals!,
# svdvals,
# sylvester,
# trace,
# transpose!,
transpose,
tril!,
tril,
triu!,
triu,
vecdot,
vecnorm,
,
×,
# tril!,
# tril,
# triu!,
# triu,
# vecdot,
# vecnorm,
# ⋅,
# ×,

# bitarrays
falses,
Expand Down
14 changes: 7 additions & 7 deletions base/interactiveutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,13 @@ function versioninfo(io::IO=STDOUT; verbose::Bool=false, packages::Bool=false)
println(io)
end
println(io, " WORD_SIZE: ", Sys.WORD_SIZE)
if Base.libblas_name == "libopenblas" || BLAS.vendor() == :openblas || BLAS.vendor() == :openblas64
openblas_config = BLAS.openblas_get_config()
println(io, " BLAS: libopenblas (", openblas_config, ")")
else
println(io, " BLAS: ",libblas_name)
end
println(io, " LAPACK: ",liblapack_name)
# if Base.libblas_name == "libopenblas" || BLAS.vendor() == :openblas || BLAS.vendor() == :openblas64
# openblas_config = BLAS.openblas_get_config()
# println(io, " BLAS: libopenblas (", openblas_config, ")")
# else
# println(io, " BLAS: ",libblas_name)
# end
# println(io, " LAPACK: ",liblapack_name)
println(io, " LIBM: ",libm_name)
println(io, " LLVM: libLLVM-",libllvm_version," (", Sys.JIT, ", ", Sys.CPU_NAME, ")")

Expand Down
2 changes: 1 addition & 1 deletion base/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ end
Compute the hypotenuse ``\\sqrt{\\sum x_i^2}`` avoiding overflow and underflow.
"""
hypot(x::Number...) = vecnorm(x)
hypot(x::Number...) = sqrt(sum(abs2(y) for y in x))

"""
atan2(y, x)
Expand Down
2 changes: 1 addition & 1 deletion base/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ precompile(Tuple{typeof(Base.join), Base.GenericIOBuffer{Array{UInt8, 1}}, Tuple
precompile(Tuple{typeof(Base.setindex!), Base.Dict{Int64, Nothing}, Nothing, Int64})
precompile(Tuple{Type{Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}}, Tuple{Int64}})
precompile(Tuple{typeof(Base.eachindex), Array{Union{Tuple{Any, Int64}, Tuple{Tuple{}, Any, Bool}}, 1}})
precompile(Tuple{typeof(Base.LinAlg.BLAS.set_num_threads), Int64})
# precompile(Tuple{typeof(Base.LinearAlgebra.BLAS.set_num_threads), Int64})
precompile(Tuple{typeof(Base.eltype), Type{Base.Union{IO, Nothing}}})
precompile(Tuple{Type{Base.Union{IO, Nothing}}})
precompile(Tuple{typeof(Base.eltype), Type{Base.Union{AbstractString, Nothing}}})
Expand Down
8 changes: 4 additions & 4 deletions base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Get the name of a `Module` as a `Symbol`.
# Examples
```jldoctest
julia> module_name(Base.LinAlg)
:LinAlg
julia> module_name(Base.Broadcast)
:Broadcast
```
"""
module_name(m::Module) = ccall(:jl_module_name, Ref{Symbol}, (Any,), m)
Expand All @@ -25,8 +25,8 @@ Get a module's enclosing `Module`. `Main` is its own parent.
julia> module_parent(Main)
Main
julia> module_parent(Base.LinAlg.BLAS)
Base.LinAlg
julia> module_parent(Base.Broadcast)
Base
```
"""
module_parent(m::Module) = ccall(:jl_module_parent, Ref{Module}, (Any,), m)
Expand Down
Loading

0 comments on commit d2dbcce

Please sign in to comment.