4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
11 * Copyright (c) 1991-2001, University of Groningen, The Netherlands
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * If you want to redistribute modifications, please consider that
18 * scientific software is very special. Version control is crucial -
19 * bugs must be traceable. We will be happy to consider code for
20 * inclusion in the official distribution, but derived work must not
21 * be called official GROMACS. Details are found in the README & COPYING
22 * files - if they are missing, get the official version at www.gromacs.org.
24 * To help us fund GROMACS development, we humbly ask that you cite
25 * the papers on the package - you can find them in the top README file.
27 * For more info, check our website at http://www.gromacs.org
30 * Getting the Right Output Means no Artefacts in Calculating Stuff
36 static char *SRCID_matio_h
= "$Id$";
42 #ident "@(#) matio.h 1.11 5/20/97"
43 #endif /* HAVE_IDENT */
46 extern bool matelmt_cmp(t_xpmelmt e1
, t_xpmelmt e2
);
48 extern t_matelmt
searchcmap(int n
,t_mapping map
[],t_xpmelmt c
);
49 /* Seach in the map for code 'c' and return entry number.
50 * return -1 if not found
53 extern int getcmap(FILE *in
,char *fn
,t_mapping
**map
);
54 /* Read the mapping table from in, return number of entries */
56 extern int readcmap(char *fn
,t_mapping
**map
);
57 /* Read the mapping table from fn, return number of entries */
59 extern void printcmap(FILE *out
,int n
,t_mapping map
[]);
60 /* print mapping table to out */
62 extern void writecmap(char *fn
,int n
,t_mapping map
[]);
63 /* print mapping table to fn */
65 extern int read_xpm_matrix(char *fnm
, t_matrix
**matrix
);
66 /* Reads a number of matrices from .xpm file fnm and returns this number */
68 extern real
**matrix2real(t_matrix
*matrix
,real
**mat
);
69 /* Converts an matrix in a t_matrix struct to a matrix of reals
70 * When mat==NULL memory will be allocated
71 * Returns NULL when something went wrong
74 extern void write_xpm_m(FILE *out
, t_matrix m
);
75 /* Writes a t_matrix struct to .xpm file */
77 extern void write_xpm3(FILE *out
,
78 char *title
,char *legend
,char *label_x
,char *label_y
,
79 int n_x
,int n_y
,real axis_x
[],real axis_y
[],
80 real
*matrix
[],real lo
,real mid
,real hi
,
81 t_rgb rlo
,t_rgb rmid
,t_rgb rhi
,int *nlevels
);
83 * Writes a colormap varying as rlo -> rmid -> rhi.
86 extern void write_xpm(FILE *out
,
87 char *title
,char *legend
,char *label_x
,char *label_y
,
88 int n_x
,int n_y
,real t_x
[],real t_y
[],
89 real
*matrix
[],real lo
,real hi
,
90 t_rgb rlo
,t_rgb rhi
,int *nlevels
);
93 * legend label for the continuous legend
94 * label_x label for the x-axis
95 * label_y label for the y-axis
96 * n_x, n_y size of the matrix
97 * axis_x[] the x-ticklabels
98 * axis_y[] the y-ticklables
99 * *matrix[] element x,y is matrix[x][y]
100 * lo output lower than lo is set to lo
101 * hi output higher than hi is set to hi
102 * rlo rgb value for level lo
103 * rhi rgb value for level hi
104 * nlevels number of color levels for the output
107 extern real
**mk_matrix(int nx
, int ny
, bool b1D
);
109 extern void done_matrix(int nx
, real
***m
);
111 extern void clear_matrix(int nx
, int ny
, real
**m
);
113 #endif /* _matio_h */