Hi.
[When posting to this list, you should always indicate to which Commons
project the message is targetted. e.g. in this case by adding a "[Math]"
prefix to the subject line.]
> I could use some help with this issue. I am not an expert with Java
> programming. Maybe this should be obvious, so excuse me if this is trivial.
>
> I have the code working to pass the starting point array to the class
> implementing MultivariateFunction. An example of the class code I am
> working with is below. I am trying to pass the coefficient ThreeYrRet
> arraylist, but when I attempt to add the arraylist to public double
> value(...., I get the message that the class *Portfolio is not abstract and
> does not override abstract method value(double[]) in
> org.apache.commons.math3.analysis.MultivariateFunction*. Making the class
> abstract does not work, as well as implementing abstract methods.
>
> Your help on this is greatly appreciated.
>
> public static class Portfolio implements MultivariateFunction {
>
> @Override
> public double value(double[] x) {
>
>
> double Rp = 0;
> double RFR = 0.0007;
>
>
> for (int i = 0; i < x.length; ++i) {
> Rp += x[i] * ThreeYrRet.get(i).get(0);
>
>
> }
>
>
> double f = (Rp - RFR);
>
> System.out.println("weights = " + x);
> System.out.println("f = " + f);
> return f;
> }
> }
Unfortunately, I cannot help with so little information. Please post the
the Java file which you try to compile, together with the full output of the
compiler.
Regards,
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]