mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
The solutions of equations that need numerical approximations to be solved are now computed base on the undeveloped equation (instead of fully the expended one used to identify polynomials) This allow (x-10)^7=0 to yield x=10 as result (9.95 before) Change-Id: Ia8acbe57a9cfebf0b5016e9c896d21c8ddac7a64
49 lines
1.9 KiB
C++
49 lines
1.9 KiB
C++
#ifndef SOLVER_INTERVAL_CONTROLLER_H
|
|
#define SOLVER_INTERVAL_CONTROLLER_H
|
|
|
|
#include <escher.h>
|
|
#include "equation_store.h"
|
|
#include "../shared/float_parameter_controller.h"
|
|
|
|
namespace Solver {
|
|
|
|
class IntervalController : public Shared::FloatParameterController<double> {
|
|
public:
|
|
IntervalController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, EquationStore * equationStore);
|
|
const char * title() override;
|
|
View * view() override { return &m_contentView; }
|
|
TELEMETRY_ID("Interval");
|
|
int numberOfRows() const override;
|
|
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
|
void setShouldReplaceFuncionsButNotSymbols(bool shouldReplaceFunctionsButNotSymbols) { m_shouldReplaceFunctionsButNotSymbols = shouldReplaceFunctionsButNotSymbols; }
|
|
private:
|
|
HighlightCell * reusableParameterCell(int index, int type) override;
|
|
int reusableParameterCellCount(int type) override;
|
|
void buttonAction() override;
|
|
double parameterAtIndex(int index) override;
|
|
bool setParameterAtIndex(int parameterIndex, double f) override;
|
|
bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
|
|
class ContentView : public View {
|
|
public:
|
|
ContentView(SelectableTableView * selectableTableView);
|
|
void drawRect(KDContext * ctx, KDRect rect) const override;
|
|
private:
|
|
constexpr static KDCoordinate k_topMargin = 50;
|
|
int numberOfSubviews() const override;
|
|
View * subviewAtIndex(int index) override;
|
|
void layoutSubviews(bool force = false) override;
|
|
MessageTextView m_instructions0;
|
|
MessageTextView m_instructions1;
|
|
SelectableTableView * m_selectableTableView;
|
|
};
|
|
ContentView m_contentView;
|
|
constexpr static int k_maxNumberOfCells = 2;
|
|
MessageTableCellWithEditableText m_intervalCell[k_maxNumberOfCells];
|
|
EquationStore * m_equationStore;
|
|
bool m_shouldReplaceFunctionsButNotSymbols;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|