/*************************************************************************
 *  This function is used to launcn iterations of ODE solver
 *
 *  It accepts following parameters:
 *   diff    -   callback which calculates dy/dx for given y and x
 *   obj     -   optional object which is passed to diff; can be NULL
 *
 *
 *  -- ALGLIB --
 *    Copyright 01.09.2009 by Bochkanov Sergey
 *
 *************************************************************************/
 public static void odesolversolve(odesolverstate state, ndimensional_ode_rp diff, object obj)
 {
     if (diff == null)
     {
         throw new alglibexception("ALGLIB: error in 'odesolversolve()' (diff is null)");
     }
     while (alglib.odesolveriteration(state))
     {
         if (state.needdy)
         {
             diff(state.innerobj.y, state.innerobj.x, state.innerobj.dy, obj);
             continue;
         }
         throw new alglibexception("ALGLIB: unexpected error in 'odesolversolve'");
     }
 }
Esempio n. 2
0
    /*************************************************************************
    This function is used to launcn iterations of ODE solver

    It accepts following parameters:
        diff    -   callback which calculates dy/dx for given y and x
        obj     -   optional object which is passed to diff; can be NULL


      -- ALGLIB --
         Copyright 01.09.2009 by Bochkanov Sergey

    *************************************************************************/
    public static void odesolversolve(odesolverstate state, ndimensional_ode_rp diff, object obj)
    {
        if( diff==null )
            throw new alglibexception("ALGLIB: error in 'odesolversolve()' (diff is null)");
        while( alglib.odesolveriteration(state) )
        {
            if( state.needdy )
            {
                diff(state.innerobj.y, state.innerobj.x, state.innerobj.dy, obj);
                continue;
            }
            throw new alglibexception("ALGLIB: unexpected error in 'odesolversolve'");
        }
    }
Esempio n. 3
0
 /*************************************************************************
 *  This function is used to launcn iterations of ODE solver
 *
 *  It accepts following parameters:
 *   diff    -   callback which calculates dy/dx for given y and x
 *   obj     -   optional object which is passed to diff; can be NULL
 *
 *
 *  -- ALGLIB --
 *    Copyright 01.09.2009 by Bochkanov Sergey
 *
 *************************************************************************/
 public static void odesolversolve(odesolverstate state, ndimensional_ode_rp diff, object obj)
 {
     odesolversolve(state, diff, obj, null);
 }