Re: Recommendation for parallelism with nested for loops?

2022-08-20 Thread Christian Köstlin via Digitalmars-d-learn
On 19.08.22 03:49, Shriramana Sharma wrote: Hello. I want to parallelize a computation which has two for loops, one nested within another. All inner-loop-param+outer-loop-param combinations can be computed independent of one another. As I suspected, [https://forum.dlang.org/post/xysyidbkjdinc

Re: Recommendation for parallelism with nested for loops?

2022-08-20 Thread Christian Köstlin via Digitalmars-d-learn
On 20.08.22 12:28, Christian Köstlin wrote: On 19.08.22 03:49, Shriramana Sharma wrote: Hello. I want to parallelize a computation which has two for loops, one nested within another. All inner-loop-param+outer-loop-param combinations can be computed independent of one another. As I suspected,

Re: Exercise at end of Ch. 56 of "Programming in D"

2022-08-20 Thread Era Scarecrow via Digitalmars-d-learn
On Monday, 15 August 2022 at 03:19:43 UTC, johntp wrote: Your solution worked. I guess it is a little unnatural to ignore the color. I tried overriding the toHash() of Point, but I don't know enough D to get it to work. I wonder if that could be a solution. Depends on what you're trying to

Re: Exercise at end of Ch. 56 of "Programming in D"

2022-08-20 Thread Paul Backus via Digitalmars-d-learn
On Monday, 15 August 2022 at 02:59:59 UTC, Ali Çehreli wrote: class Point { int x; int y; Color color; // ... override size_t toHash() const { return x + y; } } The book is simply forgetting to show that function. (Otherwise, I never put any code without testing.) WARNING: H