How do I create symbolic variables/functions involving vectors using JScience? Creating float variables is easy:
Variable<Float64> varX = Variable.local<Float64>("x");
How can I do the same for a vector? Once I have a vector variable, how do I create
a Polynomial
involving that vector (say, by using Euclidean distance)?
Given a
Vector<Float64>
of coefficients, you can construct aPolynomial<Float64>
as shown below. As shown here, the highest order coefficient is first for convenience in applying Horner's scheme.Typical usage:
Console: