mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Template for double
Change-Id: I7404bd5cefc9ef78a5dbd572c3874a557cded28e
This commit is contained in:
@@ -52,7 +52,7 @@ void Calculation::reset() {
|
||||
void Calculation::setContent(const char * c, Context * context) {
|
||||
reset();
|
||||
strlcpy(m_inputText, c, sizeof(m_inputText));
|
||||
Expression * evaluation = input()->evaluate(*context);
|
||||
Evaluation<double> * evaluation = input()->evaluate<double>(*context);
|
||||
evaluation->writeTextInBuffer(m_outputText, sizeof(m_outputText));
|
||||
delete evaluation;
|
||||
}
|
||||
@@ -79,15 +79,15 @@ ExpressionLayout * Calculation::inputLayout() {
|
||||
return m_inputLayout;
|
||||
}
|
||||
|
||||
Evaluation * Calculation::output(Context * context) {
|
||||
Evaluation<double> * Calculation::output(Context * context) {
|
||||
if (m_output == nullptr) {
|
||||
/* To ensure that the expression 'm_output' is a matrix or a complex, we
|
||||
* call 'evaluate'. */
|
||||
Expression * exp = Expression::parse(m_outputText);
|
||||
if (exp != nullptr) {
|
||||
m_output = exp->evaluate(*context);
|
||||
m_output = exp->evaluate<double>(*context);
|
||||
} else {
|
||||
m_output = new Complex(Complex::Float(NAN));
|
||||
m_output = new Complex<double>(Complex<double>::Float(NAN));
|
||||
}
|
||||
}
|
||||
return m_output;
|
||||
|
||||
Reference in New Issue
Block a user