Re: in not working for arrays is silly, change my view

2020-03-02 Thread JN via Digitalmars-d-learn
On Saturday, 29 February 2020 at 21:56:51 UTC, Ali Çehreli wrote: Because you mentioned canFind, I think you want the semantics to be "is there an element with this value." If so, it would be confusing to use the same operator for two different things: For associative arrays, it means "is

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread p.shkadzko via Digitalmars-d-learn
On Monday, 2 March 2020 at 11:33:25 UTC, jmh530 wrote: On Sunday, 1 March 2020 at 20:58:42 UTC, p.shkadzko wrote: Hello again, [snip] What compiler did you use and what flags? Ah yes, sorry. I used latest ldc2 (1.20.0-x64) for Windows. Dflags -mcpu=native and "inline", "optimize",

Re: in not working for arrays is silly, change my view

2020-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/20 6:39 AM, JN wrote: On Saturday, 29 February 2020 at 21:56:51 UTC, Ali Çehreli wrote: Because you mentioned canFind, I think you want the semantics to be "is there an element with this value." If so, it would be confusing to use the same operator for two different things: For

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread jmh530 via Digitalmars-d-learn
On Monday, 2 March 2020 at 13:35:15 UTC, p.shkadzko wrote: [snip] Thanks. I don't have time right now to review this thoroughly. My recollection is that the dot product of two matrices is actually matrix multiplication, correct? It generally makes sense to defer to other people's

Re: in not working for arrays is silly, change my view

2020-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/20 6:52 AM, Andrea Fontana wrote: On Saturday, 29 February 2020 at 20:11:24 UTC, Steven Schveighoffer wrote: 1. in is supposed to be O(lg(n)) or better. Generic code may depend on this property. Searching an array is O(n). Probably it should work if we're using a "SortedRange". int[]

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread jmh530 via Digitalmars-d-learn
On Sunday, 1 March 2020 at 20:58:42 UTC, p.shkadzko wrote: Hello again, [snip] What compiler did you use and what flags?

Re: in not working for arrays is silly, change my view

2020-03-02 Thread Andrea Fontana via Digitalmars-d-learn
On Saturday, 29 February 2020 at 20:11:24 UTC, Steven Schveighoffer wrote: 1. in is supposed to be O(lg(n)) or better. Generic code may depend on this property. Searching an array is O(n). Probably it should work if we're using a "SortedRange". int[] a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; auto

GtkD - Add images to IconView with Pixbuf

2020-03-02 Thread cfcd14f496326e429ce03c48650b7966 via Digitalmars-d-learn
Hello. :-) I found this guide : https://www.kksou.com/php-gtk2/sample-codes/display-a-list-of-thumbnail-images-using-GtkIconView.php This guide used 'Pixbuf' for use fromFile method, but GtkD don't have it. : https://api.gtkd.org/gdkpixbuf.Pixbuf.Pixbuf.html Is there any other way? Thanks.

Re: Using LDC2 on ARM

2020-03-02 Thread Daniel Kozak via Digitalmars-d-learn
On Mon, Mar 2, 2020 at 7:40 PM Daniel Kozak wrote: > > On Mon, Mar 2, 2020 at 6:50 PM Severin Teona via Digitalmars-d-learn > Do you really need to build you app on arm, could not you use crosscompiling? https://wiki.dlang.org/Cross-compiling_with_LDC

Re: Using LDC2 on ARM

2020-03-02 Thread Daniel Kozak via Digitalmars-d-learn
On Mon, Mar 2, 2020 at 6:50 PM Severin Teona via Digitalmars-d-learn wrote: > > Hello, > > I am working on a project that uses a Raspberry Pi (armv7l) and > the latest LDC version I found for this architecture is 1.13.0. > Can you help me install the latest version(1.20.0)? > > Also, I'm having

Using LDC2 on ARM

2020-03-02 Thread Severin Teona via Digitalmars-d-learn
Hello, I am working on a project that uses a Raspberry Pi (armv7l) and the latest LDC version I found for this architecture is 1.13.0. Can you help me install the latest version(1.20.0)? Also, I'm having problems using the DPP package with the 1.13.0 LDC version, most likely because the

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread p.shkadzko via Digitalmars-d-learn
On Monday, 2 March 2020 at 15:00:56 UTC, jmh530 wrote: On Monday, 2 March 2020 at 13:35:15 UTC, p.shkadzko wrote: [snip] Thanks. I don't have time right now to review this thoroughly. My recollection is that the dot product of two matrices is actually matrix multiplication, correct? It

Re: Using LDC2 on ARM

2020-03-02 Thread Daniel Kozak via Digitalmars-d-learn
On Mon, Mar 2, 2020 at 7:40 PM Daniel Kozak wrote: > > On Mon, Mar 2, 2020 at 6:50 PM Severin Teona via Digitalmars-d-learn > wrote: > > > > Hello, > > > > I am working on a project that uses a Raspberry Pi (armv7l) and > > the latest LDC version I found for this architecture is 1.13.0. > > Can

Re: Using LDC2 on ARM

2020-03-02 Thread Andre Pany via Digitalmars-d-learn
On Monday, 2 March 2020 at 17:45:26 UTC, Severin Teona wrote: Hello, I am working on a project that uses a Raspberry Pi (armv7l) and the latest LDC version I found for this architecture is 1.13.0. Can you help me install the latest version(1.20.0)? Also, I'm having problems using the DPP

Re: Using LDC2 on ARM

2020-03-02 Thread kinke via Digitalmars-d-learn
On Monday, 2 March 2020 at 17:45:26 UTC, Severin Teona wrote: Is there any reason why the LDC team stopped releasing pre-built binaries for arm? It's the only package that isn't auto-generated by CI services and requires manual steps in a painfully slow qemu environment, a process that takes

Re: in not working for arrays is silly, change my view

2020-03-02 Thread aliak via Digitalmars-d-learn
On Monday, 2 March 2020 at 21:33:37 UTC, Steven Schveighoffer wrote: On 3/2/20 3:52 PM, aliak wrote: On Monday, 2 March 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: On 3/2/20 6:52 AM, Andrea Fontana wrote: On Saturday, 29 February 2020 at 20:11:24 UTC, Steven Schveighoffer wrote: 1. in

Re: in not working for arrays is silly, change my view

2020-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/20 5:21 PM, aliak wrote: On Monday, 2 March 2020 at 21:33:37 UTC, Steven Schveighoffer wrote: On 3/2/20 3:52 PM, aliak wrote: On Monday, 2 March 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: On 3/2/20 6:52 AM, Andrea Fontana wrote: On Saturday, 29 February 2020 at 20:11:24 UTC,

Re: in not working for arrays is silly, change my view

2020-03-02 Thread aliak via Digitalmars-d-learn
On Monday, 2 March 2020 at 15:50:08 UTC, Steven Schveighoffer wrote: On 3/2/20 6:39 AM, JN wrote: On Saturday, 29 February 2020 at 21:56:51 UTC, Ali Çehreli wrote: Because you mentioned canFind, I think you want the semantics to be "is there an element with this value." If so, it would be

Re: in not working for arrays is silly, change my view

2020-03-02 Thread aliak via Digitalmars-d-learn
On Monday, 2 March 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: On 3/2/20 6:52 AM, Andrea Fontana wrote: On Saturday, 29 February 2020 at 20:11:24 UTC, Steven Schveighoffer wrote: 1. in is supposed to be O(lg(n)) or better. Generic code may depend on this property. Searching an array is

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread p.shkadzko via Digitalmars-d-learn
On Monday, 2 March 2020 at 20:56:50 UTC, jmh530 wrote: On Monday, 2 March 2020 at 20:22:55 UTC, p.shkadzko wrote: [snip] Interesting growth of processing time. Could it be GC? +--+-+ | matrixDotProduct | time (sec.) | +--+-+ | 2x[100 x

Re: in not working for arrays is silly, change my view

2020-03-02 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 02, 2020 at 06:27:22PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] > Yeah, this looked very fishy to me. ldc can do some nasty "helpful" > things to save you time! When I posted my results, I was using DMD. > > I used run.dlang.io with ldc, and verified I get the

Re: in not working for arrays is silly, change my view

2020-03-02 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 02, 2020 at 07:51:34PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] > On 3/2/20 6:46 PM, H. S. Teoh wrote: > > To prevent the optimizer from eliding "useless" code, you need to do > > something with the return value that isn't trivial (assigning to a > > variable

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread 9il via Digitalmars-d-learn
On Sunday, 1 March 2020 at 20:58:42 UTC, p.shkadzko wrote: Hello again, Thanks to previous thread on multidimensional arrays, I managed to play around with pure D matrix representations and even benchmark a little against numpy: [...] Matrix multiplication is about cache-friendly

Re: in not working for arrays is silly, change my view

2020-03-02 Thread aliak via Digitalmars-d-learn
On Monday, 2 March 2020 at 23:27:22 UTC, Steven Schveighoffer wrote: What I think is happening is that it determines nobody is using the result, and the function is pure, so it doesn't bother calling that function (probably not even the lambda, and then probably removes the loop completely).

Re: in not working for arrays is silly, change my view

2020-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/20 7:32 PM, aliak wrote: On Monday, 2 March 2020 at 23:27:22 UTC, Steven Schveighoffer wrote: What I think is happening is that it determines nobody is using the result, and the function is pure, so it doesn't bother calling that function (probably not even the lambda, and then

Re: Using LDC2 on ARM

2020-03-02 Thread dangbinghoo via Digitalmars-d-learn
On Monday, 2 March 2020 at 17:45:26 UTC, Severin Teona wrote: Hello, I am working on a project that uses a Raspberry Pi (armv7l) and the latest LDC version I found for this architecture is 1.13.0. Can you help me install the latest version(1.20.0)? Also, I'm having problems using the DPP

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread jmh530 via Digitalmars-d-learn
On Monday, 2 March 2020 at 18:17:05 UTC, p.shkadzko wrote: [snip] I tested @fastmath and @optmath for toIdx function and that didn't change anyting. @optmath is from mir, correct? I believe it implies @fastmath. The latest code in mir doesn't have it doing anything else at least.

Re: GtkD - Add images to IconView with Pixbuf

2020-03-02 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 2 March 2020 at 16:37:46 UTC, cfcd14f496326e429ce03c48650b7966 wrote: Hello. :-) I found this guide : https://www.kksou.com/php-gtk2/sample-codes/display-a-list-of-thumbnail-images-using-GtkIconView.php This guide used 'Pixbuf' for use fromFile method, but GtkD don't have it. :

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread jmh530 via Digitalmars-d-learn
On Monday, 2 March 2020 at 20:22:55 UTC, p.shkadzko wrote: [snip] Interesting growth of processing time. Could it be GC? +--+-+ | matrixDotProduct | time (sec.) | +--+-+ | 2x[100 x 100]|0.01 | | 2x[1000 x 1000] |2.21

Re: in not working for arrays is silly, change my view

2020-03-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/2/20 3:52 PM, aliak wrote: On Monday, 2 March 2020 at 15:47:26 UTC, Steven Schveighoffer wrote: On 3/2/20 6:52 AM, Andrea Fontana wrote: On Saturday, 29 February 2020 at 20:11:24 UTC, Steven Schveighoffer wrote: 1. in is supposed to be O(lg(n)) or better. Generic code may depend on this

Re: Improving dot product for standard multidimensional D arrays

2020-03-02 Thread p.shkadzko via Digitalmars-d-learn
On Sunday, 1 March 2020 at 20:58:42 UTC, p.shkadzko wrote: Hello again, Thanks to previous thread on multidimensional arrays, I managed to play around with pure D matrix representations and even benchmark a little against numpy: [...] Interesting growth of processing time. Could it be GC?