-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviordocsThis change adds or pertains to documentationThis change adds or pertains to documentationgood first issueIndicates a good issue for first-time contributors to JuliaIndicates a good issue for first-time contributors to JuliasparseSparse arraysSparse arrays
Description
The documentation of sprand
/sprandn
appears to have an error in the section https://docs.julialang.org/en/v1/stdlib/SparseArrays/#Correspondence-of-dense-and-sparse-methods-1
The table here:
shows that sprandn
takes a distribution as a final argument, but this is not the case.
The accompanying text also seems to indicate that this should work:
sprand(100, 100, 0.3, Uniform(-1,1))
while, in fact, you need
sprand(100, 100, 0.3, n->rand(Uniform(-1,1),n))
Also, the docstring of sprand
gives the wrong impression:
Nonzero values are sampled from the distribution specified by
rfn
and have the typetype
.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviordocsThis change adds or pertains to documentationThis change adds or pertains to documentationgood first issueIndicates a good issue for first-time contributors to JuliaIndicates a good issue for first-time contributors to JuliasparseSparse arraysSparse arrays