mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Namespace Poincare
Change-Id: I51a84fa7978ba16f128cfe1d32c390970f2037e8
This commit is contained in:
@@ -4,6 +4,8 @@ extern "C" {
|
||||
#include <assert.h>
|
||||
}
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
AppsContainer::AppsContainer() :
|
||||
Container(),
|
||||
m_window(AppsWindow()),
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
int numberOfApps();
|
||||
App * appAtIndex(int index);
|
||||
Context * globalContext();
|
||||
Poincare::Context * globalContext();
|
||||
Preferences * preferences();
|
||||
ToolboxController * toolboxController();
|
||||
VariableBoxController * variableBoxController();
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
#if USE_PIC_VIEW_APP
|
||||
PicViewApp m_picViewApp;
|
||||
#endif
|
||||
GlobalContext m_globalContext;
|
||||
Poincare::GlobalContext m_globalContext;
|
||||
Preferences m_preferences;
|
||||
ToolboxController m_toolboxController;
|
||||
VariableBoxController m_variableBoxController;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "app.h"
|
||||
#include "calculation_icon.h"
|
||||
using namespace Poincare;
|
||||
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ namespace Calculation {
|
||||
|
||||
class App : public TextFieldDelegateApp {
|
||||
public:
|
||||
App(Container * container, Context * context);
|
||||
Context * localContext() override;
|
||||
App(Container * container, Poincare::Context * context);
|
||||
Poincare::Context * localContext() override;
|
||||
private:
|
||||
LocalContext m_localContext;
|
||||
CalculationStore m_calculationStore;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "calculation.h"
|
||||
#include <string.h>
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
|
||||
@@ -18,19 +18,19 @@ public:
|
||||
/* c.reset() is the equivalent of c = Calculation() without copy assingment. */
|
||||
void reset();
|
||||
const char * text();
|
||||
Expression * input();
|
||||
ExpressionLayout * inputLayout();
|
||||
Expression * output();
|
||||
ExpressionLayout * outputLayout();
|
||||
void setContent(const char * c, Context * context, Preferences * preferences);
|
||||
Poincare::Expression * input();
|
||||
Poincare::ExpressionLayout * inputLayout();
|
||||
Poincare::Expression * output();
|
||||
Poincare::ExpressionLayout * outputLayout();
|
||||
void setContent(const char * c, Poincare::Context * context, Preferences * preferences);
|
||||
bool isEmpty();
|
||||
constexpr static int k_maximalExpressionTextLength = 255;
|
||||
private:
|
||||
char m_text[k_maximalExpressionTextLength];
|
||||
Expression * m_input;
|
||||
ExpressionLayout * m_inputLayout;
|
||||
Expression * m_output;
|
||||
ExpressionLayout * m_outputLayout;
|
||||
Poincare::Expression * m_input;
|
||||
Poincare::ExpressionLayout * m_inputLayout;
|
||||
Poincare::Expression * m_output;
|
||||
Poincare::ExpressionLayout * m_outputLayout;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "calculation_store.h"
|
||||
#include <assert.h>
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class CalculationStore {
|
||||
public:
|
||||
CalculationStore();
|
||||
Calculation * calculationAtIndex(int i);
|
||||
Calculation * push(const char * text, Context * context, Preferences * preferences);
|
||||
Calculation * push(const char * text, Poincare::Context * context, Preferences * preferences);
|
||||
void deleteCalculationAtIndex(int i);
|
||||
void deleteAll();
|
||||
int numberOfCalculations();
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
View * view() override;
|
||||
const char * title() const override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
void setFunction(Function * function);
|
||||
void didBecomeFirstResponder() override;
|
||||
void reload();
|
||||
int numberOfRows() override;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "local_context.h"
|
||||
#include <string.h>
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
class LocalContext : public Context {
|
||||
class LocalContext : public Poincare::Context {
|
||||
public:
|
||||
LocalContext(GlobalContext * parentContext, CalculationStore * calculationStore);
|
||||
void setExpressionForSymbolName(Expression * expression, const Symbol * symbol) override;
|
||||
const Expression * expressionForSymbol(const Symbol * symbol) override;
|
||||
LocalContext(Poincare::GlobalContext * parentContext, CalculationStore * calculationStore);
|
||||
void setExpressionForSymbolName(Poincare::Expression * expression, const Poincare::Symbol * symbol) override;
|
||||
const Poincare::Expression * expressionForSymbol(const Poincare::Symbol * symbol) override;
|
||||
private:
|
||||
Expression * ansValue();
|
||||
Poincare::Expression * ansValue();
|
||||
CalculationStore * m_calculationStore;
|
||||
GlobalContext * m_parentContext;
|
||||
Poincare::GlobalContext * m_parentContext;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "scrollable_expression_view.h"
|
||||
#include <assert.h>
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Calculation {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Calculation {
|
||||
class ScrollableExpressionView : public ScrollView, public Responder {
|
||||
public:
|
||||
ScrollableExpressionView(Responder * parentResponder);
|
||||
void setExpression(ExpressionLayout * expressionLayout);
|
||||
void setExpression(Poincare::ExpressionLayout * expressionLayout);
|
||||
void layoutSubviews() override;
|
||||
void setBackgroundColor(KDColor backgroundColor);
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <float.h>
|
||||
#include <string.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
CurveView::CurveView(CurveViewRange * curveViewRange, CurveViewCursor * curveViewCursor, BannerView * bannerView,
|
||||
View * cursorView) :
|
||||
View(),
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "text_field_delegate_app.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
EditableCellTableViewController::EditableCellTableViewController(Responder * parentResponder, KDCoordinate topMargin,
|
||||
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin) :
|
||||
ViewController(parentResponder),
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
|
||||
|
||||
int numberOfRows() override;
|
||||
void willDisplayCellAtLocationWithDisplayMode(TableViewCell * cell, int i, int j, Expression::DisplayMode displayMode);
|
||||
void willDisplayCellAtLocationWithDisplayMode(TableViewCell * cell, int i, int j, Poincare::Expression::DisplayMode displayMode);
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
const char * ExpressionTextFieldDelegate::XNT() {
|
||||
return "x";
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
class ExpressionTextFieldDelegate : public TextFieldDelegate {
|
||||
public:
|
||||
virtual Context * localContext() = 0;
|
||||
virtual Poincare::Context * localContext() = 0;
|
||||
virtual const char * XNT();
|
||||
bool textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) override;
|
||||
private:
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "text_field_delegate_app.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
FloatParameterController::FloatParameterController(Responder * parentResponder) :
|
||||
ViewController(parentResponder),
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "app.h"
|
||||
#include "graph_icon.h"
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Graph {
|
||||
|
||||
|
||||
@@ -13,12 +13,12 @@ namespace Graph {
|
||||
|
||||
class App : public TextFieldDelegateApp {
|
||||
public:
|
||||
App(Container * container, Context * context);
|
||||
App(Container * container, Poincare::Context * context);
|
||||
InputViewController * inputViewController();
|
||||
Context * localContext() override;
|
||||
Poincare::Context * localContext() override;
|
||||
private:
|
||||
FunctionStore m_functionStore;
|
||||
VariableContext m_xContext;
|
||||
Poincare::VariableContext m_xContext;
|
||||
ListController m_listController;
|
||||
HeaderViewController m_listHeader;
|
||||
StackViewController m_listStackViewController;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Graph {
|
||||
|
||||
Function::Function(const char * text, KDColor color) :
|
||||
|
||||
@@ -15,23 +15,23 @@ public:
|
||||
const char * text();
|
||||
const char * name();
|
||||
KDColor color() const { return m_color; }
|
||||
Expression * expression();
|
||||
ExpressionLayout * layout();
|
||||
Poincare::Expression * expression();
|
||||
Poincare::ExpressionLayout * layout();
|
||||
bool isActive();
|
||||
void setActive(bool active);
|
||||
bool displayDerivative();
|
||||
void setDisplayDerivative(bool display);
|
||||
void setContent(const char * c);
|
||||
void setColor(KDColor m_color);
|
||||
float evaluateAtAbscissa(float x, Context * context, Expression::AngleUnit angleUnit) const;
|
||||
float approximateDerivative(float x, Context * context, Expression::AngleUnit angleUnit) const;
|
||||
float evaluateAtAbscissa(float x, Poincare::Context * context, Poincare::Expression::AngleUnit angleUnit) const;
|
||||
float approximateDerivative(float x, Poincare::Context * context, Poincare::Expression::AngleUnit angleUnit) const;
|
||||
private:
|
||||
constexpr static int k_bodyLength = 255;
|
||||
char m_text[k_bodyLength];
|
||||
const char * m_name;
|
||||
KDColor m_color;
|
||||
Expression * m_expression;
|
||||
ExpressionLayout * m_layout;
|
||||
Poincare::Expression * m_expression;
|
||||
Poincare::ExpressionLayout * m_layout;
|
||||
bool m_active;
|
||||
bool m_displayDerivative;
|
||||
};
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Graph {
|
||||
|
||||
GraphController::GraphController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header) :
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Graph {
|
||||
|
||||
|
||||
@@ -15,16 +15,16 @@ public:
|
||||
GraphView(FunctionStore * functionStore, InteractiveCurveViewRange * graphRange,
|
||||
CurveViewCursor * cursor, ::BannerView * bannerView, View * cursorView);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void setContext(Context * context);
|
||||
void setContext(Poincare::Context * context);
|
||||
void setPreferences(Preferences * preferences);
|
||||
Context * context() const;
|
||||
Poincare::Context * context() const;
|
||||
private:
|
||||
char * label(Axis axis, int index) const override;
|
||||
float evaluateModelWithParameter(Model * expression, float abscissa) const override;
|
||||
char m_xLabels[k_maxNumberOfXLabels][Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_yLabels[k_maxNumberOfYLabels][Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_xLabels[k_maxNumberOfXLabels][Poincare::Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_yLabels[k_maxNumberOfYLabels][Poincare::Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
FunctionStore * m_functionStore;
|
||||
Context * m_context;
|
||||
Poincare::Context * m_context;
|
||||
Preferences * m_preferences;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "../app.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Graph {
|
||||
|
||||
ValuesController::ValuesController(Responder * parentResponder, FunctionStore * functionStore, HeaderViewController * header) :
|
||||
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
FunctionParameterController m_functionParameterController;
|
||||
DerivativeParameterController m_derivativeParameterController;
|
||||
Button m_setIntervalButton;
|
||||
Expression::DisplayMode m_displayModeVersion;
|
||||
Poincare::Expression::DisplayMode m_displayModeVersion;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
InteractiveCurveViewController::InteractiveCurveViewController(Responder * parentResponder, HeaderViewController * header, InteractiveCurveViewRange * interactiveRange, CurveView * curveView) :
|
||||
ViewController(parentResponder),
|
||||
HeaderViewDelegate(header),
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
Button m_rangeButton;
|
||||
Button m_zoomButton;
|
||||
Button m_defaultInitialisationButton;
|
||||
Expression::DisplayMode m_displayModeVersion;
|
||||
Poincare::Expression::DisplayMode m_displayModeVersion;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <assert.h>
|
||||
#include <ion.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
InteractiveCurveViewRange::InteractiveCurveViewRange(CurveViewCursor * cursor, InteractiveCurveViewRangeDelegate * delegate) :
|
||||
MemoizedCurveViewRange(),
|
||||
m_yAuto(true),
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
void panWithVector(float x, float y);
|
||||
void roundAbscissa();
|
||||
void normalize();
|
||||
void setTrigonometric(Expression::AngleUnit angleUnit);
|
||||
void setTrigonometric(Poincare::Expression::AngleUnit angleUnit);
|
||||
virtual void setDefault();
|
||||
void centerAxisAround(Axis axis, float position);
|
||||
void panToMakePointVisible(float x, float y, float topMarginRatio, float rightMarginRatio, float bottomMarginRation, float leftMarginRation);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "preferences.h"
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
Preferences::Preferences() :
|
||||
m_angleUnit(Expression::AngleUnit::Degree),
|
||||
m_displayMode(Expression::DisplayMode::Auto),
|
||||
|
||||
@@ -18,10 +18,10 @@ public:
|
||||
English = 1
|
||||
};
|
||||
Preferences();
|
||||
Expression::AngleUnit angleUnit() const;
|
||||
void setAngleUnit(Expression::AngleUnit angleUnit);
|
||||
Expression::DisplayMode displayMode() const;
|
||||
void setDisplayMode(Expression::DisplayMode displayMode);
|
||||
Poincare::Expression::AngleUnit angleUnit() const;
|
||||
void setAngleUnit(Poincare::Expression::AngleUnit angleUnit);
|
||||
Poincare::Expression::DisplayMode displayMode() const;
|
||||
void setDisplayMode(Poincare::Expression::DisplayMode displayMode);
|
||||
NumberType numberType() const;
|
||||
void setNumberType(NumberType numberType);
|
||||
ComplexFormat complexFormat() const;
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
Language language() const;
|
||||
void setLanguage(Language language);
|
||||
private:
|
||||
Expression::AngleUnit m_angleUnit;
|
||||
Expression::DisplayMode m_displayMode;
|
||||
Poincare::Expression::AngleUnit m_angleUnit;
|
||||
Poincare::Expression::DisplayMode m_displayMode;
|
||||
NumberType m_numberType;
|
||||
ComplexFormat m_complexFormat;
|
||||
Language m_language;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "calculation/finite_integral_calculation.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Probability {
|
||||
|
||||
CalculationController::ContentView::ContentView(Responder * parentResponder, CalculationController * calculationController, Calculation * calculation) :
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
protected:
|
||||
char * label(Axis axis, int index) const override;
|
||||
private:
|
||||
char m_labels[k_maxNumberOfXLabels][Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_labels[k_maxNumberOfXLabels][Poincare::Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
float evaluateModelWithParameter(Model * law, float abscissa) const override;
|
||||
Law * m_law;
|
||||
Calculation * m_calculation;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "apps_container.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
RangeParameterController::RangeParameterController(Responder * parentResponder, InteractiveCurveViewRange * interactiveRange) :
|
||||
FloatParameterController(parentResponder),
|
||||
m_interactiveRange(interactiveRange),
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare.h>
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Regression {
|
||||
|
||||
CalculationController::CalculationController(Responder * parentResponder, HeaderViewController * headerViewController, Store * store) :
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "graph_controller.h"
|
||||
#include "../apps_container.h"
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Regression {
|
||||
|
||||
GraphController::GraphController(Responder * parentResponder, HeaderViewController * headerViewController, Store * store) :
|
||||
|
||||
@@ -16,8 +16,8 @@ private:
|
||||
char * label(Axis axis, int index) const override;
|
||||
float evaluateModelWithParameter(Model * curve, float t) const override;
|
||||
Store * m_store;
|
||||
char m_xLabels[k_maxNumberOfXLabels][Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_yLabels[k_maxNumberOfYLabels][Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_xLabels[k_maxNumberOfXLabels][Poincare::Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_yLabels[k_maxNumberOfYLabels][Poincare::Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "../../poincare/src/layout/string_layout.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Regression {
|
||||
|
||||
StoreController::StoreController(Responder * parentResponder, Store * store, HeaderViewController * header) :
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
private:
|
||||
TableViewCell * titleCells(int index) override;
|
||||
EvenOddExpressionCell m_titleCells[k_numberOfTitleCells];
|
||||
ExpressionLayout * m_titleLayout[2];
|
||||
Poincare::ExpressionLayout * m_titleLayout[2];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "../apps_container.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Settings {
|
||||
|
||||
SubController::SubController(Responder * parentResponder, Preferences * preferences) :
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "../apps_container.h"
|
||||
#include <math.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Statistics {
|
||||
|
||||
BoxController::BoxController(Responder * parentResponder, HeaderViewController * headerViewController, Store * store) :
|
||||
|
||||
@@ -24,7 +24,7 @@ private:
|
||||
BoxBannerView m_boxBannerView;
|
||||
BoxView m_view;
|
||||
Store * m_store;
|
||||
Expression::DisplayMode m_displayModeVersion;
|
||||
Poincare::Expression::DisplayMode m_displayModeVersion;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ private:
|
||||
char * label(Axis axis, int index) const override;
|
||||
Store * m_store;
|
||||
BoxRange m_boxRange;
|
||||
char m_labels[k_maxNumberOfXLabels][Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_labels[k_maxNumberOfXLabels][Poincare::Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
Quantile m_selectedQuantile;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare.h>
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Statistics {
|
||||
|
||||
CalculationController::CalculationController(Responder * parentResponder, HeaderViewController * headerViewController, Store * store) :
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
namespace Statistics {
|
||||
|
||||
HistogramController::HistogramController(Responder * parentResponder, HeaderViewController * headerViewController, Store * store) :
|
||||
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
uint32_t m_rangeVersion;
|
||||
int m_selectedBarIndex;
|
||||
HistogramParameterController m_histogramParameterController;
|
||||
Expression::DisplayMode m_displayModeVersion;
|
||||
Poincare::Expression::DisplayMode m_displayModeVersion;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ public:
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void setFunction(Function * function);
|
||||
private:
|
||||
float parameterAtIndex(int index) override;
|
||||
void setParameterAtIndex(int parameterIndex, float f) override;
|
||||
|
||||
@@ -18,7 +18,7 @@ private:
|
||||
char * label(Axis axis, int index) const override;
|
||||
float evaluateModelWithParameter(Model * curve, float t) const override;
|
||||
Store * m_store;
|
||||
char m_labels[k_maxNumberOfXLabels][Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
char m_labels[k_maxNumberOfXLabels][Poincare::Complex::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
float m_highlightedBarStart;
|
||||
float m_highlightedBarEnd;
|
||||
};
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "constant.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
StoreController::StoreController(Responder * parentResponder, FloatPairStore * store, HeaderViewController * header) :
|
||||
EditableCellTableViewController(parentResponder, Metric::TopMargin, Metric::RightMargin, Metric::BottomMargin, Metric::LeftMargin),
|
||||
HeaderViewDelegate(header),
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "text_field_delegate_app.h"
|
||||
#include "apps_container.h"
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
TextFieldDelegateApp::TextFieldDelegateApp(Container * container, ViewController * rootViewController, const char * name,
|
||||
const char * upperName, const Image * icon) :
|
||||
::App(container, rootViewController, name, upperName, icon),
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
class TextFieldDelegateApp : public ::App, public ExpressionTextFieldDelegate {
|
||||
public:
|
||||
TextFieldDelegateApp(Container * container, ViewController * rootViewController, const char * name = nullptr, const char * upperName = nullptr, const Image * icon = nullptr);
|
||||
virtual Context * localContext() override;
|
||||
virtual Poincare::Context * localContext() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@ extern "C" {
|
||||
#include <assert.h>
|
||||
}
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
TitleBarView::TitleBarView() :
|
||||
View(),
|
||||
m_titleView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorWhite, Palette::YellowDark),
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "constant.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
/* ContentViewController */
|
||||
|
||||
VariableBoxController::ContentViewController::ContentViewController(Responder * parentResponder, Context * context) :
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
class VariableBoxController : public StackViewController {
|
||||
public:
|
||||
VariableBoxController(Context * context);
|
||||
VariableBoxController(Poincare::Context * context);
|
||||
void didBecomeFirstResponder() override;
|
||||
void setTextFieldCaller(TextField * textField);
|
||||
private:
|
||||
class ContentViewController : public ViewController, public ListViewDataSource {
|
||||
public:
|
||||
ContentViewController(Responder * parentResponder, Context * context);
|
||||
ContentViewController(Responder * parentResponder, Poincare::Context * context);
|
||||
View * view() override;
|
||||
const char * title() const override;
|
||||
void didBecomeFirstResponder() override;
|
||||
@@ -41,9 +41,9 @@ private:
|
||||
Page pageAtIndex(int index);
|
||||
void putLabelAtIndexInBuffer(int index, char * buffer);
|
||||
const char * nodeLabelAtIndex(int index);
|
||||
const Expression * expressionForIndex(int index);
|
||||
const Poincare::Expression * expressionForIndex(int index);
|
||||
|
||||
Context * m_context;
|
||||
Poincare::Context * m_context;
|
||||
TextField * m_textFieldCaller;
|
||||
int m_firstSelectedRow;
|
||||
int m_previousSelectedRow;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "variable_box_leaf_cell.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Poincare;
|
||||
|
||||
VariableBoxLeafCell::VariableBoxLeafCell() :
|
||||
TableViewCell(),
|
||||
m_labelView(BufferTextView(KDText::FontSize::Small, 0, 0.5, KDColorBlack, KDColorWhite)),
|
||||
|
||||
@@ -10,7 +10,7 @@ public:
|
||||
void reloadCell() override;
|
||||
void setLabel(const char * text);
|
||||
void setSubtitle(const char * text);
|
||||
void setExpression(ExpressionLayout * expressionLayout);
|
||||
void setExpression(Poincare::ExpressionLayout * expressionLayout);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
private:
|
||||
int numberOfSubviews() const override;
|
||||
|
||||
@@ -9,7 +9,7 @@ public:
|
||||
EvenOddExpressionCell(float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void reloadCell() override;
|
||||
void setExpression(ExpressionLayout * expressionLayout);
|
||||
void setExpression(Poincare::ExpressionLayout * expressionLayout);
|
||||
void setBackgroundColor(KDColor backgroundColor);
|
||||
void setTextColor(KDColor textColor);
|
||||
KDSize minimalSizeForOptimalDisplay() override;
|
||||
|
||||
@@ -15,14 +15,14 @@ class ExpressionView : public View {
|
||||
public:
|
||||
ExpressionView(float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void setExpression(ExpressionLayout * expressionLayout);
|
||||
void setExpression(Poincare::ExpressionLayout * expressionLayout);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void setBackgroundColor(KDColor backgroundColor);
|
||||
void setTextColor(KDColor textColor);
|
||||
void setAlignment(float horizontalAlignment, float verticalAlignment);
|
||||
KDSize minimalSizeForOptimalDisplay() override;
|
||||
private:
|
||||
ExpressionLayout * m_expressionLayout;
|
||||
Poincare::ExpressionLayout * m_expressionLayout;
|
||||
float m_horizontalAlignment;
|
||||
float m_verticalAlignment;
|
||||
KDColor m_textColor;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <escher/even_odd_expression_cell.h>
|
||||
#include <assert.h>
|
||||
using namespace Poincare;
|
||||
|
||||
EvenOddExpressionCell::EvenOddExpressionCell(float horizontalAlignment, float verticalAlignment,
|
||||
KDColor textColor, KDColor backgroundColor) :
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <escher/expression_view.h>
|
||||
using namespace Poincare;
|
||||
|
||||
ExpressionView::ExpressionView(float horizontalAlignment, float verticalAlignment,
|
||||
KDColor textColor, KDColor backgroundColor) :
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class AbsoluteValue : public Function {
|
||||
public:
|
||||
AbsoluteValue();
|
||||
@@ -14,4 +16,6 @@ public:
|
||||
ExpressionLayout * createLayout(DisplayMode displayMode = DisplayMode::Auto) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/binary_operation.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Addition : public BinaryOperation {
|
||||
using BinaryOperation::BinaryOperation;
|
||||
public:
|
||||
@@ -16,4 +18,6 @@ private:
|
||||
Expression * evaluateOnComplex(Complex * c, Complex * d, Context& context, AngleUnit angleUnit) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <poincare/matrix.h>
|
||||
#include <poincare/complex.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class BinaryOperation : public Expression {
|
||||
public:
|
||||
BinaryOperation(Expression ** operands, bool cloneOperands = true);
|
||||
@@ -21,4 +23,6 @@ protected:
|
||||
virtual Expression * evaluateOnMatrices(Matrix * m, Matrix * n, Context& context, AngleUnit angleUnit) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/leaf_expression.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Complex : public LeafExpression {
|
||||
public:
|
||||
Complex(float a, float b = 0.0f, bool polar = false);
|
||||
@@ -63,4 +65,6 @@ private:
|
||||
int m_numberOfSignificantDigits;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
#include <poincare/expression.h>
|
||||
#include <poincare/symbol.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Context {
|
||||
public:
|
||||
virtual const Expression * expressionForSymbol(const Symbol * symbol) = 0;
|
||||
virtual void setExpressionForSymbolName(Expression * expression, const Symbol * symbol) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Cosine : public Function {
|
||||
public:
|
||||
Cosine();
|
||||
@@ -13,4 +15,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare/function.h>
|
||||
#include <poincare/variable_context.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Derivative : public Function {
|
||||
public:
|
||||
Derivative();
|
||||
@@ -19,4 +21,6 @@ private:
|
||||
constexpr static float k_rateStepSize = 1.4f;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare/expression_layout.h>
|
||||
#include <kandinsky.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Context;
|
||||
|
||||
class Expression {
|
||||
@@ -98,4 +100,6 @@ class Expression {
|
||||
bool * operandMatched, int leftToMatch) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <kandinsky.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class ExpressionLayout {
|
||||
public:
|
||||
ExpressionLayout();
|
||||
@@ -27,4 +29,6 @@ class ExpressionLayout {
|
||||
KDRect m_frame;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/binary_operation.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Fraction : public BinaryOperation {
|
||||
using BinaryOperation::BinaryOperation;
|
||||
public:
|
||||
@@ -17,4 +19,6 @@ private:
|
||||
Expression * evaluateOnMatrices(Matrix * m, Matrix * n, Context& context, AngleUnit angleUnit) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare/expression.h>
|
||||
#include <poincare/list_data.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
/* The Function class represents the built-in math functions such as cos, sin,
|
||||
* tan, log, etc... */
|
||||
|
||||
@@ -24,4 +26,6 @@ protected:
|
||||
const char * m_name;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare/context.h>
|
||||
#include <poincare/complex.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Integer;
|
||||
|
||||
/* The global context only stores symbols A-Z, L1-L9 and M1-M9 */
|
||||
@@ -26,4 +28,6 @@ private:
|
||||
Complex m_e;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class HyperbolicCosine : public Function {
|
||||
public:
|
||||
HyperbolicCosine();
|
||||
@@ -13,4 +15,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class HyperbolicSine : public Function {
|
||||
public:
|
||||
HyperbolicSine();
|
||||
@@ -13,4 +15,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class HyperbolicTangent : public Function {
|
||||
public:
|
||||
HyperbolicTangent();
|
||||
@@ -13,4 +15,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,8 @@ typedef int32_t native_int_t;
|
||||
typedef uint32_t native_uint_t;
|
||||
typedef uint64_t double_native_uint_t;
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Integer : public LeafExpression {
|
||||
public:
|
||||
Integer(native_int_t i);
|
||||
@@ -60,4 +62,6 @@ public:
|
||||
Integer m_remainder;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare/function.h>
|
||||
#include <poincare/variable_context.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Integral : public Function {
|
||||
public:
|
||||
Integral();
|
||||
@@ -28,4 +30,6 @@ private:
|
||||
float functionValueAtAbscissa(float x, VariableContext xcontext, AngleUnit angleUnit) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/expression.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class LeafExpression : public Expression {
|
||||
public:
|
||||
const Expression * operand(int i) const override;
|
||||
@@ -11,4 +13,6 @@ class LeafExpression : public Expression {
|
||||
int numberOfOperands, bool cloneOperands = true) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/expression.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class ListData {
|
||||
public:
|
||||
ListData(Expression * operand);
|
||||
@@ -15,4 +17,6 @@ class ListData {
|
||||
Expression ** m_operands;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Logarithm : public Function {
|
||||
public:
|
||||
Logarithm();
|
||||
@@ -13,4 +15,6 @@ public:
|
||||
ExpressionLayout * createLayout(DisplayMode displayMode = DisplayMode::Auto) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <poincare/complex.h>
|
||||
#include <poincare/matrix_data.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Matrix : public Expression {
|
||||
public:
|
||||
Matrix(MatrixData * matrixData);
|
||||
@@ -29,4 +31,6 @@ class Matrix : public Expression {
|
||||
static Complex * defaultExpression();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <poincare/complex.h>
|
||||
#include <poincare/expression.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class MatrixData {
|
||||
public:
|
||||
MatrixData(ListData * listData);
|
||||
@@ -21,4 +23,6 @@ class MatrixData {
|
||||
static Complex * defaultExpression();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/binary_operation.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Multiplication : public BinaryOperation {
|
||||
using BinaryOperation::BinaryOperation;
|
||||
public:
|
||||
@@ -16,4 +18,6 @@ private:
|
||||
Expression * evaluateOnMatrices(Matrix * m, Matrix * n, Context& context, AngleUnit angleUnit) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class NaperianLogarithm : public Function {
|
||||
public:
|
||||
NaperianLogarithm();
|
||||
@@ -12,4 +14,6 @@ public:
|
||||
int numberOfOperands, bool cloneOperands = true) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class NthRoot : public Function {
|
||||
public:
|
||||
NthRoot();
|
||||
@@ -14,4 +16,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare/expression.h>
|
||||
#include <poincare/matrix.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Opposite : public Expression {
|
||||
public:
|
||||
Opposite(Expression * operand, bool cloneOperands = true);
|
||||
@@ -22,4 +24,6 @@ class Opposite : public Expression {
|
||||
Expression * evaluateOnMatrix(Matrix * m, Context& context, AngleUnit angleUnit) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/expression.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Parenthesis : public Expression {
|
||||
public:
|
||||
Parenthesis(Expression * operand, bool cloneOperands = true);
|
||||
@@ -20,4 +22,6 @@ class Parenthesis : public Expression {
|
||||
Expression * m_operand;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/binary_operation.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Power : public BinaryOperation {
|
||||
using BinaryOperation::BinaryOperation;
|
||||
public:
|
||||
@@ -18,4 +20,6 @@ private:
|
||||
Expression * evaluateOnMatrices(Matrix * m, Matrix * n, Context& context, AngleUnit angleUnit) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Product : public Function {
|
||||
public:
|
||||
Product();
|
||||
@@ -14,4 +16,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Sine : public Function {
|
||||
public:
|
||||
Sine();
|
||||
@@ -13,4 +15,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class SquareRoot : public Function {
|
||||
public:
|
||||
SquareRoot();
|
||||
@@ -14,4 +16,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/binary_operation.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Subtraction : public BinaryOperation {
|
||||
using BinaryOperation::BinaryOperation;
|
||||
public:
|
||||
@@ -16,4 +18,6 @@ private:
|
||||
Expression * evaluateOnComplexAndMatrix(Complex * c, Matrix * m, Context& context, AngleUnit angleUnit) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Sum : public Function {
|
||||
public:
|
||||
Sum();
|
||||
@@ -14,4 +16,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/leaf_expression.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Symbol : public LeafExpression {
|
||||
public:
|
||||
enum SpecialSymbols : char {
|
||||
@@ -20,4 +22,6 @@ public:
|
||||
const char m_name;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <poincare/function.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class Tangent : public Function {
|
||||
public:
|
||||
Tangent();
|
||||
@@ -13,4 +15,6 @@ public:
|
||||
Expression * evaluate(Context& context, AngleUnit angleUnit = AngleUnit::Radian) const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <poincare/context.h>
|
||||
#include <poincare/complex.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class VariableContext : public Context {
|
||||
public:
|
||||
VariableContext(char name, Context * parentContext = nullptr);
|
||||
@@ -15,4 +17,6 @@ private:
|
||||
Context * m_parentContext;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -7,6 +7,8 @@ extern "C" {
|
||||
#include <math.h>
|
||||
}
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
AbsoluteValue::AbsoluteValue() :
|
||||
Function("abs")
|
||||
{
|
||||
@@ -53,4 +55,6 @@ Expression * AbsoluteValue::evaluate(Context& context, AngleUnit angleUnit) cons
|
||||
|
||||
ExpressionLayout * AbsoluteValue::createLayout(DisplayMode displayMode) const {
|
||||
return new AbsoluteValueLayout(m_args[0]->createLayout(displayMode));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user