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