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

📄 graphics_private_clo.c

📁 ASUFIT-Matlab-全局拟合程序
💻 C
📖 第 1 页 / 共 2 页
字号:
}

/*
 * The function "mlfNGraphics_private_clo" contains the nargout interface for
 * the "graphics/private/clo" M-function from file
 * "C:\MATLABR11\toolbox\matlab\graphics\private\clo.m" (lines 1-68). This
 * interface is only produced if the M-function uses the special variable
 * "nargout". The nargout interface allows the number of requested outputs to
 * be specified via the nargout argument, as opposed to the normal interface
 * which dynamically calculates the number of outputs based on the number of
 * non-NULL inputs it receives. This function processes any input arguments and
 * passes them to the implementation version of the function, appearing above.
 */
mxArray * mlfNGraphics_private_clo(int nargout,
                                   mxArray * obj,
                                   mxArray * in1,
                                   mxArray * in2) {
    mxArray * ret_obj = mclGetUninitializedArray();
    mlfEnterNewContext(0, 3, obj, in1, in2);
    ret_obj = Mgraphics_private_clo(nargout, obj, in1, in2);
    mlfRestorePreviousContext(0, 3, obj, in1, in2);
    return mlfReturnValue(ret_obj);
}

/*
 * The function "mlfGraphics_private_clo" contains the normal interface for the
 * "graphics/private/clo" M-function from file
 * "C:\MATLABR11\toolbox\matlab\graphics\private\clo.m" (lines 1-68). This
 * function processes any input arguments and passes them to the implementation
 * version of the function, appearing above.
 */
mxArray * mlfGraphics_private_clo(mxArray * obj, mxArray * in1, mxArray * in2) {
    int nargout = 1;
    mxArray * ret_obj = mclGetUninitializedArray();
    mlfEnterNewContext(0, 3, obj, in1, in2);
    ret_obj = Mgraphics_private_clo(nargout, obj, in1, in2);
    mlfRestorePreviousContext(0, 3, obj, in1, in2);
    return mlfReturnValue(ret_obj);
}

/*
 * The function "mlfVGraphics_private_clo" contains the void interface for the
 * "graphics/private/clo" M-function from file
 * "C:\MATLABR11\toolbox\matlab\graphics\private\clo.m" (lines 1-68). The void
 * interface is only produced if the M-function uses the special variable
 * "nargout", and has at least one output. The void interface function
 * specifies zero output arguments to the implementation version of the
 * function, and in the event that the implementation version still returns an
 * output (which, in MATLAB, would be assigned to the "ans" variable), it
 * deallocates the output. This function processes any input arguments and
 * passes them to the implementation version of the function, appearing above.
 */
void mlfVGraphics_private_clo(mxArray * obj, mxArray * in1, mxArray * in2) {
    mxArray * ret_obj = mclUnassigned();
    mlfEnterNewContext(0, 3, obj, in1, in2);
    ret_obj = Mgraphics_private_clo(0, obj, in1, in2);
    mlfRestorePreviousContext(0, 3, obj, in1, in2);
    mxDestroyArray(ret_obj);
}

/*
 * The function "mlxGraphics_private_clo" contains the feval interface for the
 * "graphics/private/clo" M-function from file
 * "C:\MATLABR11\toolbox\matlab\graphics\private\clo.m" (lines 1-68). The feval
 * function calls the implementation version of graphics/private/clo through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
void mlxGraphics_private_clo(int nlhs,
                             mxArray * plhs[],
                             int nrhs,
                             mxArray * prhs[]) {
    mxArray * mprhs[3];
    mxArray * mplhs[1];
    int i;
    if (nlhs > 1) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: graphics/private/clo Line: 1 Col"
            "umn: 0 The function \"graphics/private/clo\" was calle"
            "d with more than the declared number of outputs (1)"));
    }
    if (nrhs > 3) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: graphics/private/clo Line: 1 Col"
            "umn: 0 The function \"graphics/private/clo\" was calle"
            "d with more than the declared number of inputs (3)"));
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = NULL;
    }
    for (i = 0; i < 3 && i < nrhs; ++i) {
        mprhs[i] = prhs[i];
    }
    for (; i < 3; ++i) {
        mprhs[i] = NULL;
    }
    mlfEnterNewContext(0, 3, mprhs[0], mprhs[1], mprhs[2]);
    mplhs[0] = Mgraphics_private_clo(nlhs, mprhs[0], mprhs[1], mprhs[2]);
    mlfRestorePreviousContext(0, 3, mprhs[0], mprhs[1], mprhs[2]);
    plhs[0] = mplhs[0];
}

/*
 * The function "Mclo_find_kids" is the implementation version of the
 * "clo/find_kids" M-function from file
 * "C:\MATLABR11\toolbox\matlab\graphics\private\clo.m" (lines 68-85). It
 * contains the actual compiled code for that M-function. It is a static
 * function and must only be called from one of the interface functions,
 * appearing below.
 */
/*
 * function hsave_out = find_kids(obj, hsave)
 */
static mxArray * Mclo_find_kids(int nargout_, mxArray * obj, mxArray * hsave) {
    mxArray * hsave_out = mclGetUninitializedArray();
    mclForLoopIterator iterator_0;
    mxArray * kid = mclGetUninitializedArray();
    mxArray * parent = mclGetUninitializedArray();
    mclValidateInputs("clo/find_kids", 2, &obj, &hsave);
    /*
     * %
     * %
     * %
     * hsave_out = [];
     */
    mlfAssign(&hsave_out, mclCreateEmptyArray());
    /*
     * for kid=hsave(:)'
     */
    for (mclForStart(
           &iterator_0,
           mlfCtranspose(mlfIndexRef(hsave, "(?)", mlfCreateColonIndex())),
           NULL,
           NULL);
         mclForNext(&iterator_0, &kid);
         ) {
        /*
         * while ~isempty(kid)
         */
        while (mlfTobool(mlfNot(mlfIsempty(kid)))) {
            /*
             * parent = get(kid,'parent');
             */
            mlfAssign(&parent, mlfGet(kid, mxCreateString("parent"), NULL));
            /*
             * if ~isempty(parent) & parent == obj
             */
            {
                mxArray * a_ = mclInitialize(mlfNot(mlfIsempty(parent)));
                if (mlfTobool(a_)
                    && mlfTobool(mlfAnd(a_, mlfEq(parent, obj)))) {
                    mxDestroyArray(a_);
                    /*
                     * hsave_out(end + 1) = kid;
                     */
                    mlfIndexAssign(
                      &hsave_out,
                      "(?)",
                      mlfPlus(
                        mlfEnd(hsave_out, mlfScalar(1), mlfScalar(1)),
                        mlfScalar(1.0)),
                      kid);
                    /*
                     * break;
                     */
                    mclDestroyForLoopIterator(&iterator_0);
                    break;
                /*
                 * else
                 */
                } else {
                    mxDestroyArray(a_);
                    /*
                     * kid = parent;
                     */
                    mlfAssign(&kid, parent);
                }
            /*
             * end
             */
            }
        /*
         * end
         */
        }
    /*
     * end
     */
    }
    mclValidateOutputs("clo/find_kids", 1, nargout_, &hsave_out);
    mxDestroyArray(kid);
    mxDestroyArray(parent);
    /*
     * 
     */
    return hsave_out;
}

/*
 * The function "mlfClo_find_kids" contains the normal interface for the
 * "clo/find_kids" M-function from file
 * "C:\MATLABR11\toolbox\matlab\graphics\private\clo.m" (lines 68-85). This
 * function processes any input arguments and passes them to the implementation
 * version of the function, appearing above.
 */
static mxArray * mlfClo_find_kids(mxArray * obj, mxArray * hsave) {
    int nargout = 1;
    mxArray * hsave_out = mclGetUninitializedArray();
    mlfEnterNewContext(0, 2, obj, hsave);
    hsave_out = Mclo_find_kids(nargout, obj, hsave);
    mlfRestorePreviousContext(0, 2, obj, hsave);
    return mlfReturnValue(hsave_out);
}

/*
 * The function "mlxClo_find_kids" contains the feval interface for the
 * "clo/find_kids" M-function from file
 * "C:\MATLABR11\toolbox\matlab\graphics\private\clo.m" (lines 68-85). The
 * feval function calls the implementation version of clo/find_kids through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
static void mlxClo_find_kids(int nlhs,
                             mxArray * plhs[],
                             int nrhs,
                             mxArray * prhs[]) {
    mxArray * mprhs[2];
    mxArray * mplhs[1];
    int i;
    if (nlhs > 1) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: clo/find_kids Line: 68 Colum"
            "n: 0 The function \"clo/find_kids\" was called wit"
            "h more than the declared number of outputs (1)"));
    }
    if (nrhs > 2) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: clo/find_kids Line: 68 Colum"
            "n: 0 The function \"clo/find_kids\" was called wit"
            "h more than the declared number of inputs (2)"));
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = NULL;
    }
    for (i = 0; i < 2 && i < nrhs; ++i) {
        mprhs[i] = prhs[i];
    }
    for (; i < 2; ++i) {
        mprhs[i] = NULL;
    }
    mlfEnterNewContext(0, 2, mprhs[0], mprhs[1]);
    mplhs[0] = Mclo_find_kids(nlhs, mprhs[0], mprhs[1]);
    mlfRestorePreviousContext(0, 2, mprhs[0], mprhs[1]);
    plhs[0] = mplhs[0];
}

⌨️ 快捷键说明

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