Skip to content

Commit

Permalink
https://github.com/crowlogic/arb4j/issues/253
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlogic committed Nov 28, 2024
1 parent 5a16fd0 commit 449da81
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ coDomain: arb.Real
context:
input:
- arb.Real
- '1'
- '3'
domain: arb.Real
expression: √(π)*Γ(3/4)*J(1/4, s)*2^(1/4)/s^(1/4)
expression: √(π)*Γ(3/4)*J(1/4, |s|)*2^(1/4)/|s|^(1/4)
function: arb.functions.real.RealFunction
...
11 changes: 9 additions & 2 deletions src/main/java/arb/expressions/nodes/VariableNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
import arb.expressions.nodes.binary.MultiplicationNode;
import arb.expressions.nodes.nary.ProductNode;
import arb.functions.Function;
import arb.functions.real.RealFunction;

/**
* This class represents a {@link VariableNode} node within an
* {@link Expression} by extending the {@link Node} class to provide additional
* functionality for managing {@link VariableReference}s, those registered in the
* {@link Context}, and/or those which are inputs to the expression, or any
* functionality for managing {@link VariableReference}s, those registered in
* the {@link Context}, and/or those which are inputs to the expression, or any
* upstream expression (in the case of nested-expressions such as for
* {@link ProductNode}s
*
Expand Down Expand Up @@ -245,7 +246,9 @@ private void generateReference(MethodVisitor mv, Class<?> neededType)
}
else if (isIndeterminate)
{

generateReferenceToIndeterminantVariable(mv);

}
else
{
Expand Down Expand Up @@ -588,6 +591,10 @@ else if (ascendentInput)
{
returnType = reference.type();
}
if (returnType.equals(Object.class))
{
returnType = expression.coDomainType;
}
assert returnType != null : "returnType is null for " + this;
assert returnType != Object.class : "TODO: tried to return "
+ returnType
Expand Down
2 changes: 1 addition & 1 deletion todoList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ TODO: builtin sykbols for the classical orthogonal polynomials
"limit" is null at arb4j/arb.expressions.nodes.IntegralNode.evaluateIndefiniteIntegralAt(IntegralNode.java:217)
todo: mouse wheel zooms control or whole scene
expr compiler: fractional derivatices
java.lang.AssertionError: TODO: tried to return class java.lang.Object for x which is part of DerivativeNode[operand=(a*x+(b*x^2))+(c*x^3), variable=x, derivative=((0*x+a*1)+((0*x^2)+(b*(2*(x^(2-1))))))+((0*x^3)+(c*(3*(x^(3-1)))))]at arb4j/arb.expressions.nodes.VariableNode.type(VariableNode.java:592)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.type(BinaryOperationNode.java:363)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.type(BinaryOperationNode.java:362)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.type(BinaryOperationNode.java:362)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:190)at arb4j/arb.expressions.nodes.DerivativeNode.generate(DerivativeNode.java:141)at arb4j/arb.expressions.Expression.generateEvaluationMethod(Expression.java:940)at arb4j/arb.expressions.Expression.generate(Expression.java:787)at arb4j/arb.expressions.Expression.defineClass(Expression.java:570)at arb4j/arb.expressions.Expression.getInstance(Expression.java:1218)at arb4j/arb.expressions.Expression.instantiate(Expression.java:1367)at arb4j/arb.functions.Function.instantiate(Function.java:126)at arb4j/arb.functions.polynomials.RealPolynomialNullaryFunction.express(RealPolynomialNullaryFunction.java:35)at arb4j/arb.functions.polynomials.RealPolynomialNullaryFunction.express(RealPolynomialNullaryFunction.java:47)at arb4j/arb.expressions.ExpressionTest.testRealPolynomialDerivative(ExpressionTest.java:83)at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)at java.base/java.lang.reflect.Method.invoke(Method.java:580)at [email protected]/junit.framework.TestCase.runTest(TestCase.java:177)at [email protected]/junit.framework.TestCase.runBare(TestCase.java:142)at [email protected]/junit.framework.TestResult$1.protect(TestResult.java:122)at [email protected]/junit.framework.TestResult.runProtected(TestResult.java:142)at [email protected]/junit.framework.TestResult.run(TestResult.java:125)at [email protected]/junit.framework.TestCase.run(TestCase.java:130)at [email protected]/junit.framework.TestSuite.runTest(TestSuite.java:241)at [email protected]/junit.framework.TestSuite.run(TestSuite.java:236)at [email protected]/org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:530)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:758)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:453)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:211)
java.lang.AssertionError: dont generate a variable for the Object typeat arb4j/arb.expressions.Expression.newIntermediateVariable(Expression.java:1516)at arb4j/arb.expressions.Expression.newIntermediateVariable(Expression.java:1497)at arb4j/arb.expressions.Expression.newIntermediateVariable(Expression.java:1492)at arb4j/arb.expressions.Expression.allocateIntermediateVariable(Expression.java:386)at arb4j/arb.expressions.nodes.VariableNode.generateReferenceToIndeterminantVariable(VariableNode.java:289)at arb4j/arb.expressions.nodes.VariableNode.generateReference(VariableNode.java:250)at arb4j/arb.expressions.nodes.VariableNode.generate(VariableNode.java:201)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:192)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:190)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:190)at arb4j/arb.expressions.nodes.binary.BinaryOperationNode.generate(BinaryOperationNode.java:190)at arb4j/arb.expressions.nodes.DerivativeNode.generate(DerivativeNode.java:141)at arb4j/arb.expressions.Expression.generateEvaluationMethod(Expression.java:940)at arb4j/arb.expressions.Expression.generate(Expression.java:787)at arb4j/arb.expressions.Expression.defineClass(Expression.java:570)at arb4j/arb.expressions.Expression.getInstance(Expression.java:1218)at arb4j/arb.expressions.Expression.instantiate(Expression.java:1367)at arb4j/arb.functions.Function.instantiate(Function.java:126)at arb4j/arb.functions.polynomials.RealPolynomialNullaryFunction.express(RealPolynomialNullaryFunction.java:35)at arb4j/arb.functions.polynomials.RealPolynomialNullaryFunction.express(RealPolynomialNullaryFunction.java:47)at arb4j/arb.expressions.ExpressionTest.testRealPolynomialDerivative(ExpressionTest.java:83)at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)at java.base/java.lang.reflect.Method.invoke(Method.java:580)at [email protected]/junit.framework.TestCase.runTest(TestCase.java:177)at [email protected]/junit.framework.TestCase.runBare(TestCase.java:142)at [email protected]/junit.framework.TestResult$1.protect(TestResult.java:122)at [email protected]/junit.framework.TestResult.runProtected(TestResult.java:142)at [email protected]/junit.framework.TestResult.run(TestResult.java:125)at [email protected]/junit.framework.TestCase.run(TestCase.java:130)at [email protected]/junit.framework.TestSuite.runTest(TestSuite.java:241)at [email protected]/junit.framework.TestSuite.run(TestSuite.java:236)at [email protected]/org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:90)at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:530)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:758)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:453)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:211)

0 comments on commit 449da81

Please sign in to comment.