Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / xvgr.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  * GRoups of Organic Molecules in ACtion for Science
35  */
36
37 #ifndef _xvgr_h
38 #define _xvgr_h
39
40 static char *SRCID_xvgr_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) xvgr.h 1.8 7/28/97"
47 #endif /* HAVE_IDENT */
48
49 #ifdef CPLUSPLUS
50 extern "C" {
51 #endif
52
53 #include "sysstuff.h"
54 #include "typedefs.h"
55 #include "viewit.h"
56
57 /***************************************************
58  *            XVGR   DEFINITIONS
59  ***************************************************/
60 enum {
61   elNone, elSolid, elDotted, elDashed, 
62   elLongDashed, elDotDashed, elNR
63 };
64 /* xvgr line-styles */
65
66 enum {  
67   ecWhite, ecFrank, ecBlack=ecFrank,
68   ecRed, ecGreen, ecBlue, ecYellow, ecBrown, ecGray, 
69   ecPurple, ecLightBlue, ecViolet, ecHolland, ecLila, ecDarkGray, 
70   ecAquamarine, ecOlive, ecNR
71 };
72 /* xvgr line-colors */
73
74 enum {
75   eppNone, eppColor, eppPattern, eppNR
76 };
77 /* xvgr pattern type */
78
79 enum {
80   evView, evWorld, evNR
81 };
82 /* view type */
83
84 /***************************************************
85  *            XVGR   ROUTINES
86  ***************************************************/
87
88 extern FILE *xvgropen(char *fn,char *title,char *xaxis,char *yaxis);
89 /* Open a file, and write a title, and axis-labels in Xvgr format */
90
91   /*extern void xvgr_file(char *fn,char *opts);*/
92 /* ! - - - DEPRECATED - - - !
93  * use do_view now instead!
94  * optional support for xmgrace now via env. GMX_VIEW_XVG
95  * see viewit.c/.h (gmxlib)
96  * Starts xvgr with a file fn in the background,
97  * opts (options to xvgr) may be NULL
98  */
99
100 extern void xvgr_view(FILE *out,real xmin,real ymin,real xmax,real ymax);
101 /* Set the view in xvgr */
102
103 extern void xvgr_world(FILE *out,real xmin,real ymin,real xmax,real ymax);
104 /* Set the world in xvgr */
105
106 extern void xvgr_legend(FILE *out,int nsets,char *setname[]);
107 /* Make a legend box, and also modifies the view to make room for the legend */
108
109 extern void xvgr_line_props(FILE *out,int NrSet,int LineStyle,int LineColor);
110 /* Set xvgr line styles and colors */
111
112 extern void xvgr_box(FILE *out,
113                      int LocType,
114                      real xmin,real ymin,real xmax,real ymax,
115                      int LineStyle,int LineWidth,int LineColor,
116                      int BoxFill,int BoxColor,int BoxPattern);
117 /* Make a box */
118
119 extern int read_xvg(char *fn,real ***y,int *ny);
120 /* Read an xvg file for post processing. The number of rows is returned
121  * fn is the filename, y is a pointer to a 2D array (to be allocated by
122  * the routine) ny is the number of columns (including X if appropriate)
123  */
124  
125 extern void write_xvg(char *fn,char *title,int nx,int ny,real **y,char **leg);
126 /* Write a two D array (y) of dimensions nx rows times
127  * ny columns to a file. If leg != NULL it will be written too.
128  */
129
130 /****************************************************
131  *           Some statistics utilities 
132  ****************************************************/
133 extern void lsq_y_ax(int n, real x[], real y[], real *a);
134 /* Fit a straight line y=ax thru the n data points x,y. */
135
136 extern real lsq_y_ax_b(int n, real x[], real y[], real *a, real *b);
137 /* Fit a straight line y=ax+b thru the n data points x,y.
138  * Returns the "fit quality" sigma = sqrt(chi^2/(n-2)).
139  */
140
141 #ifdef CPLUSPLUS
142 }
143 #endif
144
145 #endif  /* _xvgr_h */