Implement equals for EquationsSystem as ordered parameter equality
This commit is contained in:
parent
53e2416426
commit
c2dc02c0e1
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user