get rid of piForeach

apply some code analyzer recommendations
ICU flag now check if libicu exists
prepare for more accurate growth of containers (limited PoT, then constantly increase size)
This commit is contained in:
2024-11-20 20:01:47 +03:00
parent 24112498ce
commit caa7880cc4
40 changed files with 415 additions and 320 deletions

View File

@@ -48,18 +48,12 @@ public:
PolynomialApproximation_5 = 35
};
PIMathSolver() {
times.resize(4);
step = 0;
}
PIMathSolver();
void solve(double u, double h);
void fromTF(const TransferFunction & TF);
void setMethod(Method m) { method = m; }
void setTime(double time) {
times.pop_back();
times.push_front(time);
}
void setTime(double time);
void solveEyler1(double u, double h);
void solveEyler2(double u, double h);
@@ -68,40 +62,17 @@ public:
void solveABM3(double u, double h);
void solveABM4(double u, double h);
void solvePA(double u, double h, uint deg);
void solvePA2(double u, double h) {
if (step > 0)
solvePA(u, h, 2);
else
solveEyler1(u, h);
}
void solvePA3(double u, double h) {
if (step > 1)
solvePA(u, h, 3);
else
solvePA2(u, h);
}
void solvePA4(double u, double h) {
if (step > 2)
solvePA(u, h, 4);
else
solvePA3(u, h);
}
void solvePA5(double u, double h) {
if (step > 3)
solvePA(u, h, 5);
else
solvePA4(u, h);
}
void solvePA2(double u, double h);
void solvePA3(double u, double h);
void solvePA4(double u, double h);
void solvePA5(double u, double h);
PIMathVectord X;
static Method method_global;
static const char methods_desc[];
private:
void moveF() {
for (uint i = F.size() - 1; i > 0; --i)
F[i] = F[i - 1];
}
void moveF();
PIMathMatrixd A, M;
PIMathVectord d, a1, b1;
@@ -109,10 +80,10 @@ private:
PIMathVectord XX, Y, pY;
PIVector<PIMathVectord> F;
PIVector<double> times;
uint size, step;
Method method;
double sum, td, ct, lp, dh, t, x1, x0;
bool ok;
uint size = 0, step = 0;
Method method = Global;
double sum = 0., td = 0., ct = 0., lp = 0., dh = 0., t = 0., x1 = 0., x0 = 0.;
bool ok = false;
};
#endif // PIMATHSOLVER_H