Re: [Jprogramming] Rank, transpose

2022-01-25 Thread Raul Miller
On Tue, Jan 25, 2022 at 12:13 AM Elijah Stone wrote: > Case in point: I made a quadratic bezier curve renderer recently, > representing the curve data using a three-dimensional array. So I > had to choose how to order the axes. I got it wrong the first > time, and had to restructure some code

[Jprogramming] prime testing on large numbers

2022-01-25 Thread Raul Miller
http://www.rosettacode.org/wiki/Repunit_primes Conceptually, this task might be tackled using an expression like ":@I. 1 p:(2+i.15) #."0 1/|.+./\.=i.1000 However, some of the numbers being tested for primality here are rather large. Even the base 2 numbers reach 300 digits, and the base 16 nu

Re: [Jprogramming] Rank, transpose

2022-01-25 Thread Henry Rich
An example of your 'trivial' case is converting u/@:|: on a table to u/"1 .  Yes, that would be possible. Worthwhile?  You'd need to demonstrate the demand. Your Bezier example is apt.  If you had the primitive you wanted, it would have made it easy to write code that did more transposes than

Re: [Jprogramming] How well does OpenGL work with J903?

2022-01-25 Thread bill lam
I fixed the qtdemo addons. Shader should work on macos now. Please update and test again. > On 24 Jan 2022, at 12:02 PM, bill lam wrote: > > Thank you for this report. I also encountered the same issue on apple m1. > Norman Drinkwater reported that it worked in vm (a rotating cube) but not on

Re: [Jprogramming] How well does OpenGL work with J903?

2022-01-25 Thread Raul Miller
It now works for me. Thanks, -- Raul On Tue, Jan 25, 2022 at 10:09 AM bill lam wrote: > > I fixed the qtdemo addons. Shader should work on macos now. Please update and > test again. > > > > On 24 Jan 2022, at 12:02 PM, bill lam wrote: > > > > Thank you for this report. I also encountered the

[Jprogramming] ArrayFire addon

2022-01-25 Thread Eric Iverson
~addons/math/arrayfire is a new addon for J903 and later. The addon allows high performance computing of matrix product and many other mathematical array operations. Multiple cpu cores and hardware such as Nvidia gpus are used as appropriate. Browse https://arrayfire.org for more info. The addon

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Raul Miller
load'pacman' 'install' jpkg 'math/arrayfire' load '~addons/math/arrayfire/arrayfire.ijs' init_jaf_ 'cpu' |need to set lib: assert What step am I missing here? man_jaf_ 'intro' had said: cpu- always available and uses cpu memory and cores So perhaps this is unintended behavior

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Michail L. Liarmakopoulos
Hello, Eric, This is great news actually. I hope this project goes forward. That said, I've encountered an error when trying to run `init_jaf_'cpu'`, after having installed with pacman the library: ``` load'~addons/math/arrayfire/arrayfire.ijs' man_jaf_'intro' *** intro J-ArrayFire cd bindin

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Eric Iverson
I think both problems reported so far indicate that ArrayFire is not installed or is not installed in the 'normal place'. The failure report should be made more clear. I will be able to work on this later today. On Tue, Jan 25, 2022 at 11:25 AM Michail L. Liarmakopoulos < [email protected]>

Re: [Jprogramming] How well does OpenGL work with J903?

2022-01-25 Thread Stan Blank
Thanks to Bob, Raul, Bill, Elijah for the help in getting me started with OpenGL and J. I'm a complete beginner (albeit a retired math/physics teacher) and I have my work cut out for me. The language is very interesting to me and will hopefully help delay the onset of senility as I try to lea

Re: [Jprogramming] erf?

2022-01-25 Thread Ric Sherlock
Raul, Not sure if your request was prompted by your thinking that H. was no longer available in J9, but in case it's useful erf as defined in stats/distribs/normal works on non integers. erf 0.5 1 1.5 0.5205 0.842701 0.966105 NB. erf v error function NB. ref Abramovitz and Stegum 7.1.21 (right) e

[Jprogramming] Multidimensional transpose

2022-01-25 Thread Pawel Jakubas
Dear J enthusiasts, I am wondering what is an elegant way to realize transpose for arrays of any dimension. I imagine the transpose would take permutation as x and an array as y: So for tensor we would have a permutation of (0,1,2) so 6 possibilities of the transpose. ]t=:i. 3 2 2 0 1 2 3

Re: [Jprogramming] Multidimensional transpose

2022-01-25 Thread Henry Rich
transpose =: |: does what you describe. Henry Rich On 1/25/2022 2:46 PM, Pawel Jakubas wrote: Dear J enthusiasts, I am wondering what is an elegant way to realize transpose for arrays of any dimension. I imagine the transpose would take permutation as x and an array as y: So for tensor we wou

Re: [Jprogramming] How well does OpenGL work with J903?

2022-01-25 Thread Raul Miller
I do not have much experience with GLUT. I was never able to find documentation on it which I felt I adequately understood and which was relevant to the kinds of things I have wanted to do. But, also, there's a lot of problems that can lead to blank screens, so one of the first things I try to do

Re: [Jprogramming] erf?

2022-01-25 Thread Raul Miller
Yep, I was just confused there. Thanks, -- Raul On Tue, Jan 25, 2022 at 1:57 PM Ric Sherlock wrote: > > Raul, > Not sure if your request was prompted by your thinking that H. was no > longer available in J9, but in case it's useful erf as defined in > stats/distribs/normal works on non integer

Re: [Jprogramming] Multidimensional transpose

2022-01-25 Thread Elijah Stone
|: is transpose, as Henry says, but you may also find this interesting: http://www.jsoftware.com/pipermail/general/1999-September/002303.html On Tue, 25 Jan 2022, Pawel Jakubas wrote: Dear J enthusiasts, I am wondering what is an elegant way to realize transpose for arrays of any dimension. I

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread 'Pascal Jasmin' via Programming
looks good.  A small bug: if you define reduce_z_ =: ]: NB. adverb prior to loading arrayfire.ijs load will fail. The reason is the families.ijs file creates a bunch of forks with their middle verbs defined after the forks are created. An easy fix is to define all of the explicit verbs used

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Eric Iverson
Pascal, Thanks for the feedback. Coming from you, it means a lot to me. There are some rough edges for windows and mac (I work mostly in linux) that I will fix tomorrow morning. On Tue, Jan 25, 2022 at 3:52 PM 'Pascal Jasmin' via Programming < [email protected]> wrote: > looks good. A

[Jprogramming] float vs exact

2022-01-25 Thread Raul Miller
I was shown this, today: V=: 2%/\61 11 2 Vx=:2%/\61 11 2x mk=: {{10j5":({.,~ 111-(1130-3000%{:)%{.)^:100 y}} mk V 100.0 100.0 mk Vx 6.0 6.0 -- Raul -- For information about J forums see http://www.js

Re: [Jprogramming] Rank, transpose

2022-01-25 Thread Igor Zhuravlov
On Tue, 25 Jan 2022, 14:42:07 +10 Elijah Stone wrote: > That is incorrect. You are right and I was wrong. Sorry for noise. -- Regards Igor -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] float vs exact

2022-01-25 Thread Elijah Stone
Cool. Seems like floating-point error. You can watch it going off the rails, an order of magnitude or so at a time, and then stabilizing; quite neat IMO. Perhaps someone who knows more about numeric analysis can tell what's up: f=. ({.,~ 111-(1130-3000%{:)%{.) ,. 0{"1 V -&(f^:(<20)) V

Re: [Jprogramming] prime testing on large numbers

2022-01-25 Thread Elijah Stone
Per my 'J is faster than J' post from a bit ago, pure-j implementation of bigint ops can be faster than the builtins. To get parallelism, I suggest working on many numbers at once, but only one limb of a given number at a time. Miller-rabin is a popular, well-regarded primality test. -E On

Re: [Jprogramming] prime testing on large numbers

2022-01-25 Thread Marshall Lochbaum
All of these solutions except F# and Raku end up calling GMP for this (which uses Miller-Rabin; so does J). I think F# uses the following .NET library, while Raku appears to eventually call an npm package jsbi-is-prime? https://github.com/Open-NET-Libraries/Open.Numeric.Primes/blob/master/source/M

Re: [Jprogramming] prime testing on large numbers

2022-01-25 Thread Henry Rich
Please, somebody, step up to replacing J's antiquated extended-arithmetic support with GMP. Henry Rich On 1/25/2022 8:21 PM, Marshall Lochbaum wrote: All of these solutions except F# and Raku end up calling GMP for this (which uses Miller-Rabin; so does J). I think F# uses the following .NET l

Re: [Jprogramming] prime testing on large numbers

2022-01-25 Thread Julian Fondren
I'll get it done. ‐‐‐ Original Message ‐‐‐ On Tuesday, January 25th, 2022 at 7:23 PM, Henry Rich wrote: > Please, somebody, step up to replacing J's antiquated > > extended-arithmetic support with GMP. > > Henry Rich > > On 1/25/2022 8:21 PM, Marshall Lochbaum wrote: > > > All of these

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread 'Pascal Jasmin' via Programming
Probably not installed.  https://arrayfire.org has links installing on windows will set AF_PATH environment variable.  J accesses that. This seems better than my earlier system of hard coding/editing variables for the default path, but doesn't allow switching versions as easily. I think an err

Re: [Jprogramming] How well does OpenGL work with J903?

2022-01-25 Thread Stan Blank
Thank you, Raul! The issue I'm having with the freeglut addon is that the addon seems to load properly (no errors), but I am unable to create a window of any kind. However, I'm aware that my lack of J knowledge is most likely the culprit and I have some homework to do first. I purchased Henr

Re: [Jprogramming] How well does OpenGL work with J903?

2022-01-25 Thread 'robert therriault' via Programming
Hi Stan, If you have looked at the shader demo in Jqt Help | Studio | Qt demos... there is a source button that will show the source that is generating the window with the rotating cube. I have often take such an existing source and then made changes to it to get a sense of how an application

Re: [Jprogramming] prime testing on large numbers

2022-01-25 Thread Devon McCormick
I really like what I can do with extended arithmetic in J, continued fractions and such. I'd like to help, if I can. I attempted to extend a Fibonacci verb using the "power of phi" method ( https://code.jsoftware.com/wiki/Essays/Fibonacci_Sequence#Power_of_phi), which is so simple compared to man

Re: [Jprogramming] prime testing on large numbers

2022-01-25 Thread Elijah Stone
On Tue, 25 Jan 2022, Marshall Lochbaum wrote: Raku appears to eventually call an npm package jsbi-is-prime? Raku uses tommath. -- For information about J forums see http://www.jsoftware.com/forums.htm