From d980bb3da98ba34832fcfea276990dbded06ed42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 28 Aug 2018 10:59:49 +0200 Subject: [PATCH] [poincare] Change privateApproximate-->approximate --- poincare/include/poincare/prediction_interval.h | 2 +- poincare/src/matrix_dimension.cpp | 2 +- poincare/src/matrix_inverse.cpp | 2 +- poincare/src/matrix_trace.cpp | 2 +- poincare/src/matrix_transpose.cpp | 2 +- poincare/src/permute_coefficient.cpp | 4 ++-- poincare/src/prediction_interval.cpp | 4 ++-- poincare/src/randint.cpp | 4 ++-- poincare/src/round.cpp | 4 ++-- poincare/src/sequence.cpp | 6 +++--- poincare/src/store.cpp | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/poincare/include/poincare/prediction_interval.h b/poincare/include/poincare/prediction_interval.h index 4c370698f..f8b44de9e 100644 --- a/poincare/include/poincare/prediction_interval.h +++ b/poincare/include/poincare/prediction_interval.h @@ -24,7 +24,7 @@ private: Expression shallowReduce(Context& context, Preferences::AngleUnit angleUnit) const override; /* Evaluation */ Evaluation approximate(Expression::SinglePrecision p, Context& context, Preferences::AngleUnit angleUnit) const override { return templatedApproximate(context, angleUnit); } - Evaluation * privateApproximate(Expression::DoublePrecision p, Context& context, Preferences::AngleUnit angleUnit) const override { return templatedApproximate(context, angleUnit); } + Evaluation * approximate(Expression::DoublePrecision p, Context& context, Preferences::AngleUnit angleUnit) const override { return templatedApproximate(context, angleUnit); } template Evaluation templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const; }; diff --git a/poincare/src/matrix_dimension.cpp b/poincare/src/matrix_dimension.cpp index cedf77cb0..01f62dbae 100644 --- a/poincare/src/matrix_dimension.cpp +++ b/poincare/src/matrix_dimension.cpp @@ -41,7 +41,7 @@ Expression MatrixDimension::shallowReduce(Context& context, Preferences::AngleUn template Evaluation MatrixDimension::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { - Evaluation * input = childAtIndex(0)->privateApproximate(T(), context, angleUnit); + Evaluation * input = childAtIndex(0)->approximate(T(), context, angleUnit); std::complex operands[2]; if (input->type() == Evaluation::Type::MatrixComplex) { operands[0] = std::complex(static_cast *>(input)->numberOfRows()); diff --git a/poincare/src/matrix_inverse.cpp b/poincare/src/matrix_inverse.cpp index 0fe1dfa8d..e5c18d311 100644 --- a/poincare/src/matrix_inverse.cpp +++ b/poincare/src/matrix_inverse.cpp @@ -46,7 +46,7 @@ Expression MatrixInverse::shallowReduce(Context& context, Preferences::AngleUnit // TODO: handle this exactly in shallowReduce for small dimensions. template Evaluation MatrixInverse::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { - Evaluation * input = childAtIndex(0)->privateApproximate(T(), context, angleUnit); + Evaluation * input = childAtIndex(0)->approximate(T(), context, angleUnit); Evaluation * inverse = input->createInverse(); if (inverse == nullptr) { inverse = new Complex(Complex::Undefined()); diff --git a/poincare/src/matrix_trace.cpp b/poincare/src/matrix_trace.cpp index b75d16d80..00462472c 100644 --- a/poincare/src/matrix_trace.cpp +++ b/poincare/src/matrix_trace.cpp @@ -50,7 +50,7 @@ Expression MatrixTrace::shallowReduce(Context& context, Preferences::AngleUnit a template Complex * MatrixTrace::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { - Evaluation * input = childAtIndex(0)->privateApproximate(T(), context, angleUnit); + Evaluation * input = childAtIndex(0)->approximate(T(), context, angleUnit); Complex * result = new Complex(input->createTrace()); delete input; return result; diff --git a/poincare/src/matrix_transpose.cpp b/poincare/src/matrix_transpose.cpp index f0bf2a202..234ba8058 100644 --- a/poincare/src/matrix_transpose.cpp +++ b/poincare/src/matrix_transpose.cpp @@ -39,7 +39,7 @@ Expression MatrixTranspose::shallowReduce(Context& context, Preferences::AngleUn template Evaluation MatrixTranspose::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { - Evaluation * input = childAtIndex(0)->privateApproximate(T(), context, angleUnit); + Evaluation * input = childAtIndex(0)->approximate(T(), context, angleUnit); Evaluation * transpose = input->createTranspose(); assert(transpose != nullptr); delete input; diff --git a/poincare/src/permute_coefficient.cpp b/poincare/src/permute_coefficient.cpp index eddf6df51..6c31f36f1 100644 --- a/poincare/src/permute_coefficient.cpp +++ b/poincare/src/permute_coefficient.cpp @@ -68,8 +68,8 @@ Expression PermuteCoefficient::shallowReduce(Context& context, Preferences::Angl } template -Complex * PermuteCoefficient::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { Evaluation * nInput = childAtIndex(0)->privateApproximate(T(), context, angleUnit); - Evaluation * kInput = childAtIndex(1)->privateApproximate(T(), context, angleUnit); +Complex * PermuteCoefficient::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { Evaluation * nInput = childAtIndex(0)->approximate(T(), context, angleUnit); + Evaluation * kInput = childAtIndex(1)->approximate(T(), context, angleUnit); T n = nInput->toScalar(); T k = kInput->toScalar(); delete nInput; diff --git a/poincare/src/prediction_interval.cpp b/poincare/src/prediction_interval.cpp index ba817d440..b279f098d 100644 --- a/poincare/src/prediction_interval.cpp +++ b/poincare/src/prediction_interval.cpp @@ -72,8 +72,8 @@ Expression PredictionInterval::shallowReduce(Context& context, Preferences::Angl template Evaluation PredictionInterval::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { - Evaluation * pInput = childAtIndex(0)->privateApproximate(T(), context, angleUnit); - Evaluation * nInput = childAtIndex(1)->privateApproximate(T(), context, angleUnit); + Evaluation * pInput = childAtIndex(0)->approximate(T(), context, angleUnit); + Evaluation * nInput = childAtIndex(1)->approximate(T(), context, angleUnit); T p = static_cast *>(pInput)->toScalar(); T n = static_cast *>(nInput)->toScalar(); delete pInput; diff --git a/poincare/src/randint.cpp b/poincare/src/randint.cpp index 10a0c423a..6e10442bd 100644 --- a/poincare/src/randint.cpp +++ b/poincare/src/randint.cpp @@ -19,8 +19,8 @@ Expression * Randint::clone() const { } template Evaluation * Randint::templateApproximate(Context & context, Preferences::AngleUnit angleUnit) const { - Evaluation * aInput = childAtIndex(0)->privateApproximate(T(), context, angleUnit); - Evaluation * bInput = childAtIndex(1)->privateApproximate(T(), context, angleUnit); + Evaluation * aInput = childAtIndex(0)->approximate(T(), context, angleUnit); + Evaluation * bInput = childAtIndex(1)->approximate(T(), context, angleUnit); T a = aInput->toScalar(); T b = bInput->toScalar(); delete aInput; diff --git a/poincare/src/round.cpp b/poincare/src/round.cpp index 1e73d738b..f1d79d6f2 100644 --- a/poincare/src/round.cpp +++ b/poincare/src/round.cpp @@ -54,8 +54,8 @@ Expression Round::shallowReduce(Context& context, Preferences::AngleUnit angleUn template Complex * Round::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { - Evaluation * f1Input = childAtIndex(0)->privateApproximate(T(), context, angleUnit); - Evaluation * f2Input = childAtIndex(1)->privateApproximate(T(), context, angleUnit); + Evaluation * f1Input = childAtIndex(0)->approximate(T(), context, angleUnit); + Evaluation * f2Input = childAtIndex(1)->approximate(T(), context, angleUnit); T f1 = f1Input->toScalar(); T f2 = f2Input->toScalar(); delete f1Input; diff --git a/poincare/src/sequence.cpp b/poincare/src/sequence.cpp index 3c77b5ac3..b02fa72d2 100644 --- a/poincare/src/sequence.cpp +++ b/poincare/src/sequence.cpp @@ -17,8 +17,8 @@ LayoutRef Sequence::createLayout(Preferences::PrintFloatMode floatDisplayMode, i template Evaluation Sequence::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { - Evaluation * aInput = childAtIndex(1)->privateApproximate(T(), context, angleUnit); - Evaluation * bInput = childAtIndex(2)->privateApproximate(T(), context, angleUnit); + Evaluation * aInput = childAtIndex(1)->approximate(T(), context, angleUnit); + Evaluation * bInput = childAtIndex(2)->approximate(T(), context, angleUnit); T start = aInput->toScalar(); T end = bInput->toScalar(); delete aInput; @@ -34,7 +34,7 @@ Evaluation Sequence::templatedApproximate(Context& context, Preferences::Angl return new Complex(Complex::Undefined()); } nContext.setApproximationForVariable((T)i); - Evaluation * expression = childAtIndex(0)->privateApproximate(T(), nContext, angleUnit); + Evaluation * expression = childAtIndex(0)->approximate(T(), nContext, angleUnit); Evaluation * newResult = evaluateWithNextTerm(T(), result, expression); delete result; delete expression; diff --git a/poincare/src/store.cpp b/poincare/src/store.cpp index 1e69da3bc..03d2fd95b 100644 --- a/poincare/src/store.cpp +++ b/poincare/src/store.cpp @@ -45,7 +45,7 @@ template Evaluation Store::templatedApproximate(Context& context, Preferences::AngleUnit angleUnit) const { context.setExpressionForSymbolName(value(), symbol(), context); if (context.expressionForSymbol(symbol()) != nullptr) { - return context.expressionForSymbol(symbol())->privateApproximate(T(), context, angleUnit); + return context.expressionForSymbol(symbol())->approximate(T(), context, angleUnit); } return new Complex(Complex::Undefined()); }