⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 optim_private_diagnose.c

📁 ASUFIT-Matlab-全局拟合程序
💻 C
📖 第 1 页 / 共 3 页
字号:
            mxCreateString("quadprog"),
            mxCreateString("lsqlin"),
            mxCreateString("fminimax"),
            mxCreateString("fseminf"),
            mxCreateString("fgoalattain"),
            NULL))) {
        /*
         * disp([' Number of linear inequality constraints:    ',int2str(lin_ineq)])
         */
        mlfDisp(
          mlfHorzcat(
            mxCreateString(" Number of linear inequality constraints:    "),
            mlfInt2str(lin_ineq),
            NULL));
        /*
         * disp([' Number of linear equality constraints:      ',int2str(lin_eq)])
         */
        mlfDisp(
          mlfHorzcat(
            mxCreateString(" Number of linear equality constraints:      "),
            mlfInt2str(lin_eq),
            NULL));
        /*
         * disp([' Number of lower bound constraints:          ',int2str(nnz(~isinf(LB)))])
         */
        mlfDisp(
          mlfHorzcat(
            mxCreateString(" Number of lower bound constraints:          "),
            mlfInt2str(mlfNnz(mlfNot(mlfIsinf(LB)))),
            NULL));
        /*
         * disp([' Number of upper bound constraints:          ',int2str(nnz(~isinf(UB)))])
         */
        mlfDisp(
          mlfHorzcat(
            mxCreateString(" Number of upper bound constraints:          "),
            mlfInt2str(mlfNnz(mlfNot(mlfIsinf(UB)))),
            NULL));
    /*
     * case {'lsqcurvefit','lsqnonlin'}
     */
    } else if (mclSwitchCompare(
                 caller,
                 mlfCellhcat(
                   mxCreateString("lsqcurvefit"),
                   mxCreateString("lsqnonlin"),
                   NULL))) {
        /*
         * disp([' Number of lower bound constraints:          ',int2str(nnz(~isinf(LB)))])
         */
        mlfDisp(
          mlfHorzcat(
            mxCreateString(" Number of lower bound constraints:          "),
            mlfInt2str(mlfNnz(mlfNot(mlfIsinf(LB)))),
            NULL));
        /*
         * disp([' Number of upper bound constraints:          ',int2str(nnz(~isinf(UB)))])
         */
        mlfDisp(
          mlfHorzcat(
            mxCreateString(" Number of upper bound constraints:          "),
            mlfInt2str(mlfNnz(mlfNot(mlfIsinf(UB)))),
            NULL));
    /*
     * case {'fsolve','fminunc','fsolves'}
     */
    } else if (mclSwitchCompare(
                 caller,
                 mlfCellhcat(
                   mxCreateString("fsolve"),
                   mxCreateString("fminunc"),
                   mxCreateString("fsolves"),
                   NULL))) {
    /*
     * otherwise
     */
    } else {
    /*
     * end
     */
    }
    /*
     * 
     * if ~isempty(OUTPUT)
     */
    if (mlfTobool(mlfNot(mlfIsempty(OUTPUT)))) {
        /*
         * temp = sprintf('\n%s\n   %s\n','Algorithm selected',OUTPUT.algorithm);
         */
        mlfAssign(
          &temp,
          mlfSprintf(
            NULL,
            mxCreateString("\\n%s\\n   %s\\n"),
            mxCreateString("Algorithm selected"),
            mlfIndexRef(OUTPUT, ".algorithm"),
            NULL));
        /*
         * disp(temp)
         */
        mlfDisp(temp);
    /*
     * end
     */
    }
    /*
     * 
     * pstr = sprintf('\n%s\n%s\n',...
     */
    mlfAssign(
      &pstr,
      mlfSprintf(
        NULL,
        mxCreateString("\\n%s\\n%s\\n"),
        mxCreateString(
          "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"),
        mxCreateString(" End diagnostic information "),
        NULL));
    /*
     * '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%',...
     * ' End diagnostic information ');
     * disp(pstr)
     */
    mlfDisp(pstr);
    mclValidateOutputs("optim/private/diagnose", 1, nargout_, &msg);
    mxDestroyArray(conformula);
    mxDestroyArray(funformula);
    mxDestroyArray(gradcformula);
    mxDestroyArray(gradformula);
    mxDestroyArray(hessformula);
    mxDestroyArray(pstr);
    mxDestroyArray(temp);
    return msg;
}

/*
 * The function "mlfOptim_private_diagnose" contains the normal interface for
 * the "optim/private/diagnose" M-function from file
 * "C:\MATLABR11\toolbox\optim\private\diagnose.m" (lines 1-182). This function
 * processes any input arguments and passes them to the implementation version
 * of the function, appearing above.
 */
mxArray * mlfOptim_private_diagnose(mxArray * caller,
                                    mxArray * OUTPUT,
                                    mxArray * gradflag,
                                    mxArray * hessflag,
                                    mxArray * constflag,
                                    mxArray * gradconstflag,
                                    mxArray * line_search,
                                    mxArray * OPTIONS,
                                    mxArray * XOUT,
                                    mxArray * non_eq,
                                    mxArray * non_ineq,
                                    mxArray * lin_eq,
                                    mxArray * lin_ineq,
                                    mxArray * LB,
                                    mxArray * UB,
                                    mxArray * funfcn,
                                    mxArray * confcn,
                                    mxArray * f,
                                    mxArray * GRAD,
                                    mxArray * HESS,
                                    mxArray * c,
                                    mxArray * ceq,
                                    mxArray * cGRAD,
                                    mxArray * ceqGRAD) {
    int nargout = 1;
    mxArray * msg = mclGetUninitializedArray();
    mlfEnterNewContext(
      0,
      24,
      caller,
      OUTPUT,
      gradflag,
      hessflag,
      constflag,
      gradconstflag,
      line_search,
      OPTIONS,
      XOUT,
      non_eq,
      non_ineq,
      lin_eq,
      lin_ineq,
      LB,
      UB,
      funfcn,
      confcn,
      f,
      GRAD,
      HESS,
      c,
      ceq,
      cGRAD,
      ceqGRAD);
    msg
      = Moptim_private_diagnose(
          nargout,
          caller,
          OUTPUT,
          gradflag,
          hessflag,
          constflag,
          gradconstflag,
          line_search,
          OPTIONS,
          XOUT,
          non_eq,
          non_ineq,
          lin_eq,
          lin_ineq,
          LB,
          UB,
          funfcn,
          confcn,
          f,
          GRAD,
          HESS,
          c,
          ceq,
          cGRAD,
          ceqGRAD);
    mlfRestorePreviousContext(
      0,
      24,
      caller,
      OUTPUT,
      gradflag,
      hessflag,
      constflag,
      gradconstflag,
      line_search,
      OPTIONS,
      XOUT,
      non_eq,
      non_ineq,
      lin_eq,
      lin_ineq,
      LB,
      UB,
      funfcn,
      confcn,
      f,
      GRAD,
      HESS,
      c,
      ceq,
      cGRAD,
      ceqGRAD);
    return mlfReturnValue(msg);
}

/*
 * The function "mlxOptim_private_diagnose" contains the feval interface for
 * the "optim/private/diagnose" M-function from file
 * "C:\MATLABR11\toolbox\optim\private\diagnose.m" (lines 1-182). The feval
 * function calls the implementation version of optim/private/diagnose through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
void mlxOptim_private_diagnose(int nlhs,
                               mxArray * plhs[],
                               int nrhs,
                               mxArray * prhs[]) {
    mxArray * mprhs[24];
    mxArray * mplhs[1];
    int i;
    if (nlhs > 1) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: optim/private/diagnose Line: 1 Col"
            "umn: 0 The function \"optim/private/diagnose\" was calle"
            "d with more than the declared number of outputs (1)"));
    }
    if (nrhs > 24) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: optim/private/diagnose Line: 1 Col"
            "umn: 0 The function \"optim/private/diagnose\" was calle"
            "d with more than the declared number of inputs (24)"));
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = NULL;
    }
    for (i = 0; i < 24 && i < nrhs; ++i) {
        mprhs[i] = prhs[i];
    }
    for (; i < 24; ++i) {
        mprhs[i] = NULL;
    }
    mlfEnterNewContext(
      0,
      24,
      mprhs[0],
      mprhs[1],
      mprhs[2],
      mprhs[3],
      mprhs[4],
      mprhs[5],
      mprhs[6],
      mprhs[7],
      mprhs[8],
      mprhs[9],
      mprhs[10],
      mprhs[11],
      mprhs[12],
      mprhs[13],
      mprhs[14],
      mprhs[15],
      mprhs[16],
      mprhs[17],
      mprhs[18],
      mprhs[19],
      mprhs[20],
      mprhs[21],
      mprhs[22],
      mprhs[23]);
    mplhs[0]
      = Moptim_private_diagnose(
          nlhs,
          mprhs[0],
          mprhs[1],
          mprhs[2],
          mprhs[3],
          mprhs[4],
          mprhs[5],
          mprhs[6],
          mprhs[7],
          mprhs[8],
          mprhs[9],
          mprhs[10],
          mprhs[11],
          mprhs[12],
          mprhs[13],
          mprhs[14],
          mprhs[15],
          mprhs[16],
          mprhs[17],
          mprhs[18],
          mprhs[19],
          mprhs[20],
          mprhs[21],
          mprhs[22],
          mprhs[23]);
    mlfRestorePreviousContext(
      0,
      24,
      mprhs[0],
      mprhs[1],
      mprhs[2],
      mprhs[3],
      mprhs[4],
      mprhs[5],
      mprhs[6],
      mprhs[7],
      mprhs[8],
      mprhs[9],
      mprhs[10],
      mprhs[11],
      mprhs[12],
      mprhs[13],
      mprhs[14],
      mprhs[15],
      mprhs[16],
      mprhs[17],
      mprhs[18],
      mprhs[19],
      mprhs[20],
      mprhs[21],
      mprhs[22],
      mprhs[23]);
    plhs[0] = mplhs[0];
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -