Re: Multidimensional slice

2014-08-10 Thread Remi Thebault via Digitalmars-d-learn
On Saturday, 9 August 2014 at 21:03:45 UTC, H. S. Teoh via Digitalmars-d-learn wrote: I think you need 2.066 or later to get this to work. After adding (size_t dim) to opSlice, your code compiles fine with git HEAD. Hi Thanks for the quick reply. Indeed I can get it to work with 2.066 Remi

Re: Multidimensional slice

2014-08-09 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Aug 09, 2014 at 08:43:32PM +, Remi Thebault via Digitalmars-d-learn wrote: > Hello D-community > > Sorry to dig an old post, but I have the exact same need. > I have C++ background and I started to use D a few days ago only > (a pity I didn't start sooner!) > > My needs are mostly ar

Re: Multidimensional slice

2014-08-09 Thread Remi Thebault via Digitalmars-d-learn
Hello D-community Sorry to dig an old post, but I have the exact same need. I have C++ background and I started to use D a few days ago only (a pity I didn't start sooner!) My needs are mostly around numerical calculations. I have a safe and efficient matrix type in C++ that I am porting to D.

Re: Multidimensional slice

2012-12-19 Thread Ali Çehreli
On 12/19/2012 11:35 AM, Ali Çehreli wrote: > On 12/19/2012 01:58 AM, Rafael wrote: > > > my ... english. > > Thank you. Your English is very well. Rather, "Your English is very good." > > //Then I want to do something like > > x = S[0..$, 1]; //get column > > S[0..$, 2] = A[0..$, 2]; //get a

Re: Multidimensional slice

2012-12-19 Thread Ali Çehreli
On 12/19/2012 01:58 AM, Rafael wrote: > my ... english. Thank you. Your English is very well. > //Then I want to do something like > x = S[0..$, 1]; //get column > S[0..$, 2] = A[0..$, 2]; //get and set column > auto B = A[0..10, 0..10]; //get submatrix block of matrix A I don't know whether a

Re: Multidimensional slice

2012-12-19 Thread Rafael
On Wednesday, 19 December 2012 at 16:50:05 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 16:19:28 UTC, Rafael wrote: Yes, it is good solution, thank you! But anyway it means not so nice and laconic syntax.. P.S. yes, I am killjoy :) Awesome, glad i could help even with my limited kno

Re: Multidimensional slice

2012-12-19 Thread Nekroze
On Wednesday, 19 December 2012 at 16:19:28 UTC, Rafael wrote: Yes, it is good solution, thank you! But anyway it means not so nice and laconic syntax.. P.S. yes, I am killjoy :) Awesome, glad i could help even with my limited knowledge, good luck, don't understand the PS.

Re: Multidimensional slice

2012-12-19 Thread Rafael
On Wednesday, 19 December 2012 at 15:19:01 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 14:08:25 UTC, Rafael wrote: On Wednesday, 19 December 2012 at 13:28:24 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 12:27:32 UTC, Rafael wrote: 1) It is possible to implement multiindex acc

Re: Multidimensional slice

2012-12-19 Thread Nekroze
On Wednesday, 19 December 2012 at 14:08:25 UTC, Rafael wrote: On Wednesday, 19 December 2012 at 13:28:24 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 12:27:32 UTC, Rafael wrote: 1) It is possible to implement multiindex access using opIndex* methods, moreover this is the simplest way t

Re: Multidimensional slice

2012-12-19 Thread Rafael
On Wednesday, 19 December 2012 at 13:28:24 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 12:27:32 UTC, Rafael wrote: 1) It is possible to implement multiindex access using opIndex* methods, moreover this is the simplest way to multiindex access realization. So, we have [i, j, k] notatio

Re: Multidimensional slice

2012-12-19 Thread Nekroze
On Wednesday, 19 December 2012 at 13:34:52 UTC, John Chapman wrote: opIndex/opIndexAssign take multiple indices. http://dlang.org/operatoroverloading.html#Array Yes however i believe the OP also wants to provide multiple slices as well as multiple indices. Atleast as far as i can tell.

Re: Multidimensional slice

2012-12-19 Thread Rafael
On Wednesday, 19 December 2012 at 13:34:52 UTC, John Chapman wrote: opIndex/opIndexAssign take multiple indices. http://dlang.org/operatoroverloading.html#Array Yes, but slices - not, and my initial question was about it.

Re: Multidimensional slice

2012-12-19 Thread Nekroze
On Wednesday, 19 December 2012 at 12:27:32 UTC, Rafael wrote: 1) It is possible to implement multiindex access using opIndex* methods, moreover this is the simplest way to multiindex access realization. So, we have [i, j, k] notation. Next step after it - slices implementation and it looks logi

Re: Multidimensional slice

2012-12-19 Thread Rafael
On Wednesday, 19 December 2012 at 11:59:24 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 10:33:38 UTC, Rafael wrote: On Wednesday, 19 December 2012 at 10:25:23 UTC, Rafael wrote: On Wednesday, 19 December 2012 at 10:17:28 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 09:58:37 U

Re: Multidimensional slice

2012-12-19 Thread Nekroze
On Wednesday, 19 December 2012 at 10:33:38 UTC, Rafael wrote: On Wednesday, 19 December 2012 at 10:25:23 UTC, Rafael wrote: On Wednesday, 19 December 2012 at 10:17:28 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 09:58:37 UTC, Rafael wrote: //Then I want to do something like x = S[0..$

Re: Multidimensional slice

2012-12-19 Thread Rafael
On Wednesday, 19 December 2012 at 10:25:23 UTC, Rafael wrote: On Wednesday, 19 December 2012 at 10:17:28 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 09:58:37 UTC, Rafael wrote: //Then I want to do something like x = S[0..$, 1]; //get column S[0..$, 2] = A[0..$, 2]; //get and set colum

Re: Multidimensional slice

2012-12-19 Thread Rafael
On Wednesday, 19 December 2012 at 10:17:28 UTC, Nekroze wrote: On Wednesday, 19 December 2012 at 09:58:37 UTC, Rafael wrote: //Then I want to do something like x = S[0..$, 1]; //get column S[0..$, 2] = A[0..$, 2]; //get and set column auto B = A[0..10, 0..10]; //get submatrix block of matrix A

Re: Multidimensional slice

2012-12-19 Thread Nekroze
On Wednesday, 19 December 2012 at 09:58:37 UTC, Rafael wrote: //Then I want to do something like x = S[0..$, 1]; //get column S[0..$, 2] = A[0..$, 2]; //get and set column auto B = A[0..10, 0..10]; //get submatrix block of matrix A Warning the following is my total noob opinion. Instead of usi

Multidimensional slice

2012-12-19 Thread Rafael
Hi, all! In advance, excuse me for my terrible english. I try to learn the D language. One of the areas of my work is numerical calculations, and there are lot of linear algebra objects and operations. For beginning I started with implementation of matrix calculations. Note, that I am doing th