Skip to content

Commit

Permalink
Merge branch 'main' into dk/trimul
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch authored Jul 17, 2023
2 parents eef56d6 + 0eb9c04 commit 65cb367
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ julia> R = sparsevec(I,V)

The inverse of the [`sparse`](@ref) and [`sparsevec`](@ref) functions is
[`findnz`](@ref), which retrieves the inputs used to create the sparse array.
[`findall(!iszero, x)`](@ref) returns the cartesian indices of non-zero entries in `x`
[`findall(!iszero, x)`](@ref) returns the Cartesian indices of non-zero entries in `x`
(including stored entries equal to zero).

```jldoctest sparse_function
Expand Down
2 changes: 1 addition & 1 deletion src/higherorderfns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const SpBroadcasted2{Style<:SPVM,Axes,F,Args<:Tuple{SparseVecOrMat,SparseVecOrMa

# (1) The definitions below provide a common interface to sparse vectors and matrices
# sufficient for the purposes of map[!]/broadcast[!]. This interface treats sparse vectors
# as n-by-one sparse matrices which, though technically incorrect, is how broacast[!] views
# as n-by-one sparse matrices which, though technically incorrect, is how broadcast[!] views
# sparse vectors in practice.
@inline numrows(A::AbstractCompressedVector) = length(A)
@inline numrows(A::AbstractSparseMatrixCSC) = size(A, 1)
Expand Down
2 changes: 1 addition & 1 deletion src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ kron(a::_SparseKronGroup, b::Number) = a * b

## det, inv, cond

inv(A::AbstractSparseMatrixCSC) = error("The inverse of a sparse matrix can often be dense and can cause the computer to run out of memory. If you are sure you have enough memory, please either convert your matrix to a dense matrix, e.g. by calling `Matrix` or if `A` can be factorized, use `\\` on the dense identity matrix, e.g. `A \\ Matrix{eltype(A)}(I, size(A)...)` restrictions of `\\` on sparse lhs applies. Altenatively, `A\\b` is generally preferable to `inv(A)*b`")
inv(A::AbstractSparseMatrixCSC) = error("The inverse of a sparse matrix can often be dense and can cause the computer to run out of memory. If you are sure you have enough memory, please either convert your matrix to a dense matrix, e.g. by calling `Matrix` or if `A` can be factorized, use `\\` on the dense identity matrix, e.g. `A \\ Matrix{eltype(A)}(I, size(A)...)` restrictions of `\\` on sparse lhs applies. Alternatively, `A\\b` is generally preferable to `inv(A)*b`")

# TODO

Expand Down
2 changes: 1 addition & 1 deletion src/solvers/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ Factor(FC::FactorComponent) = FC.F
#################

# Dense wrappers
# The ifelse here may be unecessary.
# The ifelse here may be unnecessary.
# nothing different actually occurs in cholmod_l_allocate vs cholmod_allocate AFAICT.
# And CHOLMOD has no way of tracking the difference internally (no internal itype field).
# This leads me to believe they can be mixed with long and int versions of sparse freely.
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/umfpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ UmfpackWS(F::ATLU, refinement::Bool=has_refinement(F)) = UmfpackWS(F.parent, ref
A shallow copy of UmfpackLU to use in multithreaded solve applications.
This function duplicates the working space, control, info and lock fields.
"""
# Not using simlar helps if the actual needed size has changed as it would need to be resized again
# Not using similar helps if the actual needed size has changed as it would need to be resized again
Base.copy(F::UmfpackLU{Tv, Ti}, ws=UmfpackWS(F)) where {Tv, Ti} =
UmfpackLU(
F.symbolic,
Expand Down Expand Up @@ -413,7 +413,7 @@ When `check = false`, responsibility for checking the decomposition's
validity (via [`issuccess`](@ref)) lies with the user.
The permutation `q` can either be a permutation vector or `nothing`. If no permutation vector
is proveded or `q` is `nothing`, UMFPACK's default is used. If the permutation is not zero based, a
is provided or `q` is `nothing`, UMFPACK's default is used. If the permutation is not zero based, a
zero based copy is made.
See also [`lu`](@ref)
Expand Down
4 changes: 2 additions & 2 deletions test/sparsematrix_constructors_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ end
@test Base.isstored(A, c[1], c[2]) == false
end

# `isstored` for adjoint and tranposed matrices:
# `isstored` for adjoint and transposed matrices:
for trans in (adjoint, transpose)
B = trans(A)
stored_indices = [CartesianIndex(j, i) for (j, i) in zip(J, I)]
Expand Down Expand Up @@ -1390,7 +1390,7 @@ using Base: swaprows!, swapcols!
(swaprows!, 2, 3), # Test swapping rows of unequal length
(swaprows!, 2, 4), # Test swapping non-adjacent rows
(swapcols!, 1, 2), # Test swapping columns where one column is fully sparse
(swapcols!, 2, 3), # Test swapping coulms of unequal length
(swapcols!, 2, 3), # Test swapping columns of unequal length
(swapcols!, 2, 4)) # Test swapping non-adjacent columns
Scopy = copy(S)
Sdense = Array(S)
Expand Down

0 comments on commit 65cb367

Please sign in to comment.