-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
[ndslice] Math Index Order #3940
Conversation
@@ -57,6 +57,12 @@ Multidimensional view is presented by $(SUBREF slice, Slice) type. | |||
------ | |||
auto matrix = new double[12].sliced(3, 4); |
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.
Maybe this is a good opportunity to move this to a unit test example?
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.
No
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 not?
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.
- I want this example be in the beginning
- DDOC unittest do not work with module declarations
- The same unittest already exists without DDOC
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 is a known limitation: https://issues.dlang.org/show_bug.cgi?id=14383
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.
There is now a fix for this, that will allow (finally!!!) ddoc's unittests to work with module declarations: dlang/dmd#5465
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.
FYI, dlang/dmd#5465 has been merged, so you can now use ddoc'd unittests for the module docs.
Why not simply:
there should be no runtime penalty in doing so |
Yes, but
|
This is easy to address: simply passing along a CT parameter |
|
will it generalize to arbitrary indexing situations without additional code duplication? the advantage of Another advantage could be more code reuse, therefore smaller generated code and less instruction cache miss.
sorry I don't understand what you mean here |
According to the index type definitions
fully defined slices can be implemented without code duplication. |
... continue
Yes (excluding static arrays), I don't want it for now.
The amount of code in the release mode is obviously the same (because inlining). To make this code reusable I need to write additional templates because |
In addition, this function declaration is good for documentation. |
I trust that @9il knows what he's doing with the ndslice module, plus this is still under experimental, so I'm merging this. Nitpicks can be fixed later. |
Thx! |
Auto-merge toggled on |
libmir/mir#9