Skip to content

Commit 2a05ec2

Browse files
committed
remove csparse functions
The functions and tests for these function have been moved to the package CSparse.jl in the JuliaSparse organization.
1 parent d341677 commit 2a05ec2

File tree

6 files changed

+40
-208
lines changed

6 files changed

+40
-208
lines changed

LICENSE.md

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ their own licenses:
6565
The following components of Julia's standard library have separate licenses:
6666

6767
- base/fftw.jl (see [FFTW](http://fftw.org/doc/License-and-Copyright.html))
68-
- base/sparse/csparse.jl (LGPL-2.1+)
6968
- base/linalg/umfpack.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html))
7069
- base/linalg/cholmod.jl (see [SUITESPARSE](http://faculty.cse.tamu.edu/davis/suitesparse.html))
7170

base/sparse.jl

+33-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export AbstractSparseArray, AbstractSparseMatrix, AbstractSparseVector,
3636
include("sparse/abstractsparse.jl")
3737
include("sparse/sparsematrix.jl")
3838
include("sparse/sparsevector.jl")
39-
include("sparse/csparse.jl")
4039

4140
include("sparse/linalg.jl")
4241
if Base.USE_GPL_LIBS
@@ -45,4 +44,37 @@ if Base.USE_GPL_LIBS
4544
include("sparse/spqr.jl")
4645
end
4746

47+
# point users to CSparse
48+
const CSPARSE_END_ERR_SRING = string(" has been moved to the package CSparse.jl.\n",
49+
"Run Pkg.add(\"CSparse\") to install CSparse on Julia v0.5-")
50+
51+
"""
52+
etree(A[, post])
53+
Compute the elimination tree of a symmetric sparse matrix `A` from `triu(A)`
54+
and, optionally, its post-ordering permutation.
55+
56+
Note: This function has been moved to the CSparse.jl package.
57+
"""
58+
etree{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, postorder::Bool) =
59+
error("etree(A[, post])", CSPARSE_END_ERR_SRING)
60+
etree(A::SparseMatrixCSC) = etree(A, false)
61+
62+
ereach{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, k::Integer, parent::Vector{Ti})=
63+
error("ereach(A, k, parent)", CSPARSE_END_ERR_SRING)
64+
65+
csc_permute{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, pinv::Vector{Ti}, q::Vector{Ti})=
66+
error("csc_permute(A, pinv, q)", CSPARSE_END_ERR_SRING)
67+
68+
"""
69+
symperm(A, p)
70+
Return the symmetric permutation of `A`, which is `A[p,p]`. `A` should be
71+
symmetric, sparse, and only contain nonzeros in the upper triangular part of the
72+
matrix is stored. This algorithm ignores the lower triangular part of the
73+
matrix. Only the upper triangular part of the result is returned.
74+
75+
Note: This function has been moved to the CSparse.jl package.
76+
"""
77+
symperm{Tv,Ti}(A::SparseMatrixCSC{Tv,Ti}, pinv::Vector{Ti}) =
78+
error("symperm(A, pinv)", CSPARSE_END_ERR_SRING)
79+
4880
end

base/sparse/csparse.jl

-178
This file was deleted.

contrib/add_license_to_files.jl

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const skipfiles = [
3434
# files to check - already copyright
3535
# see: https://github.com/JuliaLang/julia/pull/11073#issuecomment-98099389
3636
"../base/special/trig.jl",
37-
"../base/sparse/csparse.jl",
3837
"../base/linalg/givens.jl",
3938
#
4039
"../src/abi_llvm.cpp",

doc/stdlib/arrays.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Constructors
227227

228228
.. Docstring generated from Julia source
229229
230-
Create an array with the same data as the given array, but with different dimensions. An implementation for a particular type of array may choose whether the data is copied or shared.
230+
Create an array with the same data as the given array, but with different dimensions.
231231

232232
.. function:: similar(array, [element_type=eltype(array)], [dims=size(array)])
233233

@@ -971,12 +971,16 @@ dense counterparts. The following functions are specific to sparse arrays.
971971
972972
Compute the elimination tree of a symmetric sparse matrix ``A`` from ``triu(A)`` and, optionally, its post-ordering permutation.
973973

974+
Note: This function has been moved to the CSparse.jl package.
975+
974976
.. function:: symperm(A, p)
975977

976978
.. Docstring generated from Julia source
977979
978980
Return the symmetric permutation of ``A``\ , which is ``A[p,p]``\ . ``A`` should be symmetric, sparse, and only contain nonzeros in the upper triangular part of the matrix is stored. This algorithm ignores the lower triangular part of the matrix. Only the upper triangular part of the result is returned.
979981

982+
Note: This function has been moved to the CSparse.jl package.
983+
980984
.. function:: nonzeros(A)
981985

982986
.. Docstring generated from Julia source

test/sparsedir/sparse.jl

+2-26
Original file line numberDiff line numberDiff line change
@@ -343,20 +343,6 @@ end
343343
@test full(spdiagm((ones(2), ones(2)), (0, -1), 3, 3)) ==
344344
[1.0 0.0 0.0; 1.0 1.0 0.0; 0.0 1.0 0.0]
345345

346-
# elimination tree
347-
## upper triangle of the pattern test matrix from Figure 4.2 of
348-
## "Direct Methods for Sparse Linear Systems" by Tim Davis, SIAM, 2006
349-
rowval = Int32[1,2,2,3,4,5,1,4,6,1,7,2,5,8,6,9,3,4,6,8,10,3,5,7,8,10,11]
350-
colval = Int32[1,2,3,3,4,5,6,6,6,7,7,8,8,8,9,9,10,10,10,10,10,11,11,11,11,11,11]
351-
A = sparse(rowval, colval, ones(length(rowval)))
352-
p = etree(A)
353-
P,post = etree(A, true)
354-
@test P == p
355-
@test P == Int32[6,3,8,6,8,7,9,10,10,11,0]
356-
@test post == Int32[2,3,5,8,1,4,6,7,9,10,11]
357-
@test isperm(post)
358-
359-
360346
# issue #4986, reinterpret
361347
sfe22 = speye(Float64, 2)
362348
mfe22 = eye(Float64, 2)
@@ -1019,13 +1005,9 @@ A = sparse(tril(rand(5,5)))
10191005
@test istril(A)
10201006
@test !istril(sparse(ones(5,5)))
10211007

1022-
# symperm
1023-
srand(1234321)
1024-
A = triu(sprand(10,10,0.2)) # symperm operates on upper triangle
1025-
perm = randperm(10)
1026-
@test symperm(A,perm).colptr == [1,1,2,4,5,5,6,8,8,9,10]
1027-
10281008
# droptol
1009+
srand(1234321)
1010+
A = triu(sprand(10,10,0.2))
10291011
@test Base.droptol!(A,0.01).colptr == [1,1,1,2,2,3,4,6,6,7,9]
10301012
@test isequal(Base.droptol!(sparse([1], [1], [1]), 1), SparseMatrixCSC(1,1,Int[1,1],Int[],Int[]))
10311013

@@ -1224,12 +1206,6 @@ if Base.USE_GPL_LIBS
12241206
end
12251207
@test_throws DimensionMismatch Base.SparseArrays.normestinv(sprand(3,5,.9))
12261208

1227-
# csc_permute
1228-
A = sprand(10,10,0.2)
1229-
p = randperm(10)
1230-
q = randperm(10)
1231-
@test Base.SparseArrays.csc_permute(A, invperm(p), q) == full(A)[p, q]
1232-
12331209
# issue #13008
12341210
@test_throws ArgumentError sparse(collect(1:100), collect(1:100), fill(5,100), 5, 5)
12351211
@test_throws ArgumentError sparse(Int[], collect(1:5), collect(1:5))

0 commit comments

Comments
 (0)