From: Liu, Zhanwu (LiuxZx_at_anes.upmc.edu)
Date: Mon Mar 25 2002 - 11:09:49 CST

Dear Christian,

I think for the script, the simpler the better. The reason for my
complicated script is I am also a beginner in Tcl language. If it
works, definitely you are right. (And I believe the simpler, the
faster).

I have tried the slower method, one single frame of 12000 atoms cost
about 10 minites. While using the faster method, several seconds.

The line:
set vecz [expr -int($atomz/$maxz)*$z]
Both of us are wrong, it should be
set vecz [expr -int([expr [expr $atomz-$maxz]/$z]) (if $atomz > 0)
What we had written could be right in certain distance(within 1.5*
each dimension), but not reasonable. (While the reasonable one is
not easy to implement, you must consider each possible value, > 0 or < 0).

Here round and int are different, I think int is correct
if we use set vecz [expr -int($atomz/$maxz)*$z] within the 1.5* dimension
box, while round will lead to error.

Thanks

Zhanwu

-----------------------------------
Zhanwu Liu, Ph.D.
Department of Anesthesiology
University of Pittsburgh

-----Original Message-----
From: christian.simon_at_ppce.jussieu.fr
To: vmd-l_at_ks.uiuc.edu
Sent: 03/25/2002 09:06
Subject: Re: Help on script

Dear VMD-list,

I am a beginner with Tcl language, and Zhanwu's script
seems very complicated to me.
There are many point I would like to maker clearer.
Since I wrote a script to achieve the "almost" same goal,
I am now thinking that maybe my method is wrong or inefficient.

> # This procedure move more quickly because is do not operate individua
> atoms.

How many atoms do you have in your box to make this a critical point ?

> # Used as the first step
> proc rapidwrap { x y z } {
> set minx [expr [expr 0 - $x ]/2]
> set maxx [expr $x/2]
> set miny [expr [expr 0 - $y ]/2]
> set maxy [expr $y/2]
> set minz [expr [expr 0 - $z ]/2]
> set maxz [expr $z/2]

Why do you use such nested expressions ?
(you also write in the "slow" wrap proc:
> set vecz [expr $z * [expr 0- [expr int([expr $atomz /
> $maxz])]]]

I would have used :
set minx [expr -$x/2]

and

set vecz [expr -int($atomz/$maxz)*$z]

This seems to work. Is the reason that it is slower ? Or is there some
structure/type problem I do not see ?
(furtermore, I would have use "round" and not "int". Am I wrong ?)

The permutation method seems very complicated to me.
Maybe could you comment it a little ? (what it does is understandable;
my question is rather explain why you proceed that way ?).

-- 
Christian SIMON
The Center for Molecular Modeling  (CMM, Rm. 141A)
University of Pennsylvania,        Tel: (215)-898-1583
Department of Chemistry, Box 127   Fax: (215)-573-6233
231 S. 34th St.
Philadelphia, PA 19104-6323 USA