Can't use Optimization functions with ilnumerics in c# -
Can't use Optimization functions with ilnumerics in c# -
if right, there optimization toolbox in ilnumerics. after installed ilnumerics in project tried write examples http://ilnumerics.net/media/ilnumericsoptimizationtoolboxdocumentation.pdf in it. anytime utilize * = optimization.* there error, "optimization" undefinded variable. "the name 'optimization' not exist in current context"
using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using ilnumerics; namespace windowsformsapplication4 { public partial class form1 : form { public form1() { initializecomponent(); } } class programme : ilmath { public static ilretarray<double> meyerfunc(ilinarray<double> x, ilinarray<double> t) { using (ilscope.enter(x, t)) { homecoming x[0] * exp(x[1] / (t + x[2])); } } //the computation of minimum done follows: // minimum computation: ilarray<double> t = linspace<double>(0, 15, 16).t; ilarray<double> ydata = array<double>(34780.0, 28610.0, 23650.0, 19630.0, 16370.0, 13720.0, 11540.0, 9744.0, 8261.0, 7030.0, 6005.0, 5147.0, 4427.0, 3820.0, 3307.0, 2872.0); ilarray<double> x0 = array<double>(1.0, 200.0, 100.0); func<ilinarray<double>, ilretarray<double>> meyerfunction = x => { using (ilscope.enter(x)) { homecoming meyerfunc(x, t); } }; ilarray<double> xm = optimization.optimpdl(meyerfunction, x0, ydata); } }
the line
ilarray<double> xopt = optimization.optimpdl(objfunc, zeros<double>(2, 1));
is supposed within main function, not after , outside of it.
c# optimization ilnumerics
Comments
Post a Comment