Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/francescoalemanno/defaultarrays.jl
Julia array type supporting a default value, useful for storing very sparse information in a space efficient manner, the internal design uses "Dict" for storage, thanks to Tamas K. Papp @ https://github.com/tpapp
https://github.com/francescoalemanno/defaultarrays.jl
data-structures sparse-representations
Last synced: about 2 months ago
JSON representation
Julia array type supporting a default value, useful for storing very sparse information in a space efficient manner, the internal design uses "Dict" for storage, thanks to Tamas K. Papp @ https://github.com/tpapp
- Host: GitHub
- URL: https://github.com/francescoalemanno/defaultarrays.jl
- Owner: francescoalemanno
- License: mit
- Created: 2020-02-29T14:12:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-06T17:04:35.000Z (almost 5 years ago)
- Last Synced: 2024-11-11T08:39:48.086Z (about 2 months ago)
- Topics: data-structures, sparse-representations
- Language: Julia
- Homepage:
- Size: 37.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DefaultArrays
[![Build Status](https://travis-ci.org/francescoalemanno/DefaultArrays.jl.svg?branch=master)](https://travis-ci.org/francescoalemanno/DefaultArrays.jl)
[![codecov](https://codecov.io/gh/francescoalemanno/DefaultArrays.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/francescoalemanno/DefaultArrays.jl)
[![Coverage Status](https://coveralls.io/repos/github/francescoalemanno/DefaultArrays.jl/badge.svg?branch=master)](https://coveralls.io/github/francescoalemanno/DefaultArrays.jl?branch=master)
[![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://pkg.julialang.org/docs/DefaultArrays)
Julia array type supporting a default value, useful for storing very sparse information in a space efficient manner, the internal design uses "Dict" for storage
### Installation:
Since this package is now registered do:
```julia
using Pkg; pkg"add DefaultArrays";
```### Usage:
It can be used like any other common julia array:
```julia
M=DefaultArray(0.0,100,100) #0.0 is the default value
M.=rand([zeros(50);1],100,100)for i in eachnondefault(M)
M[i]=rand()
end
Q=sin.(M)sum(Q) #-> some random value
length(Q.elements) #-> MUCH less space occupied than 100*100 = 10000
```original idea of Tamas K. Papp @ https://github.com/tpapp