changed reading hint
[gromacs/adressmacs.git] / include / matio.h
bloba6f25b76b02571410d0a7f8d492ea2a03383418d
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 * Good ROcking Metal Altar for Chronical Sinners
30 #ifndef _matio_h
31 #define _matio_h
33 static char *SRCID_matio_h = "$Id$";
35 #ifdef HAVE_IDENT
36 #ident "@(#) matio.h 1.11 5/20/97"
37 #endif /* HAVE_IDENT */
38 #include "typedefs.h"
40 extern bool matelmt_cmp(t_xpmelmt e1, t_xpmelmt e2);
42 extern t_matelmt searchcmap(int n,t_mapping map[],t_xpmelmt c);
43 /* Seach in the map for code 'c' and return entry number.
44 * return -1 if not found
47 extern int getcmap(FILE *in,char *fn,t_mapping **map);
48 /* Read the mapping table from in, return number of entries */
50 extern int readcmap(char *fn,t_mapping **map);
51 /* Read the mapping table from fn, return number of entries */
53 extern void printcmap(FILE *out,int n,t_mapping map[]);
54 /* print mapping table to out */
56 extern void writecmap(char *fn,int n,t_mapping map[]);
57 /* print mapping table to fn */
59 extern int read_xpm_matrix(char *fnm, t_matrix **matrix);
60 /* Reads a number of matrices from .xpm file fnm and returns this number */
62 extern real **matrix2real(t_matrix *matrix,real **mat);
63 /* Converts an matrix in a t_matrix struct to a matrix of reals
64 * When mat==NULL memory will be allocated
65 * Returns NULL when something went wrong
68 extern void write_xpm_m(FILE *out, t_matrix m);
69 /* Writes a t_matrix struct to .xpm file */
71 extern void write_xpm3(FILE *out,
72 char *title,char *legend,char *label_x,char *label_y,
73 int n_x,int n_y,real axis_x[],real axis_y[],
74 real *matrix[],real lo,real mid,real hi,
75 t_rgb rlo,t_rgb rmid,t_rgb rhi,int *nlevels);
76 /* See write_xpm.
77 * Writes a colormap varying as rlo -> rmid -> rhi.
80 extern void write_xpm(FILE *out,
81 char *title,char *legend,char *label_x,char *label_y,
82 int n_x,int n_y,real t_x[],real t_y[],
83 real *matrix[],real lo,real hi,
84 t_rgb rlo,t_rgb rhi,int *nlevels);
85 /* out xpm file
86 * title matrix title
87 * legend label for the continuous legend
88 * label_x label for the x-axis
89 * label_y label for the y-axis
90 * n_x, n_y size of the matrix
91 * axis_x[] the x-ticklabels
92 * axis_y[] the y-ticklables
93 * *matrix[] element x,y is matrix[x][y]
94 * lo output lower than lo is set to lo
95 * hi output higher than hi is set to hi
96 * rlo rgb value for level lo
97 * rhi rgb value for level hi
98 * nlevels number of color levels for the output
101 #endif /* _matio_h */