Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / vveclib.h
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 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  * 
21  * If you want to redistribute modifications, please consider that
22  * scientific software is very special. Version control is crucial -
23  * bugs must be traceable. We will be happy to consider code for
24  * inclusion in the official distribution, but derived work must not
25  * be called official GROMACS. Details are found in the README & COPYING
26  * files - if they are missing, get the official version at www.gromacs.org.
27  * 
28  * To help us fund GROMACS development, we humbly ask that you cite
29  * the papers on the package - you can find them in the top README file.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Giving Russians Opium May Alter Current Situation
35  */
36
37 #ifndef _vveclib_h
38 #define _vveclib_h
39
40 static char *SRCID_vveclib_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) vveclib.h 1.11 2/2/97"
47 #endif /* HAVE_IDENT */
48
49 #include "typedefs.h"
50
51 /* 
52  * Interface module for vector library.
53  * This is a set of routines that uses 
54  * - libfv  on the i860
55  * - veclib on the convex (future)
56  * - some general C-routines
57  *
58  * The routines provided here just provide a standard header for
59  * all systems.
60  * All routine-names start with "v_"
61  * All routines take type real which can be single or double
62  * depending on options set and machine.
63  * All routines take an integer N as first parameter which is
64  * the vector length.
65  */
66
67 extern double Flops;            /* The number of flops to date  */
68
69 #define FV_SAFE 12   /* Make your arrays FV_SAFE longer allways */
70
71 extern void v_scopy(int N,real s,real Z[]);
72 /* copy scalar to vector (Z[i] := s) */
73
74 extern void v_vcopy(int N,real X[],real Z[]);
75 /* copy vector X to vector Z (Z[i] := X[i]) */
76
77 extern real v_inner(int N,real X[],real Y[]);
78 /* calculate the inner product of X and Y */
79
80 extern void v_scopy_s(int N,real s,real Z[],int stride);
81 /* copy scalar to each stride's element of Z (Z[i x stride] := s */
82
83 extern void v_gather(int N,real B[],int IX[],real Z[]);
84 /* gather vector: Z[i] := B[IX[i]] */
85
86 extern void v_scatter(int N,real B[],int IX[],real Z[]);
87 /* scatter vector: Z[IX[i]] := B[i] */
88
89 extern void v_gather_us(int N,real B[],unsigned short IX[],real Z[]);
90 /* gather vector: Z[i] := B[IX[i]] */
91
92 extern void v_scatter_us(int N,real B[],unsigned short IX[],real Z[]);
93 /* scatter vector: Z[IX[i]] := B[i] */
94
95 extern void v_gather_us_s(int N,real B[],unsigned short IX[],real Z[],
96                           int stride);
97 /* gather vector: Z[stride*i] := B[IX[stride*i]] */
98
99 extern void v_scatter_us_s(int N,real B[],unsigned short IX[],real Z[],
100                            int stride);
101 /* scatter vector: Z[IX[stride*i]] := B[stride*i] */
102
103 extern void v_sub(int N,real X[],real Y[],real Z[]);
104 /* vector subtract: Z[i] := X[i]-Y[i] */
105
106 extern void v_mul(int N,real X[],real Y[],real Z[]);
107 /* vector multiply: Z[i] := X[i]*Y[i] */
108
109 extern void v_add(int N,real X[],real Y[],real Z[]);
110 /* vector add: Z[i] := X[i]+Y[i] */
111
112 /********************* Other routines ****************************/
113
114 void dprod(tensor T, rvec V, rvec W);
115 /* calculate the direct product: T = V(x)W */
116
117 void fac_dprod(tensor T, rvec V, rvec W, real fac);
118 /* calculate the direct product and every component fac
119  * times to T: Tij += fac * [V(x)W]ij 
120  */
121
122 #endif  /* _vveclib_h */