コード例 #1
0
 public minasastate(minasa.minasastate obj)
 {
     _innerobj = obj;
 }
コード例 #2
0
 public minasareport(minasa.minasareport obj)
 {
     _innerobj = obj;
 }
コード例 #3
0
        /*************************************************************************
        Calculate test function #3

        Simple variation of #1, much more nonlinear, with non-zero value at minimum.
        It achieve two goals:
        * makes unlikely premature convergence of algorithm .
        * solves some issues with EpsF stopping condition which arise when
          F(minimum) is zero

        *************************************************************************/
        private static void testfunc3(minasa.minasastate state)
        {
            double s = 0;

            s = 0.001;
            if( (double)(state.x[0])<(double)(100) )
            {
                state.f = math.sqr(Math.Exp(state.x[0])-2)+math.sqr(math.sqr(state.x[1])+s)+math.sqr(state.x[2]-state.x[0]);
                state.g[0] = 2*(Math.Exp(state.x[0])-2)*Math.Exp(state.x[0])+2*(state.x[0]-state.x[2]);
                state.g[1] = 2*(math.sqr(state.x[1])+s)*2*state.x[1];
                state.g[2] = 2*(state.x[2]-state.x[0]);
            }
            else
            {
                state.f = Math.Sqrt(math.maxrealnumber);
                state.g[0] = Math.Sqrt(math.maxrealnumber);
                state.g[1] = 0;
                state.g[2] = 0;
            }
        }