* Gromacs Runs On Most of All Computer Systems
*/
+#ifndef _constr_h
+#define _constr_h
#include "typedefs.h"
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif
+#endif
* Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
*/
-
+#ifndef _gmxcpp_h
+#define _gmxcpp_h
typedef struct gmx_cpp *gmx_cpp_t;
/* The possible return codes for these functions */
NOT THREAD SAFE
*/
char *cpp_error(gmx_cpp_t *handlep,int status);
+#endif
+++ /dev/null
-/*
- *
- * This source code is part of
- *
- * G R O M A C S
- *
- * GROningen MAchine for Chemical Simulations
- *
- * VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
- *
- * And Hey:
- * Gromacs Runs On Most of All Computer Systems
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef GROMACS_MAGIC
-#define GROMACS_MAGIC 0xff0d
-#endif
-
-#ifdef __cplusplus
-}
-#endif
* GRoups of Organic Molecules in ACtion for Science
*/
-#ifndef _constr_h
-#define _constr_h
+#ifndef _types_constr_h
+#define _types_constr_h
#ifdef __cplusplus
extern "C" {
#include <math.h>
#include "typedefs.h"
#include "smalloc.h"
+#include "vec.h"
#include "gmx_statistics.h"
-static double sqr(double x)
-{
- return x*x;
-}
-
-static int gmx_nint(double x)
+static int gmx_dnint(double x)
{
return (int) (x+0.5);
}
d2 = 0;
for(i=0; (i<N); i++)
{
- d2 += sqr(stats->x[i]-stats->y[i]);
+ d2 += dsqr(stats->x[i]-stats->y[i]);
if ((stats->dy[i]) && (weight == elsqWEIGHT_Y))
{
- w = 1/sqr(stats->dy[i]);
+ w = 1/dsqr(stats->dy[i]);
}
else
{
wtot += w;
- xx += w*sqr(stats->x[i]);
- xx_nw += sqr(stats->x[i]);
+ xx += w*dsqr(stats->x[i]);
+ xx_nw += dsqr(stats->x[i]);
- yy += w*sqr(stats->y[i]);
- yy_nw += sqr(stats->y[i]);
+ yy += w*dsqr(stats->y[i]);
+ yy_nw += dsqr(stats->y[i]);
yx += w*stats->y[i]*stats->x[i];
yx_nw += stats->y[i]*stats->x[i];
/* Compute average, sigma and error */
stats->aver = sy_nw/N;
- stats->sigma_aver = sqrt(yy_nw/N - sqr(sy_nw/N));
+ stats->sigma_aver = sqrt(yy_nw/N - dsqr(sy_nw/N));
stats->error = stats->sigma_aver/sqrt(N);
/* Compute RMSD between x and y */
yy_nw /= N;
sx_nw /= N;
sy_nw /= N;
- ssxx = N*(xx_nw - sqr(sx_nw));
- ssyy = N*(yy_nw - sqr(sy_nw));
+ ssxx = N*(xx_nw - dsqr(sx_nw));
+ ssyy = N*(yy_nw - dsqr(sy_nw));
ssxy = N*(yx_nw - (sx_nw*sy_nw));
- stats->Rdata = sqrt(sqr(ssxy)/(ssxx*ssyy));
+ stats->Rdata = sqrt(dsqr(ssxy)/(ssxx*ssyy));
/* Compute straight line through datapoints, either with intercept
zero (result in aa) or with intercept variable (results in a
{
dy = 1;
}
- chi2aa += sqr((stats->y[i]-(stats->aa*stats->x[i]))/dy);
- chi2 += sqr((stats->y[i]-(stats->a*stats->x[i]+stats->b))/dy);
+ chi2aa += dsqr((stats->y[i]-(stats->aa*stats->x[i]))/dy);
+ chi2 += dsqr((stats->y[i]-(stats->a*stats->x[i]+stats->b))/dy);
}
if (N > 2)
{
}
else
{
- nbins = gmx_nint((delta)/binwidth + 0.5);
+ nbins = gmx_dnint((delta)/binwidth + 0.5);
}
snew(*x,nbins);
snew(nindex,nbins);
chi2 = 0;
if (xd != NULL) {
for(i=0; i<n; i++)
- chi2 += sqr(yr[i] - ((*a)*xd[i] + (*b)));
+ chi2 += dsqr(yr[i] - ((*a)*xd[i] + (*b)));
} else {
for(i=0; i<n; i++)
- chi2 += sqr(yr[i] - ((*a)*xr[i] + (*b)));
+ chi2 += dsqr(yr[i] - ((*a)*xr[i] + (*b)));
}
if (n > 2)
gmx_fatal(FARGS,"Zero or negative weigths in linear regression analysis");
for (i=0; i<n; i++) {
- s_2 = sqr(1.0/dy[i]);
- sxx += s_2*sqr(x[i]);
+ s_2 = dsqr(1.0/dy[i]);
+ sxx += s_2*dsqr(x[i]);
sxy += s_2*y[i]*x[i];
- syy += s_2*sqr(y[i]);
+ syy += s_2*dsqr(y[i]);
sx += s_2*x[i];
sy += s_2*y[i];
w += s_2;
*chi2=0;
for(i=0; i<n; i++)
- *chi2+=sqr((y[i]-((*a)*x[i]+(*b)))/dy[i]);
+ *chi2+=dsqr((y[i]-((*a)*x[i]+(*b)))/dy[i]);
*chi2 = *chi2/w;
*da = sqrt(*chi2/((n-2)*dx2));
return bRet;
}
-static void choose_ff(FILE *fp)
+static void choose_file_format(FILE *fp)
{
int i,m,c;
int rc;
initcount(status);
clear_mat(box);
- choose_ff(fp);
+ choose_file_format(fp);
for(m=0; (m<DIM); m++)
box[m][m]=status->BOX[m];
}
}
-static void init_ekinstate(ekinstate_t *eks)
+static void zero_ekinstate(ekinstate_t *eks)
{
eks->ekin_n = 0;
eks->ekinh = NULL;
state->sd_X = NULL;
state->cg_p = NULL;
- init_ekinstate(&state->ekinstate);
+ zero_ekinstate(&state->ekinstate);
init_energyhistory(&state->enerhist);
/* Check whether the box is unchanged */
-static void check_box(matrix f_box, matrix box, char fn[], warninp_t wi)
+static void check_box_unchanged(matrix f_box, matrix box, char fn[], warninp_t wi)
{
int i,ii;
gmx_bool bSame=TRUE;
read_trn(reffile, &header.step, &header.t, &header.lambda, f_box, &header.natoms, rotg->x_ref, NULL, NULL);
/* Check whether the box is unchanged and output a warning if not: */
- check_box(f_box,box,reffile,wi);
+ check_box_unchanged(f_box,box,reffile,wi);
}
else
{
}
-static void rotate(int x[]) {
+static void rotate_offsets(int x[]) {
int t=x[0];
/* x[0]=x[2];
x[2]=x[1];
/*input order is different for test program to match FFTW order
(important for complex to real)*/
if (plan->flags&FFT5D_BACKWARD) {
- rotate(xs);
- rotate(xl);
- rotate(xc);
- rotate(NG);
+ rotate_offsets(xs);
+ rotate_offsets(xl);
+ rotate_offsets(xc);
+ rotate_offsets(NG);
if (plan->flags&FFT5D_ORDER_YZ) {
- rotate(xs);
- rotate(xl);
- rotate(xc);
- rotate(NG);
+ rotate_offsets(xs);
+ rotate_offsets(xl);
+ rotate_offsets(xc);
+ rotate_offsets(NG);
}
}
if ((plan->flags&FFT5D_REALCOMPLEX) && ((!(plan->flags&FFT5D_BACKWARD) && s==0) || ((plan->flags&FFT5D_BACKWARD) && s==2))) {
#include "do_fit.h"
#include "rmpbc.h"
#include "wgms.h"
-#include "magic.h"
#include "pbc.h"
#include "xvgr.h"
#include "xdrf.h"
#include "do_fit.h"
#include "rmpbc.h"
#include "wgms.h"
-#include "magic.h"
#include "pbc.h"
#include "viewit.h"
#include "xvgr.h"