changed reading hint
[gromacs/adressmacs.git] / include / vveclib.h
blob5239d8239f50e61874d59e0b5b30d9d994d1b2b4
1 /*
2 * $Id$
3 *
4 * This source code is part of
5 *
6 * G R O M A C S
7 *
8 * GROningen MAchine for Chemical Simulations
9 *
10 * VERSION 2.0
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * Please refer to:
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
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Green Red Orange Magenta Azure Cyan Skyblue
30 #ifndef _vveclib_h
31 #define _vveclib_h
33 static char *SRCID_vveclib_h = "$Id$";
35 #ifdef HAVE_IDENT
36 #ident "@(#) vveclib.h 1.11 2/2/97"
37 #endif /* HAVE_IDENT */
39 #include "typedefs.h"
41 /*
42 * Interface module for vector library.
43 * This is a set of routines that uses
44 * - libfv on the i860
45 * - veclib on the convex (future)
46 * - some general C-routines
48 * The routines provided here just provide a standard header for
49 * all systems.
50 * All routine-names start with "v_"
51 * All routines take type real which can be single or double
52 * depending on options set and machine.
53 * All routines take an integer N as first parameter which is
54 * the vector length.
57 extern double Flops; /* The number of flops to date */
59 #define FV_SAFE 12 /* Make your arrays FV_SAFE longer allways */
61 extern void v_scopy(int N,real s,real Z[]);
62 /* copy scalar to vector (Z[i] := s) */
64 extern void v_vcopy(int N,real X[],real Z[]);
65 /* copy vector X to vector Z (Z[i] := X[i]) */
67 extern real v_inner(int N,real X[],real Y[]);
68 /* calculate the inner product of X and Y */
70 extern void v_scopy_s(int N,real s,real Z[],int stride);
71 /* copy scalar to each stride's element of Z (Z[i x stride] := s */
73 extern void v_gather(int N,real B[],int IX[],real Z[]);
74 /* gather vector: Z[i] := B[IX[i]] */
76 extern void v_scatter(int N,real B[],int IX[],real Z[]);
77 /* scatter vector: Z[IX[i]] := B[i] */
79 extern void v_gather_us(int N,real B[],unsigned short IX[],real Z[]);
80 /* gather vector: Z[i] := B[IX[i]] */
82 extern void v_scatter_us(int N,real B[],unsigned short IX[],real Z[]);
83 /* scatter vector: Z[IX[i]] := B[i] */
85 extern void v_gather_us_s(int N,real B[],unsigned short IX[],real Z[],
86 int stride);
87 /* gather vector: Z[stride*i] := B[IX[stride*i]] */
89 extern void v_scatter_us_s(int N,real B[],unsigned short IX[],real Z[],
90 int stride);
91 /* scatter vector: Z[IX[stride*i]] := B[stride*i] */
93 extern void v_sub(int N,real X[],real Y[],real Z[]);
94 /* vector subtract: Z[i] := X[i]-Y[i] */
96 extern void v_mul(int N,real X[],real Y[],real Z[]);
97 /* vector multiply: Z[i] := X[i]*Y[i] */
99 extern void v_add(int N,real X[],real Y[],real Z[]);
100 /* vector add: Z[i] := X[i]+Y[i] */
102 /********************* Other routines ****************************/
104 void dprod(tensor T, rvec V, rvec W);
105 /* calculate the direct product: T = V(x)W */
107 void fac_dprod(tensor T, rvec V, rvec W, real fac);
108 /* calculate the direct product and every component fac
109 * times to T: Tij += fac * [V(x)W]ij
112 #endif /* _vveclib_h */