renamed the function oprod (outer product) to cprod (cross product)
authorhess <hess>
Mon, 6 Aug 2007 13:40:59 +0000 (13:40 +0000)
committerhess <hess>
Mon, 6 Aug 2007 13:40:59 +0000 (13:40 +0000)
16 files changed:
include/vec.h
src/contrib/anaf.c
src/gmxlib/bondfree.c
src/gmxlib/calch.c
src/gmxlib/do_fit.c
src/gmxlib/random.c
src/mdlib/vcm.c
src/mdlib/vsite.c
src/tools/autocorr.c
src/tools/gmx_bundle.c
src/tools/gmx_order.c
src/tools/gmx_rotacf.c
src/tools/gmx_sdf.c
src/tools/gmx_sgangle.c
src/tools/gmx_sorient.c
src/tools/gmx_traj.c

index 1be3d18d1a4fc89be76a98874fb0de2f1375a643..ac638f240f7e438c2f44195ad09f73b6237def3d 100644 (file)
@@ -84,7 +84,7 @@
   real norm2(rvec a)                               = | a |^2 ( = x*y*z )
   real norm(rvec a)                                = | a |
   double dnorm(dvec a)                             = | a |
-  void oprod(rvec a,rvec b,rvec c)                 c = a x b (outer product)
+  void cprod(rvec a,rvec b,rvec c)                 c = a x b (cross product)
   void dprod(rvec a,rvec b,rvec c)                 c = a * b (direct product)
   real cos_angle(rvec a,rvec b)
   real cos_angle_no_table(rvec a,rvec b)
@@ -509,7 +509,7 @@ static inline real cos_angle_no_table(const rvec a,const rvec b)
   return cos;
 }
 
-static inline void oprod(const rvec a,const rvec b,rvec c)
+static inline void cprod(const rvec a,const rvec b,rvec c)
 {
   c[XX]=a[YY]*b[ZZ]-a[ZZ]*b[YY];
   c[YY]=a[ZZ]*b[XX]-a[XX]*b[ZZ];
index 2a1a7b7197776bade40201682e4bb9a2c53cc9d7..7ac22c8e3d63f57d923f5c113a5b98f26556d851 100644 (file)
@@ -102,7 +102,7 @@ static void list_trn(char *fn)
          }
          for(i=5*j; (i<5*j+5); i++) {
            rvec_dec(x[i],xcm[j]);
-           oprod(x[i],f[i],dx);
+           cprod(x[i],f[i],dx);
            rvec_inc(torque[j],dx);
            rvec_inc(x[i],xcm[j]);
          }
index a420ed5d457617d1bebaa47f3effe2d6a67f7ac4..bf4fe1b16e759cca674e1cb8b9cf591cd26a10aa 100644 (file)
@@ -433,7 +433,7 @@ real water_pol(int nbonds,
       rvec_sub(x[aH2],x[aH1],dHH);
       rvec_sub(x[aD], x[aO], dOD);
       rvec_sub(x[aS], x[aD], dDS);
-      oprod(dOH1,dOH2,nW);
+      cprod(dOH1,dOH2,nW);
       
       /* Compute inverse length of normal vector 
        * (this one could be precomputed, but I'm too lazy now)
@@ -861,8 +861,8 @@ real dih_angle(const rvec xi,const rvec xj,const rvec xk,const rvec xl,
   *t2 = pbc_rvec_sub(pbc,xk,xj,r_kj);                  /*  3           */
   *t3 = pbc_rvec_sub(pbc,xk,xl,r_kl);                  /*  3           */
 
-  oprod(r_ij,r_kj,m);                  /*  9           */
-  oprod(r_kj,r_kl,n);                  /*  9           */
+  cprod(r_ij,r_kj,m);                  /*  9           */
+  cprod(r_kj,r_kl,n);                  /*  9           */
   *cos_phi=cos_angle(m,n);             /* 41           */
   phi=acos(*cos_phi);                  /* 10           */
   ipr=iprod(r_ij,n);                   /*  5           */
index e8a07d88e6ef53bab8925b3c8fac8476d233d6e9..91115d61dca0a380765582e1b0aae0e56a2ca553 100644 (file)
@@ -215,7 +215,7 @@ void calc_h_pos(int nht, rvec xa[], rvec xh[])
 
     rvec_sub(xAI,xAJ,rCC1);
     rvec_sub(xAI,xAK,rCC2);
-    oprod(rCC1,rCC2,rNN);
+    cprod(rCC1,rCC2,rNN);
     nn=norm(rNN);
     
     for(d=0; (d<DIM); d++) {
index 5b6fa809033d3a766f7106a4e06e75e0f5b04b8e..13a6d8205a6cbbd3ffc99d48474dfde87a482a2f 100644 (file)
@@ -182,8 +182,8 @@ void calc_fit_R(int ndim,int natoms,real *w_rls,rvec *xp,rvec *x,matrix R)
      * This insures that the conformation is not mirrored and
      * prevents problems with completely flat reference structures.
      */  
-    oprod(vh[0],vh[1],vh[2]);
-    oprod(vk[0],vk[1],vk[2]);
+    cprod(vh[0],vh[1],vh[2]);
+    cprod(vk[0],vk[1],vk[2]);
   } else if (ndim == 2) {
     /* Calculate the last eigenvector from the first one */
     vh[1][XX] = -vh[0][YY];
index 2639dd55df15eeadb009aeb542c1baec833df897..482ecf22da1069c0c34916d73b22101074f083d2 100644 (file)
@@ -144,14 +144,14 @@ real calc_cm(FILE *log,int natoms,real mass[],rvec x[],rvec v[],
   for(i=0; (i<natoms); i++) {
     m0=mass[i];
     tm+=m0;
-    oprod(x[i],v[i],a0);
+    cprod(x[i],v[i],a0);
     for(m=0; (m<DIM); m++) {
       xcm[m]+=m0*x[i][m]; /* c.o.m. position */
       vcm[m]+=m0*v[i][m]; /* c.o.m. velocity */
       acm[m]+=m0*a0[m];   /* rotational velocity around c.o.m. */
     }
   }
-  oprod(xcm,vcm,a0);
+  cprod(xcm,vcm,a0);
   for(m=0; (m<DIM); m++) {
     xcm[m]/=tm;
     vcm[m]/=tm;
index 8371008c380e15a05a4dc48e397d4e117d38b355..aff6eda0f3d9da0d28789c785a1767fb23c0f8a1 100644 (file)
@@ -150,7 +150,7 @@ void calc_vcm_grp(FILE *fp,int start,int homenr,t_mdatoms *md,
 
       if (vcm->mode == ecmANGULAR) {
        /* Calculate angular momentum */
-       oprod(x[i],v[i],j0);
+       cprod(x[i],v[i],j0);
        
        for(m=0; (m<DIM); m++) {
          vcm->group_j[g][m] += m0*j0[m];
@@ -195,7 +195,7 @@ void do_stopcm_grp(FILE *fp,int start,int homenr,unsigned short *group_id,
          g = group_id[i];
        /* Compute the correction to the velocity for each atom */
        rvec_sub(x[i],vcm->group_x[g],dx);
-       oprod(vcm->group_w[g],dx,dv);
+       cprod(vcm->group_w[g],dx,dv);
        rvec_dec(v[i],dv);
       }
     }
@@ -262,7 +262,7 @@ void check_cm_grp(FILE *fp,t_vcm *vcm,real Temp_Max)
          /* Subtract the center of mass contribution to the 
           * angular momentum 
           */
-         oprod(vcm->group_x[g],vcm->group_v[g],jcm);
+         cprod(vcm->group_x[g],vcm->group_v[g],jcm);
          for(m=0; (m<DIM); m++)
            vcm->group_j[g][m] -= tm*jcm[m];
          
index 5b1a28e21f475a946bc801f2a3f3c663a9351d79..cfcd13004455de3702b7e461280c154aed5283c5 100644 (file)
@@ -351,7 +351,7 @@ static void constr_vsite3OUT(rvec xi,rvec xj,rvec xk,rvec x,
   
   pbc_rvec_sub(pbc,xj,xi,xij);
   pbc_rvec_sub(pbc,xk,xi,xik);
-  oprod(xij,xik,temp);
+  cprod(xij,xik,temp);
   /* 15 Flops */
   
   x[XX] = xi[XX] + a*xij[XX] + b*xik[XX] + c*temp[XX];
index c62665a2756384594274ccbfbf65397dc8b5cbbd..605b7b288d27ee4dfe76be0c8f6afdcd1891a671 100644 (file)
@@ -184,7 +184,7 @@ static void do_ac_core(int nframes,int nout,
          xj[m] = c1[j3+m];
          xk[m] = c1[jk3+m];
        }
-       oprod(xj,xk,rr);
+       cprod(xj,xk,rr);
        
        corr[k] += iprod(rr,rr);
       }
index 528baa1487b8fb86d42e80069a95629c6b1b09f0..45bd078246935f9c3183fe096a6d8c27fa0258e4 100644 (file)
@@ -332,7 +332,7 @@ int gmx_bundle(int argc,char *argv[])
        unitv_no_table(va,va);
        unitv_no_table(vb,vb);
        fprintf(fkink," %6g",RAD2DEG*acos(iprod(va,vb)));
-       oprod(va,vb,vc);
+       cprod(va,vb,vc);
        copy_rvec(bun.mid[i],vr);
        vr[ZZ] = 0;
        unitv_no_table(vr,vr);
index d345bdee70ed6fbe8b0b384ec8481960c8faaaf4..45d6483992cbef110a3dfff1339e5264e5a4e076 100644 (file)
@@ -387,11 +387,11 @@ void calc_order(char *fn, atom_id *index, atom_id *a, rvec **order,
           we can use the outer product of Cn-1->Cn and Cn+1->Cn, I hope */
        rvec_sub(x1[a[index[i+1]+j]], x1[a[index[i]+j]], tmp1);
        rvec_sub(x1[a[index[i-1]+j]], x1[a[index[i]+j]], tmp2);
-       oprod(tmp1, tmp2, Sx);
+       cprod(tmp1, tmp2, Sx);
        svmul(1/norm(Sx), Sx, Sx);
        
        /* now we can get Sy from the outer product of Sx and Sz   */
-       oprod(Sz, Sx, Sy);
+       cprod(Sz, Sx, Sy);
        svmul(1/norm(Sy), Sy, Sy);
 
        /* the square of cosine of the angle between dist and the axis.
index e987fb5dde1be0a4586512711369e25436ded462..3349b6fe507d00d3410079152fe038068f0183da 100644 (file)
@@ -162,7 +162,7 @@ int gmx_rotacf(int argc,char *argv[])
        ak=index[3*i+2];
        rvec_sub(x_s[ai],x_s[aj],xij);
        rvec_sub(x_s[aj],x_s[ak],xjk);
-       oprod(xij,xjk,n);
+       cprod(xij,xjk,n);
        for(m=0; (m<DIM); m++)
          c1[i][DIM*teller+m]=n[m];
       }
index fd1c8db0e204c845438f37c076887a497a606743..8fdd943132b3c4730f68d017660a7fef1be2d59d 100644 (file)
@@ -459,11 +459,11 @@ structure if needed */
         
         /* i' = unitv(k' x (r(atom2) - r(atom1))) */
         pbc_dx(&pbc,x[index[NDX_REF3][i]],x[index[NDX_REF2][i]],i1_mol);
-        oprod(i1_mol,rot[2],i2_mol);
+        cprod(i1_mol,rot[2],i2_mol);
         unitv(i2_mol,rot[0]);
       
         /* j' = k' x i' */
-        oprod(rot[2],rot[0],rot[1]);
+        cprod(rot[2],rot[0],rot[1]);
 
 
         /* set the point of reference */
index b16c412500990434fbae70805d9b62b62070090f..28c17b0da7610df349f2130dd430ae4f7c6a2e16 100644 (file)
@@ -89,7 +89,7 @@ static void calculate_normal(atom_id index[],rvec x[],rvec result,rvec center)
   rvec_sub(x[index[1]],x[index[0]],c1);    /* find two vectors */
   rvec_sub(x[index[2]],x[index[0]],c2);
   
-  oprod(c1,c2,result);                    /* take crossproduct between these */
+  cprod(c1,c2,result);                    /* take crossproduct between these */
 }
 
 /* calculate the angle and distance between the two groups */
index bcb4ca6cb8b2150680e95f02ad0e278036b49a36..69187ffe48a45e0d7b3ee62d22ee95708ee060d2 100644 (file)
@@ -252,7 +252,7 @@ int gmx_sorient(int argc,char *argv[])
            svmul(1/r,dx,dx);
            unitv(dxh1,dxh1);
            inp = iprod(dx,dxh1);
-           oprod(dxh1,dxh2,outer);
+           cprod(dxh1,dxh2,outer);
            unitv(outer,outer);
            outp = iprod(dx,outer);
          } else {
index a88a2ebd594fb01fc5779d64e00aebd272102e45..bb1b18fd655f602ad9ecae27e5965f679afed585 100644 (file)
@@ -188,14 +188,14 @@ static real ekrot(rvec x[],rvec v[],real mass[],int isize,atom_id index[])
     j = index[i];
     m0=mass[j];
     tm+=m0;
-    oprod(x[j],v[j],a0);
+    cprod(x[j],v[j],a0);
     for(m=0; (m<DIM); m++) {
       xcm[m]+=m0*x[j][m]; /* c.o.m. position */
       vcm[m]+=m0*v[j][m]; /* c.o.m. velocity */
       acm[m]+=m0*a0[m];   /* rotational velocity around c.o.m. */
     }
   }
-  oprod(xcm,vcm,a0);
+  cprod(xcm,vcm,a0);
   for(m=0; (m<DIM); m++) {
     xcm[m]/=tm;
     vcm[m]/=tm;