[poincare] Replace Poincare::Complex by std::complex

This commit is contained in:
Émilie Feral
2018-07-05 13:29:55 +02:00
parent e7619633bd
commit dd0bc491f6
154 changed files with 1122 additions and 1558 deletions

View File

@@ -21,9 +21,9 @@ void CartesianFunction::setDisplayDerivative(bool display) {
}
double CartesianFunction::approximateDerivative(double x, Poincare::Context * context) const {
Poincare::Complex<double> abscissa = Poincare::Complex<double>::Float(x);
Poincare::Expression * args[2] = {expression(context), &abscissa};
Poincare::Derivative derivative(args, true);
Poincare::Expression * abscissa = Expression::CreateDecimal(x);
Poincare::Expression * args[2] = {expression(context)->clone(), abscissa};
Poincare::Derivative derivative(args, false); // derivative takes ownership of abscissa and the clone of expression
/* TODO: when we will simplify derivative, we might want to simplify the
* derivative here. However, we might want to do it once for all x (to avoid
* lagging in the derivative table. */
@@ -31,10 +31,10 @@ double CartesianFunction::approximateDerivative(double x, Poincare::Context * co
}
double CartesianFunction::sumBetweenBounds(double start, double end, Poincare::Context * context) const {
Poincare::Complex<double> x = Poincare::Complex<double>::Float(start);
Poincare::Complex<double> y = Poincare::Complex<double>::Float(end);
Poincare::Expression * args[3] = {expression(context), &x, &y};
Poincare::Integral integral(args, true);
Poincare::Expression * x = Expression::CreateDecimal(start);
Poincare::Expression * y = Expression::CreateDecimal(end);
Poincare::Expression * args[3] = {expression(context)->clone(), x, y};
Poincare::Integral integral(args, false); // Integral takes ownership of args
/* TODO: when we will simplify integral, we might want to simplify the
* integral here. However, we might want to do it once for all x (to avoid
* lagging in the derivative table. */