Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
quadr.hpp
Go to the documentation of this file.
1/*
2 * This file is part of Vlasiator.
3 * Copyright 2010-2016 Finnish Meteorological Institute
4 *
5 * For details of usage, see the COPYING file and read the "Rules of the Road"
6 * at http://www.physics.helsinki.fi/vlasiator/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#ifndef QUADR_HPP
24#define QUADR_HPP
25
26#include <iostream>
27#include "functions.hpp"
28using namespace std;
29
30/*
31 1D,2D,3D Romberg non-singular integration a'la Numerical Recipes.
32 Integration bounds must be constants.
33 Header file is quadr.H.
34 Test program is tstquadr.C.
35 Same in Mathematica is tstquadr.ma.
36*/
37
38/*
39 The iterations are stopped when the results changes by less than absacc.
40*/
41
42
43
44double Romberg(const T1DFunction& func, double a, double b, double absacc);
45double Romberg(const T2DFunction& func, double a, double b, double c, double d, double absacc);
46double Romberg(const T3DFunction& func, double a, double b, double c, double d, double e, double f, double absacc);
47
48#endif
Constants c
Definition Dispersion.m:45
std::function< double(double, double)> T2DFunction
Definition functions.hpp:31
std::function< double(double, double, double)> T3DFunction
Definition functions.hpp:32
std::function< double(double)> T1DFunction
Definition functions.hpp:30
double Romberg(const T1DFunction &func, double a, double b, double absacc)
Definition quadr.cpp:179