Turning Java code into fast Clojure code -


Can this Java code be translated into a closer code that is faster or faster?

I am able to get simple tasks like adding two arrays to run at the right speed with low heating, but I could not manage to close the closet which has the right amount When using either Java Interop or Incanator Matrix and while using functional or compulsory style

Am I recalling some kind of sign or is it best to do such things in Java?

  Fixed double [] [] grad2_stencil = {{0, 0, -1,0,0}, {0,0,16,0,0}, {-1,16, -60,16, -1}, {0,0,16,0,0}, {0,0, -1,0,0}}} public static double phase 2 (double [] [] array, int x , Int y) {double temp = 0; Int l = array.length; For (int i = 0; i  

Try the following in closure 1.3 (Master branch):

  (def ^ "[[D" grad2-stencil (in-array (class / forName "[D"] (map double-array [[0 -1 0] [0 0 16 0] [ -16 -60 16 -1] [0 0 0]])) (defn ^: static idx ^ long [^ long x ^ tall] ^ tall el] (- & gt; x (+ i) (- 2) (Mod L) (+ L) (Mod L)) (defn ^: Stable Grade 2 ^ double [^ doubles AR ^ tall x ^ tall y] (Give [L (wave) ARM temporary (loop [i 0 J 0 temporary 0.0] (if (& lt; i5) (let [an idie xi l] b (idx wjl) temporary ( Force (* (AZIT AR AB) (Aggate Grade 2 - Stencil iJ))] (If (& lt; j4) (recurrence i (inc j) temp) (recur (inc i) 0 temp)))))) ) (Deflation ^ (static grad2-field ^ "[[D" [^ "[[D" arr] (let's (result (make-orange double / TEEPE (ultethame arm) ) (Loop [I 0 j 0] (when (& lt; I) 5) (aset result (grad2 arr ij) ij) (if (& lt; j4) (recur i (inc j)) (recur (inc i ) 0)))) Results))  

Comments