Thread overview | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 17, 2014 Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Multidimensional arrays indexing and slicing syntax is finally added [1] (thanks to Kenji Hara). So it was a good cause to update my multidimensional arrays library implementation and add support for the new syntax. So here we are: [2]. Also should we add it to the standard library? [1] https://github.com/D-Programming-Language/dmd/pull/443 [2] http://denis-sh.bitbucket.org/unstandard/unstd.multidimarray.html -- Денис В. Шеломовский Denis V. Shelomovskij |
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Shelomovskij | +100
On Monday, 17 March 2014 at 17:39:41 UTC, Denis Shelomovskij wrote:
> Multidimensional arrays indexing and slicing syntax is finally added [1] (thanks to Kenji Hara). So it was a good cause to update my multidimensional arrays library implementation and add support for the new syntax. So here we are: [2].
>
> Also should we add it to the standard library?
>
> [1] https://github.com/D-Programming-Language/dmd/pull/443
> [2] http://denis-sh.bitbucket.org/unstandard/unstd.multidimarray.html
|
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Shelomovskij | On Mon, Mar 17, 2014 at 09:39:40PM +0400, Denis Shelomovskij wrote: > Multidimensional arrays indexing and slicing syntax is finally added [1] (thanks to Kenji Hara). So it was a good cause to update my multidimensional arrays library implementation and add support for the new syntax. So here we are: [2]. > > Also should we add it to the standard library? > > [1] https://github.com/D-Programming-Language/dmd/pull/443 > [2] http://denis-sh.bitbucket.org/unstandard/unstd.multidimarray.html [...] Let's do it! Put it up for review! I almost gave up hope that this day would come, but this morning I looked at the dmd commit log and saw Kenji's pull was merged. You couldn't believe how happy I was. Finally, sane multidimensional array support!! T -- Almost all proofs have bugs, but almost all theorems are true. -- Paul Pedersen |
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Shelomovskij |
Good news and kudos to Kenji.
And yes, I think that a matrix / linear algebra library, as well as NumPy-style ND-Arrays are great candidates for future Phobos modules.
We've done a good bit of work with matrices at my workplace (EMSI), so I bet someone here could find time to contribute a bit. As a start, we've got some basic BLAS and MKL bindings that we really should clean up and get into Deimos.
On Monday, 17 March 2014 at 17:39:41 UTC, Denis Shelomovskij wrote:
> Multidimensional arrays indexing and slicing syntax is finally added [1] (thanks to Kenji Hara). So it was a good cause to update my multidimensional arrays library implementation and add support for the new syntax. So here we are: [2].
>
> Also should we add it to the standard library?
>
> [1] https://github.com/D-Programming-Language/dmd/pull/443
> [2] http://denis-sh.bitbucket.org/unstandard/unstd.multidimarray.html
|
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jared Miller | Jared Miller:
> And yes, I think that a matrix / linear algebra library, as well as NumPy-style ND-Arrays are great candidates for future Phobos modules.
I suggest to not put such library in Phobos before few years of usage in the wild.
Bye,
bearophile
|
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Shelomovskij | I looked to the doku-page and expected to see, how some basic matrix-operations could be performed. Like e.g. (basic syntax) this: Dim a(10,12) a(3,4) = 7 a(i,j) = a(j,i) * 12 Instead I found exotic assignments and calculations. Did I expect the wrong thing? |
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Shelomovskij | 17.03.2014 21:39, Denis Shelomovskij пишет: > Multidimensional arrays indexing and slicing syntax is finally added [1] > (thanks to Kenji Hara). So it was a good cause to update my > multidimensional arrays library implementation and add support for the > new syntax. So here we are: [2]. > > Also should we add it to the standard library? > > [1] https://github.com/D-Programming-Language/dmd/pull/443 > [2] http://denis-sh.bitbucket.org/unstandard/unstd.multidimarray.html > An important note: My proposal is just a sliceable multidimensional array implementation, a try to provide the same effort we have for simple arrays for multidimensional ones. It isn't aimed to be a dedicated matrix / linear algebra module. -- Денис В. Шеломовский Denis V. Shelomovskij |
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis Shelomovskij | On Tue, Mar 18, 2014 at 01:55:31AM +0400, Denis Shelomovskij wrote: > 17.03.2014 21:39, Denis Shelomovskij пишет: > >Multidimensional arrays indexing and slicing syntax is finally added [1] (thanks to Kenji Hara). So it was a good cause to update my multidimensional arrays library implementation and add support for the new syntax. So here we are: [2]. > > > >Also should we add it to the standard library? > > > >[1] https://github.com/D-Programming-Language/dmd/pull/443 > >[2] http://denis-sh.bitbucket.org/unstandard/unstd.multidimarray.html > > > > An important note: > My proposal is just a sliceable multidimensional array implementation, > a try to provide the same effort we have for simple arrays for > multidimensional ones. It isn't aimed to be a dedicated matrix / > linear algebra module. [...] It will be a good low-level module that will allow a linear algebra module to be built on. I am against the idea of conflating multidimensional arrays with matrices; the operations and interpretations are not the same, and it leads to poor designs (I've tried it before, and the results were not so good). Better have a general multidimensional array with per-element operations, and then build matrix algebra as a separate module by using multidimensional array as underlying storage implementation. T -- Answer: Because it breaks the logical sequence of discussion. / Question: Why is top posting bad? |
March 17, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | > It will be a good low-level module that will allow a linear algebra
> module to be built on.
Agreed. In fields like graphics and computer vision, large multidimensional arrays aren't always matrices/tensors in the linear algebra sense. And it's always possible to specialize. NumPy got this right.
|
March 20, 2014 Re: Finally full multidimensional arrays support in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Christof Schardt | 18.03.2014 1:35, Christof Schardt пишет: > I looked to the doku-page and expected to see, how some basic > matrix-operations could be performed. > Like e.g. (basic syntax) this: > > Dim a(10,12) > a(3,4) = 7 > a(i,j) = a(j,i) * 12 > > Instead I found exotic assignments and calculations. > Did I expect the wrong thing? Sorry for that. Do you mead there is a lack of simple indexing examples or lack of some matrix functionality? The latter case is if you meant "transpose and multiply by 12" with `a(i,j) = a(j,i) * 12`. -- Денис В. Шеломовский Denis V. Shelomovskij |
Copyright © 1999-2021 by the D Language Foundation