* Re: guile-user Digest, Vol 193, Issue 35
[not found] <mailman.32815.1546043023.1280.guile-user@gnu.org>
@ 2018-12-29 0:40 ` Daniel Llorens
0 siblings, 0 replies; only message in thread
From: Daniel Llorens @ 2018-12-29 0:40 UTC (permalink / raw)
To: Matt Wette; +Cc: guile-user
> From: Matt Wette <matt.wette@gmail.com>
> Subject: Re: Matrix or array operations library
> Date: 29 December 2018 at 00:24:38 CET
> To: guile-user@gnu.org
>
>
> On 12/28/18 12:23 PM, Daniel Llorens wrote:
>>
>> John already wrote a nice explanation of how array strides work. You mean specifically for Guile?
>>
>>
> Yes, for Guile. I understand strides and offsets. I think the functionality is basically there
> with shared-arrays. So I take back that Guile does not have this. I will play later.
>
> For example, interesting check will be if one can make a shared-1D array from the diagonal elements
> of a 2D square array (i.e., ((1 2 3) (4 5 6) (7 8 9)) => (1 5 9).
sure, I think that specific example is even in the manual. Yes, the 3rd example here
https://www.gnu.org/software/guile/manual/html_node/Shared-Arrays.html#index-make_002dshared_002darray
(transpose-array #2((1 2 3) (4 5 6) (7 8 9)) 0 0) also works; I've seen this idiom used in APL (say (0 0)⍉A).
> And the transpose I see as a utility that I guess just calls make-shared-array.
I think transpose-array happens to have a C implementation (although it could certainly be done using make-shared-array).
Daniel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-12-29 0:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.32815.1546043023.1280.guile-user@gnu.org>
2018-12-29 0:40 ` guile-user Digest, Vol 193, Issue 35 Daniel Llorens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).