Beispiel #1
0
        /*************************************************************************
        MinNLC results

        INPUT PARAMETERS:
            State   -   algorithm state

        OUTPUT PARAMETERS:
            X       -   array[0..N-1], solution
            Rep     -   optimization report. You should check Rep.TerminationType
                        in  order  to  distinguish  successful  termination  from
                        unsuccessful one:
                        * -8    internal integrity control  detected  infinite or
                                NAN   values   in   function/gradient.   Abnormal
                                termination signalled.
                        * -7   gradient verification failed.
                               See MinNLCSetGradientCheck() for more information.
                        *  1   relative function improvement is no more than EpsF.
                        *  2   scaled step is no more than EpsX.
                        *  4   scaled gradient norm is no more than EpsG.
                        *  5   MaxIts steps was taken
                        More information about fields of this  structure  can  be
                        found in the comments on MinNLCReport datatype.
           
          -- ALGLIB --
             Copyright 06.06.2014 by Bochkanov Sergey
        *************************************************************************/
        public static void minnlcresults(minnlcstate state,
            ref double[] x,
            minnlcreport rep)
        {
            x = new double[0];

            minnlcresultsbuf(state, ref x, rep);
        }
Beispiel #2
0
        /*************************************************************************
        NLC results

        Buffered implementation of MinNLCResults() which uses pre-allocated buffer
        to store X[]. If buffer size is  too  small,  it  resizes  buffer.  It  is
        intended to be used in the inner cycles of performance critical algorithms
        where array reallocation penalty is too large to be ignored.

          -- ALGLIB --
             Copyright 28.11.2010 by Bochkanov Sergey
        *************************************************************************/
        public static void minnlcresultsbuf(minnlcstate state,
            ref double[] x,
            minnlcreport rep)
        {
            int i = 0;
            int i_ = 0;

            if( alglib.ap.len(x)<state.n )
            {
                x = new double[state.n];
            }
            rep.iterationscount = state.repinneriterationscount;
            rep.nfev = state.repnfev;
            rep.varidx = state.repvaridx;
            rep.funcidx = state.repfuncidx;
            rep.terminationtype = state.repterminationtype;
            rep.dbgphase0its = state.repdbgphase0its;
            if( state.repterminationtype>0 )
            {
                for(i_=0; i_<=state.n-1;i_++)
                {
                    x[i_] = state.xc[i_];
                }
            }
            else
            {
                for(i=0; i<=state.n-1; i++)
                {
                    x[i] = Double.NaN;
                }
            }
        }
Beispiel #3
0
 public override alglib.apobject make_copy()
 {
     minnlcreport _result = new minnlcreport();
     _result.iterationscount = iterationscount;
     _result.nfev = nfev;
     _result.varidx = varidx;
     _result.funcidx = funcidx;
     _result.terminationtype = terminationtype;
     _result.dbgphase0its = dbgphase0its;
     return _result;
 }