mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-26 17:20:53 +01:00
[poincare] Cast matrix of char before calling getVariables
This commit is contained in:
@@ -268,7 +268,7 @@ bool StoreController::privateFillColumnWithFormula(Expression formula, Expressio
|
||||
char variables[Expression::k_maxNumberOfVariables][k_maxSizeOfStoreSymbols];
|
||||
variables[0][0] = 0;
|
||||
AppsContainer * appsContainer = ((TextFieldDelegateApp *)app())->container();
|
||||
int nbOfVariables = formula.getVariables(*(appsContainer->globalContext()), isVariable, variables, k_maxSizeOfStoreSymbols);
|
||||
int nbOfVariables = formula.getVariables(*(appsContainer->globalContext()), isVariable, (char **)variables, k_maxSizeOfStoreSymbols);
|
||||
assert(nbOfVariables >= 0);
|
||||
int numberOfValuesToCompute = -1;
|
||||
int index = 0;
|
||||
|
||||
@@ -107,7 +107,7 @@ EquationStore::Error EquationStore::exactSolve(Poincare::Context * context) {
|
||||
if (e.isUninitialized() || e.type() == ExpressionNode::Type::Undefined) {
|
||||
return Error::EquationUndefined;
|
||||
}
|
||||
numberOfVariables = definedModelAtIndex(i)->standardForm(context).getVariables(*context, Symbol::isVariableSymbol, m_variables, Equation::k_maxVariableSize);
|
||||
numberOfVariables = definedModelAtIndex(i)->standardForm(context).getVariables(*context, Symbol::isVariableSymbol, (char **)m_variables, Equation::k_maxVariableSize);
|
||||
if (numberOfVariables == -1) {
|
||||
return Error::TooManyVariables;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ EquationStore::Error EquationStore::exactSolve(Poincare::Context * context) {
|
||||
bool isLinear = true; // Invalid the linear system if one equation is non-linear
|
||||
Preferences * preferences = Preferences::sharedPreferences();
|
||||
for (int i = 0; i < numberOfDefinedModels(); i++) {
|
||||
isLinear = isLinear && definedModelAtIndex(i)->standardForm(context).getLinearCoefficients(m_variables, coefficients[i], &constants[i], *context, preferences->angleUnit());
|
||||
isLinear = isLinear && definedModelAtIndex(i)->standardForm(context).getLinearCoefficients((char **)m_variables, coefficients[i], &constants[i], *context, preferences->angleUnit());
|
||||
if (!isLinear) {
|
||||
// TODO: should we clean pool allocated memory if the system is not linear
|
||||
#if 0
|
||||
|
||||
Reference in New Issue
Block a user