All Projects → mateuszbaran → Hybridarrays.jl

mateuszbaran / Hybridarrays.jl

Licence: mit
Arrays with both statically and dynamically sized axes in Julia

Programming Languages

julia
2034 projects

Labels

Projects that are alternatives of or similar to Hybridarrays.jl

HybridArrays.jl
Arrays with both statically and dynamically sized axes in Julia
Stars: ✭ 39 (+30%)
Mutual labels:  arrays
dsalgo
Contains Algorithms useful for interview preparation, various practice problems of Arrays, Stacks, queue etc. Contributors are Welcome but, DO NOT MAKE THIS REPO ACT LIKE A SOURCE OF +1.
Stars: ✭ 45 (+50%)
Mutual labels:  arrays
Zfp
Compressed numerical arrays that support high-speed random access
Stars: ✭ 384 (+1180%)
Mutual labels:  arrays
ROCArrays.jl
Parallel on the ROCks
Stars: ✭ 17 (-43.33%)
Mutual labels:  arrays
Professional-JavaScript
Fast-track your web development career using the powerful features of advanced JavaScript
Stars: ✭ 28 (-6.67%)
Mutual labels:  arrays
Data Structures Algorithms
My implementation of 85+ popular data structures and algorithms and interview questions in Python 3 and C++
Stars: ✭ 273 (+810%)
Mutual labels:  arrays
InterviewBit
Collection of solution for problems on InterviewBit
Stars: ✭ 77 (+156.67%)
Mutual labels:  arrays
Koazee
A StreamLike, Immutable, Lazy Loading and smart Golang Library to deal with slices.
Stars: ✭ 446 (+1386.67%)
Mutual labels:  arrays
Data-structures
Data Structures in Java
Stars: ✭ 13 (-56.67%)
Mutual labels:  arrays
Ojalgo
oj! Algorithms
Stars: ✭ 336 (+1020%)
Mutual labels:  arrays
pytest-arraydiff
pytest plugin to facilitate comparison of results to a pre-defined reference
Stars: ✭ 12 (-60%)
Mutual labels:  arrays
Java-Questions-and-Solutions
This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
Stars: ✭ 34 (+13.33%)
Mutual labels:  arrays
Javascript For Everyone
A step by step guide to learn JavaScript and programming
Stars: ✭ 285 (+850%)
Mutual labels:  arrays
Swift101
That contains various information and examples about the basics of Swift Programming. 💻 📱 📺 ⌚️
Stars: ✭ 28 (-6.67%)
Mutual labels:  arrays
Arquero
Query processing and transformation of array-backed data tables.
Stars: ✭ 384 (+1180%)
Mutual labels:  arrays
spark-hats
Nested array transformation helper extensions for Apache Spark
Stars: ✭ 21 (-30%)
Mutual labels:  arrays
js-utils
A collection of dependency-free JavaScript utilities 🔧
Stars: ✭ 22 (-26.67%)
Mutual labels:  arrays
Pandapy
PandaPy has the speed of NumPy and the usability of Pandas 10x to 50x faster (by @firmai)
Stars: ✭ 474 (+1480%)
Mutual labels:  arrays
Cracking The Coding Interview
📚 C++ and Python solutions with automated tests for Cracking the Coding Interview 6th Edition.
Stars: ✭ 396 (+1220%)
Mutual labels:  arrays
Massiv
Efficient Haskell Arrays featuring Parallel computation
Stars: ✭ 328 (+993.33%)
Mutual labels:  arrays
Status Coverage
CI codecov.io

HybridArrays.jl

Arrays with both statically and dynamically sized axes in Julia. This is a convenient replacement for the commonly used Arrayss of SArrays which are fast but not easy to mutate. HybridArray makes this easier: any AbstractArray can be wrapped in a structure that specifies which axes are statically sized. Based on this information code for getindex, setindex! and broadcasting is (or should soon be, not all cases have been optimized yet) as efficient as for Arrayss of SArrays while mutation of single elements is possible, as well as other operations on the wrapped array.

Views are statically sized where possible for fast and convenient mutation of HybridArrays.

Example:

julia> using HybridArrays, StaticArrays

julia> A = HybridArray{Tuple{2,2,StaticArrays.Dynamic()}}(randn(2,2,100));

julia> A[1,1,10] = 12
12

julia> A[:,:,10]
2×2 SArray{Tuple{2,2},Float64,2,4} with indices SOneTo(2)×SOneTo(2):
 12.0       -1.39943
 -0.450564  -0.140096

julia> A[2,:,:]
2×100 HybridArray{Tuple{2,StaticArrays.Dynamic()},Float64,2,2,Array{Float64,2}} with indices SOneTo(2)×Base.OneTo(100):
 -0.262977  1.40715  -0.110194      -1.67315    2.30679   0.931161
 -0.432229  3.04082  -0.00971933     -0.905037  -0.446818  0.777833

julia> A[:,:,10] .*= 2
2×2 SizedArray{Tuple{2,2},Float64,2,2,SubArray{Float64,2,HybridArray{Tuple{2,2,StaticArrays.Dynamic()},Float64,3,3,Array{Float64,3}},Tuple{Base.Slice{SOneTo{2}},Base.Slice{SOneTo{2}},Int64},true}} with indices SOneTo(2)×SOneTo(2):
 24.0       -2.79886
 -0.901128  -0.280193

julia> A[:,:,10] = SMatrix{2,2}(1:4)
2×2 SArray{Tuple{2,2},Int64,2,4} with indices SOneTo(2)×SOneTo(2):
 1  3
 2  4

HybridArrays.jl is implements (optionally loaded) ArrayInterface methods for compatibility with LoopVectorization.

Tips:

  • If possible, statically known dimensions should come first. This way the most common access pattern where indices of dynamic dimensions are specified will be faster.
  • Since version 0.4 of HybridArrays, Julia 1.5 or newer is required for best performance (most importantly the memory layout changes). It still works correctly on earlier versions of Julia but versions from the 0.3.x line may be faster in some cases on Julia <=1.4.

Code of this package is based on the code of the StaticArrays.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].