Why is the interleave_view missing in the range-v3 library?
In Eric Niebler's range-v3 calendar example he uses interleave followed by chunk to transpose a matrix.
I wonder why interleave is not part of the range-v3 library...
c++ range-v3
add a comment |
In Eric Niebler's range-v3 calendar example he uses interleave followed by chunk to transpose a matrix.
I wonder why interleave is not part of the range-v3 library...
c++ range-v3
you can raise that issue with Eric Niebler here. Better yet you can even fork from his library and implement the function yourself. Hence the power of open-source software.
– Joey Mallone
Jan 3 at 12:49
5
See github.com/ericniebler/range-v3/issues/776
– Holt
Jan 3 at 12:50
add a comment |
In Eric Niebler's range-v3 calendar example he uses interleave followed by chunk to transpose a matrix.
I wonder why interleave is not part of the range-v3 library...
c++ range-v3
In Eric Niebler's range-v3 calendar example he uses interleave followed by chunk to transpose a matrix.
I wonder why interleave is not part of the range-v3 library...
c++ range-v3
c++ range-v3
edited Jan 18 at 19:16
marc_s
583k13011241270
583k13011241270
asked Jan 3 at 12:36
Porsche9IIPorsche9II
859
859
you can raise that issue with Eric Niebler here. Better yet you can even fork from his library and implement the function yourself. Hence the power of open-source software.
– Joey Mallone
Jan 3 at 12:49
5
See github.com/ericniebler/range-v3/issues/776
– Holt
Jan 3 at 12:50
add a comment |
you can raise that issue with Eric Niebler here. Better yet you can even fork from his library and implement the function yourself. Hence the power of open-source software.
– Joey Mallone
Jan 3 at 12:49
5
See github.com/ericniebler/range-v3/issues/776
– Holt
Jan 3 at 12:50
you can raise that issue with Eric Niebler here. Better yet you can even fork from his library and implement the function yourself. Hence the power of open-source software.
– Joey Mallone
Jan 3 at 12:49
you can raise that issue with Eric Niebler here. Better yet you can even fork from his library and implement the function yourself. Hence the power of open-source software.
– Joey Mallone
Jan 3 at 12:49
5
5
See github.com/ericniebler/range-v3/issues/776
– Holt
Jan 3 at 12:50
See github.com/ericniebler/range-v3/issues/776
– Holt
Jan 3 at 12:50
add a comment |
1 Answer
1
active
oldest
votes
Lack of time, and some unsolved design difficulties. For instance, what does it mean to interleave ranges of different lengths? That wasn't a problem in the calendar example, but it's a question that needs to have an answer before the interleave view can be part of range-v3.
Thank you for the clarification - for my purposes I want to transpose a matrix - so all ranges have the same lengths. I copied your interleave_view from the calender example to link. Unfortunately, the direct transpose viavector<vector<int>> n_x_m_matrix = m_x_n_matrix | interleave() | chunk(n_cols);
is slower thanvector<int> vec_temp = m_x_n_matrix | interleave(); vector<vector<int>> n_x_m_matrix_fast = vec_temp | chunk(n_cols);
– Porsche9II
Jan 3 at 16:47
Interleave for ranges of different size: I would suggest that[1, 2, 3, 4],[a, b, c],[I, II, III, IV, V]]
interleaves to[1, a, I, 2, b, II, 3, c, III, 4, IV, V]
.
– Porsche9II
Jan 3 at 17:03
That is a sensible way to interleave ranges of different sizes, but implementing that comes with runtime cost, if I remember correctly.
– Eric Niebler
Jan 3 at 21:06
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54022430%2fwhy-is-the-interleave-view-missing-in-the-range-v3-library%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Lack of time, and some unsolved design difficulties. For instance, what does it mean to interleave ranges of different lengths? That wasn't a problem in the calendar example, but it's a question that needs to have an answer before the interleave view can be part of range-v3.
Thank you for the clarification - for my purposes I want to transpose a matrix - so all ranges have the same lengths. I copied your interleave_view from the calender example to link. Unfortunately, the direct transpose viavector<vector<int>> n_x_m_matrix = m_x_n_matrix | interleave() | chunk(n_cols);
is slower thanvector<int> vec_temp = m_x_n_matrix | interleave(); vector<vector<int>> n_x_m_matrix_fast = vec_temp | chunk(n_cols);
– Porsche9II
Jan 3 at 16:47
Interleave for ranges of different size: I would suggest that[1, 2, 3, 4],[a, b, c],[I, II, III, IV, V]]
interleaves to[1, a, I, 2, b, II, 3, c, III, 4, IV, V]
.
– Porsche9II
Jan 3 at 17:03
That is a sensible way to interleave ranges of different sizes, but implementing that comes with runtime cost, if I remember correctly.
– Eric Niebler
Jan 3 at 21:06
add a comment |
Lack of time, and some unsolved design difficulties. For instance, what does it mean to interleave ranges of different lengths? That wasn't a problem in the calendar example, but it's a question that needs to have an answer before the interleave view can be part of range-v3.
Thank you for the clarification - for my purposes I want to transpose a matrix - so all ranges have the same lengths. I copied your interleave_view from the calender example to link. Unfortunately, the direct transpose viavector<vector<int>> n_x_m_matrix = m_x_n_matrix | interleave() | chunk(n_cols);
is slower thanvector<int> vec_temp = m_x_n_matrix | interleave(); vector<vector<int>> n_x_m_matrix_fast = vec_temp | chunk(n_cols);
– Porsche9II
Jan 3 at 16:47
Interleave for ranges of different size: I would suggest that[1, 2, 3, 4],[a, b, c],[I, II, III, IV, V]]
interleaves to[1, a, I, 2, b, II, 3, c, III, 4, IV, V]
.
– Porsche9II
Jan 3 at 17:03
That is a sensible way to interleave ranges of different sizes, but implementing that comes with runtime cost, if I remember correctly.
– Eric Niebler
Jan 3 at 21:06
add a comment |
Lack of time, and some unsolved design difficulties. For instance, what does it mean to interleave ranges of different lengths? That wasn't a problem in the calendar example, but it's a question that needs to have an answer before the interleave view can be part of range-v3.
Lack of time, and some unsolved design difficulties. For instance, what does it mean to interleave ranges of different lengths? That wasn't a problem in the calendar example, but it's a question that needs to have an answer before the interleave view can be part of range-v3.
answered Jan 3 at 16:01
Eric NieblerEric Niebler
3,7701431
3,7701431
Thank you for the clarification - for my purposes I want to transpose a matrix - so all ranges have the same lengths. I copied your interleave_view from the calender example to link. Unfortunately, the direct transpose viavector<vector<int>> n_x_m_matrix = m_x_n_matrix | interleave() | chunk(n_cols);
is slower thanvector<int> vec_temp = m_x_n_matrix | interleave(); vector<vector<int>> n_x_m_matrix_fast = vec_temp | chunk(n_cols);
– Porsche9II
Jan 3 at 16:47
Interleave for ranges of different size: I would suggest that[1, 2, 3, 4],[a, b, c],[I, II, III, IV, V]]
interleaves to[1, a, I, 2, b, II, 3, c, III, 4, IV, V]
.
– Porsche9II
Jan 3 at 17:03
That is a sensible way to interleave ranges of different sizes, but implementing that comes with runtime cost, if I remember correctly.
– Eric Niebler
Jan 3 at 21:06
add a comment |
Thank you for the clarification - for my purposes I want to transpose a matrix - so all ranges have the same lengths. I copied your interleave_view from the calender example to link. Unfortunately, the direct transpose viavector<vector<int>> n_x_m_matrix = m_x_n_matrix | interleave() | chunk(n_cols);
is slower thanvector<int> vec_temp = m_x_n_matrix | interleave(); vector<vector<int>> n_x_m_matrix_fast = vec_temp | chunk(n_cols);
– Porsche9II
Jan 3 at 16:47
Interleave for ranges of different size: I would suggest that[1, 2, 3, 4],[a, b, c],[I, II, III, IV, V]]
interleaves to[1, a, I, 2, b, II, 3, c, III, 4, IV, V]
.
– Porsche9II
Jan 3 at 17:03
That is a sensible way to interleave ranges of different sizes, but implementing that comes with runtime cost, if I remember correctly.
– Eric Niebler
Jan 3 at 21:06
Thank you for the clarification - for my purposes I want to transpose a matrix - so all ranges have the same lengths. I copied your interleave_view from the calender example to link. Unfortunately, the direct transpose via
vector<vector<int>> n_x_m_matrix = m_x_n_matrix | interleave() | chunk(n_cols);
is slower than vector<int> vec_temp = m_x_n_matrix | interleave(); vector<vector<int>> n_x_m_matrix_fast = vec_temp | chunk(n_cols);
– Porsche9II
Jan 3 at 16:47
Thank you for the clarification - for my purposes I want to transpose a matrix - so all ranges have the same lengths. I copied your interleave_view from the calender example to link. Unfortunately, the direct transpose via
vector<vector<int>> n_x_m_matrix = m_x_n_matrix | interleave() | chunk(n_cols);
is slower than vector<int> vec_temp = m_x_n_matrix | interleave(); vector<vector<int>> n_x_m_matrix_fast = vec_temp | chunk(n_cols);
– Porsche9II
Jan 3 at 16:47
Interleave for ranges of different size: I would suggest that
[1, 2, 3, 4],[a, b, c],[I, II, III, IV, V]]
interleaves to [1, a, I, 2, b, II, 3, c, III, 4, IV, V]
.– Porsche9II
Jan 3 at 17:03
Interleave for ranges of different size: I would suggest that
[1, 2, 3, 4],[a, b, c],[I, II, III, IV, V]]
interleaves to [1, a, I, 2, b, II, 3, c, III, 4, IV, V]
.– Porsche9II
Jan 3 at 17:03
That is a sensible way to interleave ranges of different sizes, but implementing that comes with runtime cost, if I remember correctly.
– Eric Niebler
Jan 3 at 21:06
That is a sensible way to interleave ranges of different sizes, but implementing that comes with runtime cost, if I remember correctly.
– Eric Niebler
Jan 3 at 21:06
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54022430%2fwhy-is-the-interleave-view-missing-in-the-range-v3-library%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you can raise that issue with Eric Niebler here. Better yet you can even fork from his library and implement the function yourself. Hence the power of open-source software.
– Joey Mallone
Jan 3 at 12:49
5
See github.com/ericniebler/range-v3/issues/776
– Holt
Jan 3 at 12:50