public static void testSum()
{
try ( HypergeometricPolynomial F = new HypergeometricPolynomial(2,
1))
{
F.α.set(-6, 2.5);
F.β.set(1);
RealPolynomial polynomial = F.evaluate(null, 128, new RealPolynomial());
assertEquals("1 - 15x + 65.625x² - 131.25x³ + 135.3515625x⁴ - 70.3828125x⁵ + 14.6630859375x⁶",
polynomial.toString());
double val = polynomial.eval(2.3);
assertEquals(145.01289685058583, val);
}
}
and the HypergeometricPolynomial itself is mostly just management for the
variables and main implementation is generated dynamically by the expression compiler
public HypergeometricPolynomial(int p, int q)
{
context = new Context(this.p = new Integer(p,"p"),
this.q = new Integer(q,"q"),
α = Real.newVector(p).setName("α"),
β = Real.newVector(q).setName("β"));
context.registerVariable("N", N = new Integer());
F =
RealPolynomialNullaryFunction.express("F",
"Σn➔zⁿ*∏k➔α[k]₍ₙ₎{k=1…p}/(n!*∏k➔β[k]₍ₙ₎{k=1…q}){n=0…N}",
context);
}
--
---
You received this message because you are subscribed to the Google Groups "flint-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flint-devel...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/flint-devel/2912741a-b1ec-4e6b-9ecc-252efa9d2118n%40googlegroups.com.