#ifndef SPECTRUM_INCLUDED #define SPECTRUM_INCLUDED #include "fortran.h" #include "interact.h" /* Structure for specifying a spectrum calculation. It is in a format suitable for using in MPI communications In the parallel version, this is the structure that is passed between processes. Any changes to this structure must be included in the function initmpisectors(); */ typedef struct { enum state_type type; int ht[HINDEX]; /* total winding number */ int nptrunc; /* number of particles in truncation */ unsigned int kt; /* The total momentum. For antiperiodic links, this is twice the momentum. Otherwise, it is the momentum rounded down. */ int charge; /* charge conjugation */ int o; /* orientation reversal: having definite charge conjugation and orientation reversal is redundant */ int multi; /* multiplet of lattice symmetries */ integer momflag; /* flag for nonzero momentum/angles */ element angle[HINDEX+2]; /* angles and momenta, length HINDEX+2 */ integer nval; /* number of eigenvalues */ integer vectorflag; /* flag for calculating eigenvectors */ } specify_calculation; /* Structure for holding the results of an eigensystem calculation. WARNING, spectrum() may use memory past the end of the returned eigenvalues and eigenvectors. In any case, it may realloc() the memory. */ #define INITIAL_EIGENSYSTEM {NULL,0,{NULL,NULL,0}} /* initialization */ typedef struct { doublereal *values; size_t values_length; /* memory set aside for eigenvalues, in bytes */ struct { /* the one not being used is set to NULL */ doublereal *r; /* real - valued, */ doublecomplex *c; /* complex - valued */ size_t length; /* memory set aside for eigenvectors, in bytes */ } vectors; } eigensystem; /* record maximum length of els used used so far. In the parallel case, this is the group total for each variable. Thus, it must be of type size_mem. */ struct { size_mem n; /* Size of the matrix */ size_mem nonzero; /* number of nonzero matrix elements */ size_mem memory; /* memory used by els, in bytes */ } max_els; /*************************************************************************/ void initspectrum(specify_calculation *s, enum state_type type, int *ht, int nptrunc, unsigned int kt, int charge, int o, int multi, integer momflag, element *angle, integer nval, int vectorflag); void specifytobasis(specify_calculation *s, full_basis *x); void spectrum( specify_calculation *s, /* calculation specification, filled by initspectrum(...) */ element *couplings, /* coupling constants */ eigensystem *eigen, /* the results */ full_basis *basis /* pointer to the basis created */ ); void print_memory_usage(FILE *fp, full_basis *x); void free_spectrum(void); void free_eigensystem(eigensystem *eigen); /**************** Routines from file store.c ***********************/ void free_qstore(void); #endif