stack: Do not save stack in plot, integration or solver
Make sure that `Undo` and `LastArg` work correctly for plotting functions, integration and solver. Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 929 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
BIN
images/cllcd.png
Before Width: | Height: | Size: 903 B After Width: | Height: | Size: 889 B |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 452 B |
Before Width: | Height: | Size: 1,009 B After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
BIN
images/help.png
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 919 B |
BIN
images/lines.png
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
@ -104,6 +104,9 @@ algebraic_p integrate(program_g eq,
|
|||
// At each step, the size of C is one more than P.
|
||||
// In the implementation below, those arrays are on the stack, P above C.
|
||||
{
|
||||
// We will run commands below, do not save stack while doing it
|
||||
settings::PrepareForProgramEvaluation wilLRunPrograms;
|
||||
|
||||
// Check if the guess is an algebraic or if we need to extract one
|
||||
algebraic_g x, dx, dx2;
|
||||
algebraic_g y, dy, sy, sy2;
|
||||
|
|
|
@ -229,7 +229,7 @@ object::result draw_plot(object::id kind,
|
|||
algebraic_g y;
|
||||
save<symbol_g *> iref(expression::independent,
|
||||
(symbol_g *) &ppar.independent);
|
||||
settings::SaveSetAngleUnits ssau(false); // For asin, acos, atan
|
||||
settings::PrepareForProgramEvaluation wilLRunPrograms;
|
||||
if (ui.draw_graphics())
|
||||
if (Settings.DrawPlotAxes())
|
||||
draw_axes(ppar);
|
||||
|
|
|
@ -244,6 +244,21 @@ public:
|
|||
#define SETTING_BITS(Name, Bits, Low, High, Init) \
|
||||
SETTING(Name, Low, High, Init)
|
||||
#include "ids.tbl"
|
||||
|
||||
struct PrepareForProgramEvaluation
|
||||
{
|
||||
SaveSaveLastArguments saveLastArgs;
|
||||
SaveProgramLastArguments saveProgramLastArg;
|
||||
SaveSaveStack saveLastStack;
|
||||
SaveSetAngleUnits saveAngleUnits; // For sin, cos, tan
|
||||
|
||||
PrepareForProgramEvaluation()
|
||||
: saveLastArgs(false),
|
||||
saveProgramLastArg(false),
|
||||
saveLastStack(false),
|
||||
saveAngleUnits(false)
|
||||
{}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -127,6 +127,9 @@ algebraic_p solve(program_g eq, symbol_g name, object_g guess)
|
|||
x = lx;
|
||||
record(solve, "Initial range %t-%t", +lx, +hx);
|
||||
|
||||
// We will run programs, do not save stack, etc.
|
||||
settings::PrepareForProgramEvaluation wilLRunPrograms;
|
||||
|
||||
// Set independent variable
|
||||
save<symbol_g *> iref(expression::independent, &name);
|
||||
int prec = Settings.SolverPrecision();
|
||||
|
|