4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Green Red Orange Magenta Azure Cyan Skyblue
33 static char *SRCID_vveclib_h = "$Id$";
40 #ident "@(#) vveclib.h 1.11 2/2/97"
41 #endif /* HAVE_IDENT */
46 * Interface module for vector library.
47 * This is a set of routines that uses
49 * - veclib on the convex (future)
50 * - some general C-routines
52 * The routines provided here just provide a standard header for
54 * All routine-names start with "v_"
55 * All routines take type real which can be single or double
56 * depending on options set and machine.
57 * All routines take an integer N as first parameter which is
61 extern double Flops; /* The number of flops to date */
63 #define FV_SAFE 12 /* Make your arrays FV_SAFE longer allways */
65 extern void v_scopy(int N,real s,real Z[]);
66 /* copy scalar to vector (Z[i] := s) */
68 extern void v_vcopy(int N,real X[],real Z[]);
69 /* copy vector X to vector Z (Z[i] := X[i]) */
71 extern real v_inner(int N,real X[],real Y[]);
72 /* calculate the inner product of X and Y */
74 extern void v_scopy_s(int N,real s,real Z[],int stride);
75 /* copy scalar to each stride's element of Z (Z[i x stride] := s */
77 extern void v_gather(int N,real B[],int IX[],real Z[]);
78 /* gather vector: Z[i] := B[IX[i]] */
80 extern void v_scatter(int N,real B[],int IX[],real Z[]);
81 /* scatter vector: Z[IX[i]] := B[i] */
83 extern void v_gather_us(int N,real B[],unsigned short IX[],real Z[]);
84 /* gather vector: Z[i] := B[IX[i]] */
86 extern void v_scatter_us(int N,real B[],unsigned short IX[],real Z[]);
87 /* scatter vector: Z[IX[i]] := B[i] */
89 extern void v_gather_us_s(int N,real B[],unsigned short IX[],real Z[],
91 /* gather vector: Z[stride*i] := B[IX[stride*i]] */
93 extern void v_scatter_us_s(int N,real B[],unsigned short IX[],real Z[],
95 /* scatter vector: Z[IX[stride*i]] := B[stride*i] */
97 extern void v_sub(int N,real X[],real Y[],real Z[]);
98 /* vector subtract: Z[i] := X[i]-Y[i] */
100 extern void v_mul(int N,real X[],real Y[],real Z[]);
101 /* vector multiply: Z[i] := X[i]*Y[i] */
103 extern void v_add(int N,real X[],real Y[],real Z[]);
104 /* vector add: Z[i] := X[i]+Y[i] */
106 /********************* Other routines ****************************/
108 void dprod(tensor T, rvec V, rvec W);
109 /* calculate the direct product: T = V(x)W */
111 void fac_dprod(tensor T, rvec V, rvec W, real fac);
112 /* calculate the direct product and every component fac
113 * times to T: Tij += fac * [V(x)W]ij
116 #endif /* _vveclib_h */