#include <solution.h>
|
| OneDimSolve (R1_R1 &f, Real AccY=0.0001, Real AccX=0.0) |
|
Real | Solve (Real Y, Real X, Real Dev, int Lim=100) |
|
Definition at line 53 of file solution.h.
◆ OneDimSolve()
OneDimSolve::OneDimSolve |
( |
R1_R1 & |
f, |
|
|
Real |
AccY = 0.0001 , |
|
|
Real |
AccX = 0.0 |
|
) |
| |
|
inline |
◆ Flip()
void OneDimSolve::Flip |
( |
| ) |
|
|
private |
◆ HFlip()
void OneDimSolve::HFlip |
( |
| ) |
|
|
private |
◆ Linear()
void OneDimSolve::Linear |
( |
int |
I, |
|
|
int |
J, |
|
|
int |
K |
|
) |
| |
|
private |
◆ LookAt()
void OneDimSolve::LookAt |
( |
int |
V | ) |
|
|
private |
Definition at line 49 of file solution.cpp.
References accX, accY, Captured, Finish, L, Last, lim, U, vpol, x, y, and YY.
Referenced by Solve().
◆ Quadratic()
void OneDimSolve::Quadratic |
( |
int |
I, |
|
|
int |
J, |
|
|
int |
K |
|
) |
| |
|
private |
Definition at line 79 of file solution.cpp.
References square(), x, and y.
Referenced by Solve().
82 Real YJK, YIK, YIJ, XKI, XKJ;
83 YJK =
y[J] -
y[K]; YIK =
y[I] -
y[K]; YIJ =
y[I] -
y[J];
85 XKJ = (
x[K]*
y[J] -
x[J]*
y[K])/YJK;
86 if (
square(YJK/YIK)>(
x[K] -
x[J])/XKI ||
94 XKI = (
x[K]*
y[I] -
x[I]*
y[K])/YIK;
95 x[I] = (XKJ*
y[I] - XKI*
y[J])/YIJ;
◆ Solve()
Real OneDimSolve::Solve |
( |
Real |
Y, |
|
|
Real |
X, |
|
|
Real |
Dev, |
|
|
int |
Lim = 100 |
|
) |
| |
Definition at line 100 of file solution.cpp.
References C, Captured, Finish, Flip(), HFlip(), hpol, i, L, Last, lim, Linear(), LookAt(), Quadratic(), State(), U, VFlip(), vpol, x, y, and YY.
102 enum Loop { start, captured1, captured2, binary, finish };
103 Tracer et(
"OneDimSolve::Solve");
107 if (Dev<0.0) {
hpol=-1; Dev = -Dev; }
110 if (!
function.IsValid(X))
112 Loop TheLoop = start;
122 if (!
function.maxXinf &&
x[
U] >
function.maxX)
123 x[
U] = (
function.maxX + X) / 2.0;
124 if (!
function.minXinf &&
x[
U] <
function.minX)
125 x[
U] = (
function.minX + X) / 2.0;
128 if (
y[
U] > 0.0) { TheLoop = captured1;
Captured =
true;
break; }
138 if (!
function.maxXinf &&
x[
U] >
function.maxX)
139 x[
U] = (
function.maxX +
x[
C]) / 2.0;
140 if (!
function.minXinf &&
x[
U] <
function.minX)
141 x[
U] = (
function.minX +
x[
C]) / 2.0;
144 if (
y[
U] > 0) { TheLoop = captured2;
Captured =
true;
break; }
150 if (TheLoop != start )
break;
160 if (
y[
C] < 0.5*
y[
L]) {
State(
C,
L,
U); TheLoop = binary;
break; }
169 { TheLoop = captured1;
break; }
173 if (
y[
C] > 0.5*
y[
L]) { TheLoop = captured2;
break; }
174 else {
State(
C,
L,
U); TheLoop = captured1;
break; }
185 if (TheLoop != binary)
break;
186 TheLoop = captured1;
break;
void State(int I, int J, int K)
void Linear(int, int, int)
void Quadratic(int, int, int)
◆ State()
void OneDimSolve::State |
( |
int |
I, |
|
|
int |
J, |
|
|
int |
K |
|
) |
| |
|
private |
◆ VFlip()
void OneDimSolve::VFlip |
( |
| ) |
|
|
private |
◆ accX
◆ accY
◆ Captured
bool OneDimSolve::Captured |
|
private |
◆ Finish
◆ function
R1_R1& OneDimSolve::function |
|
private |
◆ hpol
◆ Last
◆ lim
◆ vpol
◆ YY
The documentation for this class was generated from the following files: