#include <EquationsSolver.h>
List of all members.
Static Public Member Functions |
| static bool | solveLinearEquation (const Float &a, const Float &b, Float &x1) |
| static bool | solveLinearEquations2 (const Float &a1, const Float &b1, const Float &c1, const Float &a2, const Float &b2, const Float &c2, Float &x, Float &y) |
| static bool | solveLinearEquations3 (const Float &a1, const Float &b1, const Float &c1, const Float &d1, const Float &a2, const Float &b2, const Float &c2, const Float &d2, const Float &a3, const Float &b3, const Float &c3, const Float &d3, Float &x, Float &y, Float &z) |
| static bool | solveLinearEquations (const TMatrix &rAVars, const TVector &rDVars, TVector &rResults) |
| static Int | solveQuadraticEquationReal (const Float &a, const Float &b, const Float &c, Float &x1, Float &x2) |
| static bool | findRoot (RealRealFunction pFunction, const Float &fInitialValue, Float &fRoot, Int iMaxIterations=100000) |
Detailed Description
TEquationsSolver is a static class encapsulating equations solving capabilities supported by the zeus math package.
Member Function Documentation
| bool zeus::TEquationsSolver::findRoot |
( |
RealRealFunction |
pFunction, |
|
|
const Float & |
fInitialValue, |
|
|
Float & |
fRoot, |
|
|
Int |
iMaxIterations = 100000 |
|
) |
| [static] |
Numerically approximate a root (German: Nullstelle) of a function from the real numbers to the real numbers:
y = f(x)
- Parameters:
-
| pFunction | [IN] : Pointer to a real real function. |
| fInitialValue | [IN] : Initial value to start the approximation of the root. |
| fRoot | [OUT]: Solution for the root. |
| iMaxIterations | [IN] : The maximum number of iterations for the numerical approximation. |
- Returns:
- The solution for the root was found.
| bool zeus::TEquationsSolver::solveLinearEquation |
( |
const Float & |
a, |
|
|
const Float & |
b, |
|
|
Float & |
x |
|
) |
| [static] |
Solves a simple equation of type ax+b = 0.
- Parameters:
-
| a | [IN] : Equation coefficient a, see above. |
| b | [IN] : Equation coefficient b, see above. |
| x | [OUT]: Solution. |
- Returns:
- : Solution exists.
| bool zeus::TEquationsSolver::solveLinearEquations |
( |
const TMatrix & |
rAVars, |
|
|
const TVector & |
rDVars, |
|
|
TVector & |
rResults |
|
) |
| [static] |
Solves a linear system with n linear equations of the form a11*[x1] + a12*[x2] ... a1n*[xn] + d1 = 0
a21*[x1] + a22*[x2] ... a2n*[xn] + d2 = 0
...
where as a11, a12 ... ann are components of the rAVars matrix, d1 ..dn are components of the rDVars vector. The result is returned as a vector, which must be interpreted like [x1] = v1, [x2] = v2, with v1, v2 ..vn are components of the result vector.
- Parameters:
-
| rAVars | : Components of the variables |
| rDVars | : d-components |
| rResults | : result vector |
- Return values:
-
| true | : A solution has been found |
| false,: | No solution or the dimensions of matrix and vectors are not the same. Make sure the matrix is n x n and the vector has n components. The result will be created by this method and must not be initialized. |
| bool zeus::TEquationsSolver::solveLinearEquations2 |
( |
const Float & |
a1, |
|
|
const Float & |
b1, |
|
|
const Float & |
c1, |
|
|
const Float & |
a2, |
|
|
const Float & |
b2, |
|
|
const Float & |
c2, |
|
|
Float & |
x, |
|
|
Float & |
y |
|
) |
| [static] |
Solve a system of 2 linear equations of the form
a1*x + b1*y + c1 = 0
a2*x + b2*y + c2 = 0
for x and y.
- Parameters:
-
| a1 | [IN] : Equation coefficient a1, see above. |
| b1 | [IN] : Equation coefficient b1, see above. |
| c1 | [IN] : Equation coefficient c1, see above. |
| a2 | [IN] : Equation coefficient a2, see above. |
| b2 | [IN] : Equation coefficient b2, see above. |
| c2 | [IN] : Equation coefficient c2, see above. |
| x1 | [OUT]: Solution 1. |
| x2 | [OUT]: Solution 2. |
- Return values:
-
| true | : A unique solution exists. |
| false | : No solution exists. |
| bool zeus::TEquationsSolver::solveLinearEquations3 |
( |
const Float & |
a1, |
|
|
const Float & |
b1, |
|
|
const Float & |
c1, |
|
|
const Float & |
d1, |
|
|
const Float & |
a2, |
|
|
const Float & |
b2, |
|
|
const Float & |
c2, |
|
|
const Float & |
d2, |
|
|
const Float & |
a3, |
|
|
const Float & |
b3, |
|
|
const Float & |
c3, |
|
|
const Float & |
d3, |
|
|
Float & |
x, |
|
|
Float & |
y, |
|
|
Float & |
z |
|
) |
| [static] |
Solve a system of 3 linear equations of the form
a1*x + b1*y + c1*z + d1 = 0 a2*x + b2*y + c2*z + d2 = 0 a3*x + b3*y + c3*z + d3 = 0
for x, y and z.
- Parameters:
-
| a1 | [IN] : Equation coefficient a1, see above. |
| b1 | [IN] : Equation coefficient b1, see above. |
| c1 | [IN] : Equation coefficient c1, see above. |
| d1 | [IN] : Equation coefficient d1, see above. |
| a2 | [IN] : Equation coefficient a2, see above. |
| b2 | [IN] : Equation coefficient b2, see above. |
| c2 | [IN] : Equation coefficient c2, see above. |
| d2 | [IN] : Equation coefficient d2, see above. |
| a3 | [IN] : Equation coefficient a3, see above. |
| b3 | [IN] : Equation coefficient b3, see above. |
| c3 | [IN] : Equation coefficient c3, see above. |
| d3 | [IN] : Equation coefficient d3, see above. |
| x | [OUT]: Solution 1. |
| y | [OUT]: Solution 2. |
| z | [OUT]: Solution 3. |
- Return values:
-
| true | : A unique solution exists. |
| false | : No solution exists. |
| Int zeus::TEquationsSolver::solveQuadraticEquationReal |
( |
const Float & |
a, |
|
|
const Float & |
b, |
|
|
const Float & |
c, |
|
|
Float & |
x1, |
|
|
Float & |
x2 |
|
) |
| [static] |
Solve a quadratic equation of the form
a*x^2 + b*x + c = 0
for x over the real numbers.
- Parameters:
-
| a | [IN] : Equation coefficient a, see above. |
| b | [IN] : Equation coefficient b, see above. |
| c | [IN] : Equation coefficient c, see above. |
| x1 | [OUT]: Solution 1. |
| x2 | [OUT]: Solution 2. |
- Returns:
- : The number of distinct solutions over the real numbers.
The documentation for this class was generated from the following files: