Plotter
This commit is contained in:
@@ -1,17 +1,40 @@
|
||||
package jscl.math;
|
||||
|
||||
import jscl.math.function.Constant;
|
||||
import jscl.math.function.IConstant;
|
||||
import jscl.mathml.MathML;
|
||||
import jscl.text.ParserUtils;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Set;
|
||||
import org.solovyev.common.math.MathRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.math.BigInteger;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class Generic implements Arithmetic<Generic>, Comparable {
|
||||
|
||||
@Nonnull
|
||||
public Set<Constant> getUndefinedConstants(@Nonnull MathRegistry<IConstant> constantsRegistry) {
|
||||
final Set<Constant> result = new HashSet<>();
|
||||
|
||||
for (Constant expressionConstant : getConstants()) {
|
||||
final IConstant registryConstant = constantsRegistry.get(expressionConstant.getName());
|
||||
if (registryConstant == null) {
|
||||
continue;
|
||||
}
|
||||
if (registryConstant.isSystem()) {
|
||||
continue;
|
||||
}
|
||||
if(registryConstant.isDefined()) {
|
||||
continue;
|
||||
}
|
||||
result.add(expressionConstant);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public BigInteger toBigInteger() {
|
||||
return null;
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ public class CustomFunction extends Function implements IFunction {
|
||||
private CustomFunction(@Nonnull String name,
|
||||
@Nonnull List<String> parameterNames,
|
||||
@Nonnull String content,
|
||||
@Nullable String description) {
|
||||
@Nullable String description) throws CustomFunctionCalculationException {
|
||||
super(name, new Generic[parameterNames.size()]);
|
||||
this.parameterNames = parameterNames;
|
||||
try {
|
||||
@@ -321,7 +321,7 @@ public class CustomFunction extends Function implements IFunction {
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public CustomFunction create() {
|
||||
public CustomFunction create() throws CustomFunctionCalculationException {
|
||||
final CustomFunction customFunction = new CustomFunction(name, parameterNames, prepareContent(content), description);
|
||||
customFunction.setSystem(system);
|
||||
if (id != null) {
|
||||
|
Reference in New Issue
Block a user