So, I have this pile of C code that uses rank-2 arrays as double**, then
subsets them with loops like "array[i][j]." I'm so used to the J FFI
working flawlessly on C code (most of which sensibly uses double*), I
forgot that a J-array doesn't work like that, and was kind of shocked
when the code
Bob: there is a primitive for tolerant comparison against 0:
* 1e_45
0
Linda: the ~ was superfluous but immaterial. As for how to test for
complex numbers, that is for the user to decide: do you want a number
whose complex angle is close to 0/pi, or do you want to insist on
exactly 0/pi?
The Catmull-Clark surface subdivision algorithm is a fun little algorithm:
http://rosettacode.org/wiki/Catmull%E2%80%93Clark_subdivision_surface
http://rosettacode.org/wiki/Catmull%E2%80%93Clark_subdivision_surface#J
But there are other approaches to this task, and some of them require
very diffe
arr =: (< 3 4) ; (3; <'HELLO'; << 'HI'); 'WORLD' NB. just random boxes
http://rosettacode.org/wiki/Flatten_a_list#J
http://rosettacode.org/wiki/Tree_traversal#J
Thanks,
--
Raul
On Sun, Nov 30, 2014 at 9:34 AM, Jon Hough wrote:
> What is the best way to flatten a box array of arbitrary d
What is the best way to flatten a box array of arbitrary depth?
e.g. if I have
arr =: (< 3 4) ; (3; <'HELLO'; << 'HI'); 'WORLD' NB. just random boxes
┌─┬┬─┐
│┌───┐│┌─┬┐│WORLD│
││3 4│││3│┌─┬┐││ │
│└───┘││ ││HELLO│┌──┐│││ │
│ ││ ││ ││HI
Henry
isnotreal =. ~:~ +
This is not the definition that Lippu used. It was:
(~:+) A=:(i:2)j./i:2
I also used A ~:+ A
Can they be considered a test for whether the numbers are complex?
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.
What is a ?
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Henry Rich
Sent: Saturday, November 29, 2014 11:23 PM
To: programm...@jsoftware.com
Subject: [Jprogramming] Complex puzzle WAS: Better way to