Skip to content

Conversation

9il
Copy link
Member

@9il 9il commented Jun 4, 2017

@andralex @wilzbach @ljubobratovicrelja @thewilsonator @dataPulverizer

Mir Algorithm basic API is stable enough and we can start to do reviews! Please help with that)

This PR contains fast multidimensional random access chunks. It has multidimensional slicing, builtin dimension transposition, allows to get underlying slice during life time.

Motivation of this addition is cache oriented algorithms. For example, see Chapter 1 at The Science of Programming Matrix Computations

@dataPulverizer
Copy link

Thank you very much for the update. Been very busy lately but will hopefully get some time at the end of the week to take a detailed look.

Well done

@jmh530
Copy link
Contributor

jmh530 commented Jun 7, 2017

You might add an example to mir.chunks showing that (if?) you can apply sum to the chunks. I would imagine that would be a key use case. This should allow you to row sum or column sum, if I'm not mistaken.

@9il
Copy link
Member Author

9il commented Jun 8, 2017

@jmh530 could you describe what do you mean using a small example?

@jmh530
Copy link
Contributor

jmh530 commented Jun 8, 2017

@9il I was thinking something like below would work, but I may have gotten something wrong. I haven't played with the code yet.

unittest
{
import mir.ndslice.slice : sliced;
import mir.ndslice.chunks: chunks, isChunks;
import mir.ndslice.topology: iota;
import mir.math.sum: sum;

// 0 1 2 3 4 5 6 7 8 9 10 auto sl = iota(11); // 0 1 2 | 3 4 5 | 6 7 8 | 9 10 auto ch = sl.chunks(3); // 3 | 12 | 21 | 19 auto s = ch.sum(); assert(s == [3, 12, 21, 19].sliced); 

}

@codecov-io
Copy link

codecov-io commented Jun 8, 2017

Codecov Report

Merging #45 into master will decrease coverage by 0.01%.
The diff coverage is 96.02%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #45 +/- ## ========================================== - Coverage 96.31% 96.29% -0.02%  ========================================== Files 27 28 +1 Lines 4527 4702 +175 ========================================== + Hits 4360 4528 +168  - Misses 167 174 +7
Impacted Files Coverage Δ
source/mir/ndslice/package.d 92.25% <ø> (ø) ⬆️
source/mir/ndslice/topology.d 98.93% <ø> (ø) ⬆️
source/mir/ndslice/slice.d 98.87% <100%> (+0.03%) ⬆️
source/mir/ndslice/chunks.d 95.36% <95.36%> (ø)
source/mir/functional.d 96.34% <0%> (ø) ⬆️
source/mir/ndslice/internal.d 56% <0%> (+0.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3772abc...0780e47. Read the comment docs.

@9il
Copy link
Member Author

9il commented Jun 8, 2017

@jmh530 , added - 0780e47

@9il 9il merged commit 303a2d1 into master Jun 17, 2017
@9il 9il deleted the ch2 branch June 17, 2017 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants