-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚧 Nutrients.Concentration upgraded + feature expansion into dense mat…
…rix.
- Loading branch information
Showing
11 changed files
with
399 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
# Display matrix nonzero values ranges. | ||
function showrange(io::IO, m::SparseMatrix) | ||
# Display values ranges. | ||
function showrange(io::IO, values) | ||
min, max = extrema(values) | ||
if min == max | ||
print(io, "$min") | ||
else | ||
print(io, "$min to $max") | ||
end | ||
end | ||
|
||
# Restrict to nonzero values. | ||
function showrange(io::IO, m::AbstractSparseArray) | ||
nz = findnz(m)[3] | ||
if isempty(nz) | ||
print(io, "·") | ||
else | ||
min, max = extrema(nz) | ||
if min == max | ||
print(io, "$min") | ||
else | ||
print(io, "$min to $max") | ||
end | ||
showrange(io, nz) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.