OpenWAM
|
#include <cstdlib>
#include <vector>
#include <cmath>
#include <limits>
#include <iostream>
#include "Globales.h"
Go to the source code of this file.
Classes | |
struct | stPolar |
struct | stRectan |
struct | Base_interp |
struct | Linear_interp |
struct | Hermite_interp |
struct | Step_interp |
struct | LUdcmp |
Typedefs | |
typedef unsigned int | Uint |
Unsigned integer. | |
typedef std::vector< double > | dVector |
Double vector. | |
typedef std::vector< std::vector< double > > | dMatrix |
2-dimensional double matrix | |
typedef std::vector< int > | iVector |
Integer vector. | |
typedef std::vector< std::vector< int > > | iMatrix |
2-dimensional integer matrix | |
typedef std::vector< bool > | bVector |
Boolean vector. | |
typedef std::vector< std::vector< bool > > | bMatrix |
2-dimensional boolean matrix | |
Functions | |
double | Interpola (double vizq, double vder, double axid, double xif) |
template<class T > | |
T | pow2 (T x) |
Returns x to the power of 2. More... | |
template<class T > | |
T | pow3 (T x) |
Returns x to the power of 3. More... | |
template<class T > | |
T | pow4 (T x) |
Returns x to the power of 4. More... | |
template<class T > | |
T | pow025 (T x) |
Returns x to the power of 0.25. More... | |
template<class T > | |
T | pow150 (T x) |
Returns x to the power of 1.5. More... | |
template<class T > | |
T | pow075 (T x) |
Returns x to the power of 0.75. More... | |
template<class T , class U > | |
T | poww (T x, U y) |
template<class T > | |
T | sqrtw (T x) |
template<class T > | |
bool | DoubEqZero (T x) |
double | QuadraticEqP (double A, double B, double C) |
double | QuadraticEqN (double A, double B, double C) |
template<class T > | |
T | SQR (const T a) |
template<class T > | |
const T & | Max (const T &a, const T &b) |
float | Max (const double &a, const float &b) |
float | Max (const float &a, const double &b) |
template<class T > | |
const T & | Min (const T &a, const T &b) |
float | Min (const double &a, const float &b) |
float | Min (const float &a, const double &b) |
template<class T > | |
T | Sign (const T &a, const T &b) |
float | Sign (const float &a, const double &b) |
float | Sign (const double &a, const float &b) |
template<class T > | |
void | Swap (T &a, T &b) |
template<class T > | |
T | MaxComponent (std::vector< T > &x) |
template<class T > | |
T | MinComponent (std::vector< T > &x) |
template<class T > | |
double | zbrent (T &func, const double &x1, const double &x2, const double &tol) |
Solves a function using Brent's method. More... | |
template<class T > | |
double | FindRoot (T &func, const double x1, const double x2) |
Finds the root of a function. More... | |
template<class T > | |
bool | zbrac (T &func, double &x1, double &x2) |
template<class T > | |
bool | zbrac2 (T &func, double &x1, double &x2, const double &min, const double &max) |
template<class T > | |
void | zbrak (T &fx, const double x1, const double x2, const int n, dVector &xb1, dVector &xb2, int &nroot) |
template<class T > | |
double | rtbis (T &func, const double x1, const double x2, const double xacc) |
template<class T > | |
double | rtflsp (T &func, const double x1, const double x2, const double xacc) |
template<class T > | |
double | rtsec (T &func, const double x1, const double x2, const double xacc) |
template<class T > | |
double | zriddr (T &func, const double x1, const double x2, const double xacc) |
template<class T > | |
double | rtnewt (T &funcd, const double x1, const double x2, const double xacc) |
template<class T > | |
double | rtsafe (T &funcd, const double x1, const double x2, const double xacc) |
This file is part of OpenWAM.
OpenWAM 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 3 of the License, or (at your option) any later version.
OpenWAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with OpenWAM. If not, see http://www.gnu.org/licenses/.
This file declares several auxiliary math functions, as well as some typedefs.
Definition in file Math_wam.h.
|
inline |
Finds the root of a function.
Finds the root of a function using Brent's method. It uses a combination of the bisection method, the secant method and inverse quadratic interpolation, and finds the root in an interval. The function must have different signs at each bound of the interval. If the signs are the same, returns one of the bounds, whichever is minimum. It uses a default tolerance of 1e-10.
func | The function. |
x1 | The lower bound of the interval. |
x2 | The upper bound of the interval. |
Definition at line 459 of file Math_wam.h.
References zbrent().
|
inline |
Returns x to the power of 0.25.
Computes
x | The value. |
Definition at line 127 of file Math_wam.h.
|
inline |
Returns x to the power of 0.75.
Computes
x | The value. |
Definition at line 153 of file Math_wam.h.
References pow150().
|
inline |
Returns x to the power of 1.5.
Computes
x | The value. |
Definition at line 140 of file Math_wam.h.
References pow3().
|
inline |
Returns x to the power of 2.
Computes
x | The value. |
Definition at line 88 of file Math_wam.h.
|
inline |
Returns x to the power of 3.
Computes
x | The value. |
Definition at line 101 of file Math_wam.h.
|
inline |
Returns x to the power of 4.
Computes
x | The value. |
Definition at line 114 of file Math_wam.h.
|
inline |
Solves a function using Brent's method.
Finds the root of a function using Brent's method. It uses a combination of the bisection method, the secant method and inverse quadratic interpolation, and finds the root in an interval. The function must have different signs at each bound of the interval. If the signs are the same, returns one of the bounds, whichever is minimum.
func | The function. |
x1 | The lower bound of the interval. |
x2 | The upper bound of the interval. |
tol | The tolerance of the method. |
Definition at line 352 of file Math_wam.h.