Gromacs  2026.0-dev-20241204-d69d709
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
integrate.h File Reference
#include <cstdio>
#include "gromacs/utility/real.h"
+ Include dependency graph for integrate.h:
+ This graph shows which files directly or indirectly include this file:

Description

Declares routines for integrating a data set.

Author
David van der Spoel david.nosp@m..van.nosp@m.dersp.nosp@m.oel@.nosp@m.icm.u.nosp@m.u.se

Functions

real print_and_integrate (FILE *fp, int n, real dt, const real c[], const real *fit, int nskip)
 Integrate the equispaced data in c[] from 0 to n using trapezium rule. If fit != NULL the fit is written as well. More...
 
real evaluate_integral (int n, const real x[], const real y[], const real dy[], real aver_start, real *stddev)
 Integrate data in y using the trapezium rule, and, if given, use dy as weighting. More...
 

Function Documentation

real evaluate_integral ( int  n,
const real  x[],
const real  y[],
const real  dy[],
real  aver_start,
real stddev 
)

Integrate data in y using the trapezium rule, and, if given, use dy as weighting.

Parameters
[in]nThe number of data points
[in]xThe x coordinate
[in]yThe y data (function values)
[in]dyThe uncertainties (can be NULL)
[in]aver_startshould be set to a value where the function has converged to 0.
[out]stddevThe standard deviation in the integral
Returns
the integral

Integrate data in y using the trapezium rule, and, if given, use dy as weighting.

real print_and_integrate ( FILE *  fp,
int  n,
real  dt,
const real  c[],
const real fit,
int  nskip 
)

Integrate the equispaced data in c[] from 0 to n using trapezium rule. If fit != NULL the fit is written as well.

Parameters
[in]fpFile pointer to write to (maybe NULL)
[in]nNumber of data points
[in]dtThe time step between data points
[in]cThe data set
[in]fitFit to the function that is printed too if not a NULL pointer is passed.
[in]nskipDetermines whether all elements are written to the output file (written when i % nskip == 0)
Returns
The integral

Integrate the equispaced data in c[] from 0 to n using trapezium rule. If fit != NULL the fit is written as well.

Author
David van der Spoel david.nosp@m..van.nosp@m.dersp.nosp@m.oel@.nosp@m.icm.u.nosp@m.u.se

Integrate a function and printe the integral value.