I am a loss as to the actual location of the points in space. However,
if the points are all on a plane, the positions can be expressed as
complex numbers. I so the following (useful. in power line analysis)
dij=: |@ -/~
dij 0 1 1.5 0j1.5 1j2
0 1 1.5 1.5 2.23607
1 0 0.5 1.80278 2
1.5 0.5 0 2.12132 2.06155
1.5 1.80278 2.12132 0 1.11803
2.23607 2 2.06155 1.11803 0
Does this help?
Don Kelly
the positions are expressed as complex numbers and the
On 2019-10-22 8:38 p.m., 'Jim Russell' via Programming wrote:
Wow!
On Oct 22, 2019, at 4:00 PM, Raul Miller <[email protected]> wrote:
Probably worth noting also that I could have instead said:
D=: (+|:)>0;1.5;2 1.5;2.5 2 1.5 0
This is actually one character shorter than my previous expression...
Thanks,
--
Raul
On Tue, Oct 22, 2019 at 2:29 PM <[email protected]> wrote:
From: Raul Miller <[email protected]>
Date: Tue, 22 Oct 2019 13:29:19 -0400
What do you mean by "more efficient"? (What resource is constrained?)
I listed all 16 elements of the matrix. It being symmetrical with 0s
on the diagonal, only 6 elements should be needed. Rather than "more
efficient", better wording might have been "without redundant
information". I might say "more efficient in use of information".
That said, if it's code golf, you could do something like this:
I didn't know the term "code golf" but it seems appropriate.
If you are working on problems where that's not enough to
work on your dataset, ...
At present I'm interested only in expressing concepts. Computational
cost is not a concern at all.
D=: (+|:)>'';1.5;2 1.5;2.5 2 1.5 0
This relies on the use of two placeholders to help represent the full
extent of the array, J's fill mechanism, and addition...
Thanks. Definitely helpful. I could create the matrix in a
commonplace compiled language without help. Thinking about the
calculation in J is worthwhile.
Thanks again, ... P.
--
https://en.wikibooks.org/wiki/Medical_Machines
Tel: +1 604 670 0140 Bcc: peter at easthope. ca
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm