https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #27 from tyckesak ---
*** Issue 6788 has been marked as a duplicate of this issue. ***
--
https://issues.dlang.org/show_bug.cgi?id=7128
tyckesak changed:
What|Removed |Added
Status|REOPENED|RESOLVED
CC|
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #26 from Andrei Alexandrescu ---
@greenify thanks, I'v bootcamped it so it gets looked at again :o).
--
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #25 from greenify ---
@andralex: as there was no positive decision on the PR it's now part of Mir
(http://docs.mir.dlang.io/latest/mir_combinatorics.html) with a couple of other
goodies (more functions, allocator support).
So there is no
https://issues.dlang.org/show_bug.cgi?id=7128
Andrei Alexandrescu changed:
What|Removed |Added
Keywords||bootcamp
--
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #24 from greenify ---
As @quickfur linked to this:
I put a PR for cartesianProduct together - so maybe this issue can be tackled
:)
https://github.com/D-Programming-Language/phobos/pull/4026
--
https://issues.dlang.org/show_bug.cgi?id=7128
greenify changed:
What|Removed |Added
CC||greeen...@gmail.com
Assignee|nob...@pure
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #23 from bearophile_h...@eml.cc ---
This doesn't use an efficient algorithm, but it shows the kind of API I was
thinking of (it can be a random access range):
struct CartesianPower(bool doCopy=true, T) {
T[] items;
uint repeat;
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #22 from bearophile_h...@eml.cc ---
The 3-arguments cartesianPower!false overload can't be annotated with @nogc
because the given buffer array can be shorter than the "power" argument. Unless
you generate a run-time error in this case.
--
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #21 from bearophile_h...@eml.cc ---
A third optional argument can be a "buffer" array, if it's large enough (as
much as the "power" argument or larger), it gets used to make cartesianPower a
@nogc function:
cartesianPower!false([0, 1], 2,
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #20 from bearophile_h...@eml.cc ---
Thinking some more about this. Currently the "repeat" argument needs to be a
template argument:
cartesianProduct!2([0, 1]) ==> tuple(0,0), tuple(0,1), tuple(1,0), tuple(1,1)
But it's probably better to
https://issues.dlang.org/show_bug.cgi?id=7128
--- Comment #19 from bearophile_h...@eml.cc ---
This pull has fixed the most glaring problems of cartesianProduct:
https://github.com/D-Programming-Language/phobos/pull/2276
I leave this ER open for the "repeat" argument request (compile time argument
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #18 from bearophile_h...@eml.cc 2013-02-09 03:22:18 PST ---
Extra on cartesianProduct: maybe you should add a little benchmark, to be sure
the way you have implemented the variadic cartesianProduct() (with the
flattening of nested tu
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #17 from bearophile_h...@eml.cc 2013-02-09 03:17:30 PST ---
(In reply to comment #16)
> Hmm, you're right. The cartesian power has the advantage that the output will
> be tuples of homogenous elements, so we can use arrays instead of
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #16 from hst...@quickfur.ath.cx 2013-02-08 20:32:06 PST ---
Hmm, you're right. The cartesian power has the advantage that the output will
be tuples of homogenous elements, so we can use arrays instead of tuples, which
will allow runt
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #15 from bearophile_h...@eml.cc 2013-02-08 04:26:20 PST ---
(In reply to comment #14)
> The power must be a compile-time parameter, otherwise it won't compile.
I think it's possible to create a range like this:
auto cartesianPower(
http://d.puremagic.com/issues/show_bug.cgi?id=7128
hst...@quickfur.ath.cx changed:
What|Removed |Added
Status|RESOLVED|REOPENED
Resolution|FIX
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #13 from bearophile_h...@eml.cc 2013-02-07 18:01:50 PST ---
The repetition number is not yet supported:
auto cartesianProduct(size_t nRepetitions=0, R)(R range) { ... }
If the name if the function is different, then it's even possi
http://d.puremagic.com/issues/show_bug.cgi?id=7128
Andrei Alexandrescu changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #11 from hst...@quickfur.ath.cx 2013-02-07 12:36:01 PST ---
https://github.com/D-Programming-Language/phobos/pull/1120
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mai
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #10 from bearophile_h...@eml.cc 2013-02-07 10:17:40 PST ---
(In reply to comment #9)
> *** Issue 6788 has been marked as a duplicate of this issue. ***
It's not a dupe.
--
Configure issuemail: http://d.puremagic.com/issues/userpre
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #9 from hst...@quickfur.ath.cx 2013-02-07 09:41:05 PST ---
*** Issue 6788 has been marked as a duplicate of this issue. ***
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving thi
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #8 from bearophile_h...@eml.cc 2013-02-07 09:33:02 PST ---
See also Issue 6788
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #7 from bearophile_h...@eml.cc 2013-02-05 18:37:32 PST ---
(In reply to comment #5)
> P.S. on second thoughts, probably the second version is not implementable
> right
> now because we can't compute the type of the return value at r
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #6 from bearophile_h...@eml.cc 2013-02-05 18:34:12 PST ---
(In reply to comment #4)
Thank you for your work. I use cartesian often enough in Python.
> but this has
> the disadvantage that the resulting range will have nested tuples
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #5 from hst...@quickfur.ath.cx 2013-02-05 18:32:23 PST ---
P.S. on second thoughts, probably the second version is not implementable right
now because we can't compute the type of the return value at runtime.
--
Configure issuemail
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #4 from hst...@quickfur.ath.cx 2013-02-05 18:26:05 PST ---
Now that the basic 2-argument case is working, I'll start looking into the
multi-argument case.
The simplest implementation is to just alias the variadic version to the
2-ar
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #3 from bearophile_h...@eml.cc 2013-02-05 18:06:03 PST ---
Partially implemented:
http://forum.dlang.org/thread/510f29fd574fd_2193e77ae825...@sh2.rs.github.com.mail
Currently three or more arguments are not accepted:
import std.s
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #2 from bearophile_h...@eml.cc 2013-01-03 21:54:44 PST ---
(In reply to comment #1)
> https://github.com/D-Programming-Language/phobos/pull/856
I guess the Python "repeat" optional argument is not supported:
>>> from itertools impo
http://d.puremagic.com/issues/show_bug.cgi?id=7128
--- Comment #1 from hst...@quickfur.ath.cx 2013-01-03 21:29:14 PST ---
https://github.com/D-Programming-Language/phobos/pull/856
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail
30 matches
Mail list logo