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

📄 nntwarn.c

📁 nnToolKit 神经网络工具包是基于 MATLAB 神经网络工具箱自行开发的一组神经网络算法函数库
💻 C
字号:
/*
 * MATLAB Compiler: 3.0
 * Date: Sun May 13 16:47:40 2007
 * Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
 * "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
 * "array_indexing:on" "-O" "optimize_conditionals:on" "-M" "-silentsetup" "-d"
 * "d:/MATLAB6p5/work/nnToolKit/src" "-B" "csglcom:nnToolKit,nnToolKit,2.0"
 * "-B" "sgl" "-m" "-W" "main" "-L" "C" "-t" "-T" "link:exe" "-h"
 * "libmmfile.mlib" "-W" "mainhg" "libmwsglm.mlib" "-t" "-W"
 * "comhg:nnToolKit,nnToolKit,2.0" "-T" "link:lib" "-h" "libmmfile.mlib" "-i"
 * "-i" "D:/MATLAB6p5/work/nnToolKit/lmnet/LmSimu.m"
 * "D:/MATLAB6p5/work/nnToolKit/lmnet/LmTrain.m"
 * "D:/MATLAB6p5/work/nnToolKit/sofm/SofmSimu.m"
 * "D:/MATLAB6p5/work/nnToolKit/sofm/SofmTrain.m" 
 */
#include "nntwarn.h"
#include "libmatlbm.h"

extern mxArray * NNTWARNFLAG;

static mxChar _array1_[27] = { 'N', 'o', 't', ' ', 'e', 'n', 'o', 'u', 'g',
                               'h', ' ', 'i', 'n', 'p', 'u', 't', ' ', 'a',
                               'r', 'g', 'u', 'm', 'e', 'n', 't', 's', '.' };
static mxArray * _mxarray0_;

static mxChar _array3_[2] = { 'o', 'n' };
static mxArray * _mxarray2_;
static mxArray * _mxarray4_;

static mxChar _array6_[3] = { 'o', 'f', 'f' };
static mxArray * _mxarray5_;

static mxChar _array8_[5] = { 'e', 'r', 'r', 'o', 'r' };
static mxArray * _mxarray7_;

static mxChar _array10_[21] = { 'U', 'n', 'r', 'e', 'c', 'o', 'g',
                                'n', 'i', 'z', 'e', 'd', ' ', 'c',
                                'o', 'm', 'm', 'a', 'n', 'd', '.' };
static mxArray * _mxarray9_;

void InitializeModule_nntwarn(void) {
    _mxarray0_ = mclInitializeString(27, _array1_);
    _mxarray2_ = mclInitializeString(2, _array3_);
    _mxarray4_ = mclInitializeDoubleVector(0, 0, (double *)NULL);
    _mxarray5_ = mclInitializeString(3, _array6_);
    _mxarray7_ = mclInitializeString(5, _array8_);
    _mxarray9_ = mclInitializeString(21, _array10_);
}

void TerminateModule_nntwarn(void) {
    mxDestroyArray(_mxarray9_);
    mxDestroyArray(_mxarray7_);
    mxDestroyArray(_mxarray5_);
    mxDestroyArray(_mxarray4_);
    mxDestroyArray(_mxarray2_);
    mxDestroyArray(_mxarray0_);
}

static void Mnntwarn(mxArray * cmd);

_mexLocalFunctionTable _local_function_table_nntwarn
  = { 0, (mexFunctionTableEntry *)NULL };

/*
 * The function "mlfNntwarn" contains the normal interface for the "nntwarn"
 * M-function from file "d:\matlab6p5\toolbox\nnet\nnutils\nntwarn.m" (lines
 * 1-38). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
void mlfNntwarn(mxArray * cmd) {
    mlfEnterNewContext(0, 1, cmd);
    Mnntwarn(cmd);
    mlfRestorePreviousContext(0, 1, cmd);
}

/*
 * The function "mlxNntwarn" contains the feval interface for the "nntwarn"
 * M-function from file "d:\matlab6p5\toolbox\nnet\nnutils\nntwarn.m" (lines
 * 1-38). The feval function calls the implementation version of nntwarn
 * through this function. This function processes any input arguments and
 * passes them to the implementation version of the function, appearing above.
 */
void mlxNntwarn(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    mxArray * mprhs[1];
    int i;
    if (nlhs > 0) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: nntwarn Line: 1 Column: "
            "1 The function \"nntwarn\" was called with mor"
            "e than the declared number of outputs (0)."),
          NULL);
    }
    if (nrhs > 1) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: nntwarn Line: 1 Column:"
            " 1 The function \"nntwarn\" was called with m"
            "ore than the declared number of inputs (1)."),
          NULL);
    }
    for (i = 0; i < 1 && i < nrhs; ++i) {
        mprhs[i] = prhs[i];
    }
    for (; i < 1; ++i) {
        mprhs[i] = NULL;
    }
    mlfEnterNewContext(0, 1, mprhs[0]);
    Mnntwarn(mprhs[0]);
    mlfRestorePreviousContext(0, 1, mprhs[0]);
}

/*
 * The function "Mnntwarn" is the implementation version of the "nntwarn"
 * M-function from file "d:\matlab6p5\toolbox\nnet\nnutils\nntwarn.m" (lines
 * 1-38). 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 nntwarn(cmd)
 */
static void Mnntwarn(mxArray * cmd) {
    mexLocalFunctionTable save_local_function_table_
      = mclSetCurrentLocalFunctionTable(&_local_function_table_nntwarn);
    int nargin_ = mclNargin(1, cmd, NULL);
    mxArray * ans = NULL;
    mclCopyArray(&cmd);
    /*
     * %NNTWARN
     * %
     * %  Syntax
     * %
     * %    nntwarn on
     * %    nntwarn off
     * %
     * %  Description
     * %
     * %    NNTWARN allows Neural Network Toolbox warnings to be temporarily
     * %    turned off.
     * %
     * %    Code using obsolete Neural Network Toolbox functionality can
     * %    generate a lot of warnings.  This function allows you to skip
     * %    those warnings.  However, we encourage you to update your code
     * %    to ensure that it will run under future versions of the toolbox.
     * 
     * % Mark Beale, 11-31-97
     * % Copyright 1992-2002 The MathWorks, Inc.
     * % $Revision: 1.8 $
     * 
     * if nargin < 1, error('Not enough input arguments.'),end
     */
    if (nargin_ < 1) {
        mlfError(_mxarray0_, NULL);
    }
    /*
     * 
     * global NNTWARNFLAG;
     * 
     * switch(lower(cmd))
     */
    {
        mxArray * v_ = mclInitialize(mlfLower(mclVa(cmd, "cmd")));
        if (mclSwitchCompare(v_, _mxarray2_)) {
            /*
             * case 'on'
             * NNTWARNFLAG = [];
             */
            mlfAssign(mclPrepareGlobal(&NNTWARNFLAG), _mxarray4_);
        /*
         * case 'off'
         */
        } else if (mclSwitchCompare(v_, _mxarray5_)) {
            /*
             * NNTWARNFLAG = 'off';
             */
            mlfAssign(mclPrepareGlobal(&NNTWARNFLAG), _mxarray5_);
        /*
         * case 'error'
         */
        } else if (mclSwitchCompare(v_, _mxarray7_)) {
            /*
             * NNTWARNFLAG = 'error';
             */
            mlfAssign(mclPrepareGlobal(&NNTWARNFLAG), _mxarray7_);
        /*
         * otherwise
         */
        } else {
            /*
             * error('Unrecognized command.')
             */
            mlfError(_mxarray9_, NULL);
        /*
         * end
         */
        }
        mxDestroyArray(v_);
    }
    mxDestroyArray(ans);
    mxDestroyArray(cmd);
    mclSetCurrentLocalFunctionTable(save_local_function_table_);
    /*
     * 
     */
}

⌨️ 快捷键说明

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