Убраны лишние скобки для построения представлений функций
This commit is contained in:
2
main.cpp
2
main.cpp
@@ -238,7 +238,7 @@ vector<MyFunction> get_linear_combinations(const vector<MyFunction> &linear_comp
|
||||
}
|
||||
|
||||
string preprocess_factor(string factor) {
|
||||
if ( factor.find("+") != string::npos and factor.find("*") == string::npos )
|
||||
if ( factor.find("+") != string::npos and factor.find("*") == string::npos and factor[0] !='(' and factor[factor.size() - 1] != ')')
|
||||
return "(" + factor + ")";
|
||||
return factor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user