Implement equals for EquationsSystem as ordered parameter equality

This commit is contained in:
Riccardo Azzolini 2018-10-16 19:33:44 +02:00
parent 53e2416426
commit c2dc02c0e1

View File

@ -23,6 +23,23 @@ public class EquationsSystem extends FunctionDynamic {
super(root, value);
}
@Override
public boolean equals(final Object o) {
if (o instanceof EquationsSystem) {
final FunctionDynamic f = (FunctionDynamic) o;
if (functions.length != f.getParametersLength()) {
return false;
}
for (int i = 0; i < functions.length; i++) {
if (!functions[i].equals(f.getParameter(i))) {
return false;
}
}
return true;
}
return false;
}
@Override
public EquationsSystem clone() {
Function[] newFuncs = functions.clone();