Rudolf Sykora
> Verzonden: vrijdag 7 februari 2020 22:37
> Aan: programm...@jsoftware.com
> Onderwerp: Re: [Jprogramming] multiply two multidimensional matrices
>
>
> R.E. Boss writes:
>
> > What I did was translate your
> >
> > C_ijlmnop = sum_k A_ijkl
Certainly. It is the dictionary of j
https://www.jsoftware.com/help/dictionary/contents.htm
On Sat, Feb 8, 2020, 3:58 PM Tarik ÖZKANLI wrote:
> Hello,
> Is there a formal specification or standard for the J language?
>
> Thank you.
>
> Tarık Özkanlı
>
> 8 Şub 2020 Cmt 02:40 tarihinde Marshall
Hello,
Is there a formal specification or standard for the J language?
Thank you.
Tarık Özkanlı
8 Şub 2020 Cmt 02:40 tarihinde Marshall Lochbaum
şunu yazdı:
> If you're enjoying learning J, I would say it's certainly worth it. Many
> of the ideas, like copy or the prefix operator, are incredib
If you're enjoying learning J, I would say it's certainly worth it. Many
of the ideas, like copy or the prefix operator, are incredibly powerful
tools you won't find anywhere else. And learning how these concepts work
in J will help you recognize when to use them in other languages, even
if they ca
R.E. Boss writes:
> What I did was translate your
>
> C_ijlmnop = sum_k A_ijkl * B_mknop
>
> in J-terms. If that's not what you want, then your specs are imprecise.
>
> Perhaps what you want to do (with thanks to Lochbaum), is
>
> (('ijkl i. ijlk')|: A_ijkl ) (+/ . *) ('mknop i. kmnop')|: B_mkno
7 februari 2020 15:43
> Aan: programm...@jsoftware.com
> Onderwerp: Re: [Jprogramming] multiply two multidimensional matrices
>
>
> R.E. Boss writes:
>
> > a =. i. 2 3 4 5
> > b =. i. 2 4 3 5 6
> >$a *"0 _ b
> > 2 3 4 5 2 4 3 5 6
> >
Mike Powell writes:
> if you wish
> the result to also be a tensor, you must choose one contravariant and
> one covariant index. So when Ruda writes A_ijkl*B_mknop, my guess is
> that the two uses of the k index have different tensor types.
In principle and generality yes, but for the purely tec
Ken Iverson dealt with tensor contraction in his APL 79 paper "The Derivative
Operator". He suggested an operator (a J adverb) which today can just be an APL
function (a J verb). This took an array as its left argument and an
even-numbered vector of indices as its right argument. It performed ze
Yes, a way of describing this issue here is that when you use an outer
product to form a matrix product, you want to sum along a diagonal
(and discard non-diagonal elements).
For example:
2{"2+//."3 (i.2 3)*/|.i.3 4
20 23 26 29
56 68 80 92
is equivalent to
(i.2 3)+/ .*i.3 4
20 23 26 29
56
I am troubled by the apparent inequality suggested below.
a =. i. 2 3 4 5
b =. i. 2 4 3 5 6
( (2 |: a) +/ . * ((|:~ 1 -.~ i.@(#@$)) b))-:+/"6 +/"4 a *"0 _ b
0
( (2 |: a) +/ . * ((|:~ 1 -.~ i.@(#@$)) b))(;&$)+/"6 +/"4 a *"0 _ b
┌─┬─┐
│2 3 5 2 3 5 6│2 3 5
I think this is a weak point for J's array programming style. Just like
tacit code works well for small manipulations but gets confusing and
difficult as the number of arguments increases, J primitives like rank,
transpose, and inner product are excellent for a few axes, but don't
work so well when
Dear Marshall and Henry,
Marshall Lochbaum writes:
> Although a matrix product will execute faster, if I want to write tensor
> code that is straightforward, and extends to multiple contracted axes, I
> would transpose the contracted axes to the end and combine them with
> (+/@:*"1).
This is ex
R.E. Boss writes:
> a =. i. 2 3 4 5
> b =. i. 2 4 3 5 6
>$a *"0 _ b
> 2 3 4 5 2 4 3 5 6
>$+/"6 +/"4 a *"0 _ b
> 2 3 5 2 3 5 6
This is an interesting take on the subject.
If I understand, the first part does an outer product, P,
P_ijklmnopq = A_ijkl * B_mnopq .
And I believe
> Aan: programm...@jsoftware.com
> Onderwerp: Re: [Jprogramming] multiply two multidimensional matrices
>
(...)
>
> C_ijlmnop = sum_k A_ijkl * B_mknop
>
> means I have C with rank 7, A with rank 4 and B with rank 5.
> C_ijlmnop is a *number*, the same with A_ijkl and B_mknop (for a
+/ . * is so much faster than (+/@:(*"1 _)) that even if you were given
a notation for selecting an axis, the implementation would do the
transpose so that it could use the faster product.
+/@:*"1 is pretty fast for small arguments but for big ones its cache
characteristics mean you end up li
February 6, 2020 11:00 PM, "Henry Rich" wrote:
> It's not so simple to describe. In fact, you haven't described it.
> Your example seems to have a rank-4 array times a rank-5 array producing
> a rank-7 array. Is this result the sum of rank-7 arrays created by
> multiplying rank-3 times rank
Here is a way to permute the axes of an array that you might find easier
to work with:
A =. i. 2 3 4 5
$ ('ijkl'i.'ljik') |: A
5 3 2 4
The idea is that we start with A, which has axes ijkl, and want to
shuffle them around to get ljik. So we look up each of the letters ljik
in ijkl, which gi
It's simple mathematically, because you've already learned that and
because you are willing to elide discussion of various mechanical
details.
Personally, I had to read your question a couple of times, and then
Henry's response and then your question again to resolve some of the
ambiguities.
The
It's not so simple to describe. In fact, you haven't described it.
Your example seems to have a rank-4 array times a rank-5 array producing
a rank-7 array. Is this result the sum of rank-7 arrays created by
multiplying rank-3 times rank-4? I don't know how to make that jibe
with 'the usual
Henry Rich writes:
> It depends on what the '*' means in the definition of the product.
>> C_ijlmnop = sum_k A_ijkl * B_mknop
I really mean the usual multiplication (of numbers).
> Have a look at
>
> a =. i. 2 3 4 5
> b =. i. 2 4 3 5 6
> $ (2 |: a) +/ . * ((|:~ 1 -.~ i.@(#@$)) b)
> 2 3 5 2 3
It depends on what the '*' means in the definition of the product. Have
a look at
a =. i. 2 3 4 5
b =. i. 2 4 3 5 6
$ (2 |: a) +/ . * ((|:~ 1 -.~ i.@(#@$)) b)
2 3 5 2 3 5 6
Henry Rich
On 2/6/2020 2:46 PM, rsyk...@disroot.org wrote:
Dear list,
having two multidimensional matrices
Dear list,
having two multidimensional matrices A and B,
with some indices, say, A_ijkl and B_mknop,
how can I obtain a matrix C, where
C_ijlmnop = sum_k A_ijkl * B_mknop
ie., C has all indices of A and B but for the index k,
which was summed over.
Thanks for your suggestions.
Best regards
Rud
22 matches
Mail list logo