Where is sparse ldlt?

The manual says it is in “CHOLMOD library from SuiteSparse” (
Linear Algebra · The Julia Language).
I cannot find it there:

julia> SuiteSparse.CHOLMOD.                                                                                                                      
@cholmod_param                 _copy!                          factor_to_sparse!               print_factor                                      
BUILD_VERSION                  _extract_args                   factorize!                      print_sparse                                      
CHOLMODException               _sort_buffers!                  factorize_p!                    read_sparse                                       
CHOLMOD_MIN_VERSION            _trim_nz_builder!               free!                           scale!                                            
COMMONS                        aat                             getLd!                          sdmult!                                           
Dense                          allocate_dense                  get_perm                        showfactor                                        
Factor                         allocate_sparse                 horzcat                         solve                                             
FactorComponent                analyze                         include                         sort!                                             
ITypes                         analyze_p                       isvalid                         sparse_to_dense                                   
IndexTypes                     change_factor!                  ityp                            speye                                             
RealHermSymComplexHermF64SSL   change_stype!                   lowrank_reorder                 spsolve                                           
Sparse                         check_dense                     lowrankdowndate                 ssmult                                            
SparseVecOrMat                 check_factor                    lowrankdowndate!                symbolic                                          
StridedVecOrMatInclAdjAndTrans check_sparse                    lowrankupdate                   symmetry                                          
SuiteSparseStruct              dense_to_sparse                 lowrankupdate!                  transpose_                                        
VRealTypes                     dtyp                            lowrankupdowndate!              vertcat                                           
VTypes                         error_handler                   norm_dense                      xtyp                                              
__SPARSE_STYPE_OFFSET          eval                            norm_sparse                     zeros                                             
__init__                       eye                             ones                                                                              
julia> SuiteSparse.CHOLMOD.

The manual also says that it is wrapped in " Base.SparseArrays.CHOLMOD". These are the symbols

julia> SparseArrays.                                                                                                                             
@unarymap_nz2z_z2z                         _checkargs_sourcecompatworkcolptr_permute!  fkeep!                                                    
@unarymap_z2nz                             _checkargs_sourcecompatworkmat_permute!     ftranspose                                                
AbstractSparseArray                        _checkbuffers                               ftranspose!                                               
AbstractSparseMatrix                       _computecolptrs_halfperm!                   getcolptr                                                 
AbstractSparseMatrixCSC                    _computecolptrs_permute!                    getindex_I_sorted                                         
AbstractSparseVector                       _dense2indval!                              getindex_I_sorted_bsearch_A                               
AbstractTriangularSparse                   _dense2sparsevec                            getindex_I_sorted_bsearch_I                               
AdjOrTransDenseMatrix                      _densifyfirstnztoend!                       getindex_I_sorted_linear                                  
AdjOrTransSparseVectorUnion                _densifystarttolastnz!                      getindex_cols                                             
BiTriSym                                   _distributevals_halfperm!                   getindex_general                                          
DenseInputVecOrMat                         _fillnonzero!                               getindex_traverse_col                                     
DenseInputVector                           _findr                                      getnzval                                                  
DenseMatrixUnion                           _findz                                      getrowval                                                 
HigherOrderFns                             _goodbuffers                                halfperm!                                                 
LowerTriangularPlain                       _indices                                    ilog2                                                     
LowerTriangularSparse                      _insert!                                    include                                                   
LowerTriangularWrapped                     _isgreater_fm                               indtype                                                   
SparseColumnView                           _isless_fm                                  is_hermsym                                                
SparseMatrixCSC                            _ispermutationvalid_permute!                issparse                                                  
SparseMatrixCSCSymmHerm                    _ldiv!                                      iswrsparse                                                
SparseMatrixCSCUnion                       _lmul!                                      nnz                                                       
SparseMatrixCSCView                        _logical_index                              nnz1                                                      
SparseOrTri                                _mapreducecols!                             nonzeroinds                                               
SparseTriangular                           _mapreducerows!                             nonzeros                                                  
SparseVector                               _mapreducezeros                             nzrange                                                   
SparseVectorUnion                          _maximum                                    nzrangelo                                                 
SparseVectorView                           _minimum                                    nzrangeup                                                 
TriangularSparse                           _mul!                                       nzvalview                                                 
UnitDiagonalTriangular                     _nnz                                        opnormestinv                                              
UpperTriangularPlain                       _nzvals                                     permute                                                   
UpperTriangularSparse                      _setindex_scalar!                           permute_rows!                                             
UpperTriangularWrapped                     _show_with_braille_patterns                 possible_adjoint                                          
WrapperMatrixTypes                         _sparse_copyto!                             prefer_sort                                               
_Annotated_DenseArrays                     _sparse_findnextnz                          prep_sparsevec_copy_dest!                                 
_Annotated_SparseConcatArrays              _sparse_findprevnz                          rangesearch                                               
_Annotated_Typed_DenseArrays               _sparse_gen                                 rowvals                                                   
_At_or_Ac_mul_B                            _sparsem                                    sparse                                                    
_At_or_Ac_mul_B!                           _sparsesimilar                              sparse!                                                   
_DenseConcatGroup                          _sparsevector!                              sparse_check                                              
_Hermitian_DenseArrays                     _sparsewrap                                 sparse_check_Ti                                           
_Hermitian_SparseConcatArrays              _spdiagm                                    sparse_check_length                                       
_SparseArrays                              _spdot                                      sparse_compute_reshaped_colptr_and_rowval!                
_SparseConcatArrays                        _spgetindex                                 sparse_diff1                                              
_SparseConcatGroup                         _spsetnz_setindex!                          sparse_diff2                                              
_SpecialArrays                             _spsetz_setindex!                           sparse_sortedlinearindices!                               
_StridedOrTriangularMatrix                 _sum                                        sparsevec                                                 
_Symmetric_DenseArrays                     _swap!                                      spcolmul!                                                 
_Symmetric_SparseConcatArrays              _to_same_csc                                spdiagm                                                   
_Triangular_DenseArrays                    blockdiag                                   spdiagm_internal                                          
_Triangular_SparseConcatArrays             brailleBlocks                               spmatmul                                                  
_TypedDenseConcatGroup                     copyinds!                                   spmatmul1                                                 
_absspvec_hcat                             densemv                                     spmatmulv                                                 
_absspvec_vcat                             depth                                       sprand                                                    
_bcast_binary_map                          dimlub                                      sprandn                                                   
_binarymap                                 dropstored!                                 spzeros                                                   
_binarymap_mode_0!                         droptol!                                    stuffcol!                                                 
_binarymap_mode_1!                         dropzeros                                   subvector_shifter!                                        
_binarymap_mode_2!                         dropzeros!                                  truebools                                                 
_blockdiag                                 estimate_mulsize                            unchecked_aliasing_permute!                               
_checkargs_permutationsvalid_permute!      eval                                        unchecked_noalias_permute!                                
_checkargs_sourcecompatdest_permute!       expandptr                                   unwrap                                                    
_checkargs_sourcecompatperms_permute!      findnz                                      widelength                                                
julia> SparseArrays.

and CHOLMOD is not there.

I think the code changed, while the documentation lags behind. Does anyone know how to locate that solver?

1 Like

It’s still there (1.7.2)

julia> import SparseArrays

julia> SparseArrays.ldlt
ldlt (generic function with 3 methods)

julia> methods(SparseArrays.ldlt)
# 3 methods for generic function "ldlt":
[1] ldlt(M::SymTridiagonal{T, V} where V<:AbstractVector{T}; shift) where T in LinearAlgebra at C:\Users\stephan\AppData\Local\Programs\Julia-1.7.2\share\julia\stdlib\v1.7\LinearAlgebra\src\ldlt.jl:161
[2] ldlt(A::SuiteSparse.CHOLMOD.Sparse; shift, check, perm) in SuiteSparse.CHOLMOD at C:\Users\stephan\AppData\Local\Programs\Julia-1.7.2\share\julia\stdlib\v1.7\SuiteSparse\src\cholmod.jl:1336
[3] ldlt(A::Union{Hermitian{Complex{T}, SparseMatrixCSC{Complex{T}, Int64}}, Hermitian{T, SparseMatrixCSC{T, Int64}}, Symmetric{T, SparseMatrixCSC{T, Int64}}, SparseMatrixCSC{Complex{T}}, SparseMatrixCSC{T}}; kws...) where T<:Real in SuiteSparse.CHOLMOD at C:\Users\stephan\AppData\Local\Programs\Julia-1.7.2\share\julia\stdlib\v1.7\SuiteSparse\src\cholmod.jl:1396

but strangely doesn’t appear in the tab-completion. I’ve had that happening recently with another package, which tripped me up too.

This happens apparently because SparseArrays extends ldlt from LinearAlgebra. Why it works this way or doesn’t, I cannot say.

julia> module ModA
       export f
       f(x::Float64) = x
       end
Main.ModA

julia> module ModB
       import ..ModA: f
       f(x::Int) = x^2
       end
Main.ModB

julia> ModA.

eval    f        include
julia> ModB.

eval    include

julia> ModB.f
f (generic function with 2 methods)
1 Like

Posted in REPL tab completion: some completions are missing · Issue #40356 · JuliaLang/julia · GitHub