Rolf, I think you could have a lot of fun  with the "JavaScript" functions
Jmol provides. Jmol never does loops like that. Instead it initializes a
"three-dimensional binary tree" -- we call it a "binary forest" :)  -- and
you specify a point and a radius, then iterate until done. It is far far
faster. The class is java.bspt.Bspf. It could be used outside of Jmol, I
think.

I did some minor tweaks of the FOR command, and I also added what I think
is a nice syntax that loops 2-3 times faster than (i=1; i < n; i++)

for (var i FROM [1 10000] ) {
...increments up
}

for (var i FROM [10 -1]) {
...increments down
}

http://chemapps.stolaf.edu/jmol/zip/jmol-14.3.13_2015.04.05.zip


Jmol.___JmolVersion="14.3.13_2015.04.05"

code: rewriting FOR loop code to enhance performance

new feature: set showScript -1
  -- turns off history (on when commands come from the keyboard)
  -- stops every-second JavaScript interruptions -- Caution!

new feature: for (var i FROM [a, b]) {...}
  -- same as for (var i = a; i <= b; i++) when a < b
  -- same as for (var i = a; i >= b; i--) when a > b
  -- much more efficient

bug fix: for (var i in hashArray) {....}  broken (also in 14.2; not fixed
there)











​
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to