This commit is contained in:
serso
2016-02-28 13:08:10 +01:00
parent 4070de7693
commit f7b66673a5
16 changed files with 131 additions and 748 deletions

View File

@@ -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;
}

View File

@@ -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) {