-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mir.sparse #79
mir.sparse #79
Conversation
Current coverage is
|
@wilzbach will use common hash map :-) initial implementation pushed to this branch |
import mir.ndslice.slice: sliced; | ||
T[size_t] table; | ||
table[0] = 0; | ||
table.remove(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to initialize table with not null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but isn't that just a language feature? Or why do you need not null?
int[int] a;
writeln(a.get(0, 2)); // 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeln(a.get(0, 2)); // 2
writeln(a) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert(a !is null); ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but isn't that just a language feature? Or why do you need not null?
For correct behavior when when coping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mind to add an unittest for the correct behavior? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
I really like the direction this is going and the seamless integration with
and some of the iteration and selection algorithms |
no, please, let me finish it first. It is faster to implement this than to review api for a couple of small functions |
toggle annoying_bot off |
Have you start to collect article information for random distributions? |
a84bf47
to
1b9d2fd
Compare
It is almost covered and passes CI tests. I have added |
} | ||
} | ||
|
||
private sizediff_t cmpCoo(size_t N)(const auto ref size_t[N] a, const auto ref size_t[N] b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you only use this once (three lines above) - thus why not directly putting it there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may be used by the future algorithms
Wow! Looks great on my first pass. I will have to play with to give further feedback (will do so tonight). Nitpicks from the first pass:
Do you plan to support the
you probably have to update the |
Yes, but when it would be at phobos.
Yes for |
i moved sparse and blas to separate package, so we would not include it to ndslice. I just added few ptr methods to ndslice. |
|
||
/++ | ||
This constructor should be used only for integration with other languages or libraries such as Julia and numpy. | ||
Params: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for changing & documenting this :)
|
||
alias round = llvm_round; | ||
|
||
alias fmuladd = llvm_fmuladd; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick - you combine white space and tabs in here :/
PR for tracking #43 implementation.