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

📄 compet.c

📁 nnToolKit 神经网络工具包是基于 MATLAB 神经网络工具箱自行开发的一组神经网络算法函数库
💻 C
📖 第 1 页 / 共 2 页
字号:
/*
 * MATLAB Compiler: 3.0
 * Date: Sun May 13 16:47:41 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 "compet.h"
#include "libmatlbm.h"
#include "nntobsu.h"

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

static mxChar _array3_[5] = { 'd', 'e', 'r', 'i', 'v' };
static mxArray * _mxarray2_;
static mxArray * _mxarray4_;

static mxChar _array6_[4] = { 'n', 'a', 'm', 'e' };
static mxArray * _mxarray5_;

static mxChar _array8_[11] = { 'C', 'o', 'm', 'p', 'e', 't',
                               'i', 't', 'i', 'v', 'e' };
static mxArray * _mxarray7_;

static mxChar _array10_[6] = { 'o', 'u', 't', 'p', 'u', 't' };
static mxArray * _mxarray9_;

static double _array12_[2] = { 0.0, 1.0 };
static mxArray * _mxarray11_;

static mxChar _array14_[6] = { 'a', 'c', 't', 'i', 'v', 'e' };
static mxArray * _mxarray13_;
static double _ieee_minusinf_;
static double _ieee_plusinf_;

static double _array16_[2] = { 0.0 /*_ieee_minusinf_*/,
                               0.0 /*_ieee_plusinf_*/ };
static mxArray * _mxarray15_;

static mxChar _array18_[4] = { 't', 'y', 'p', 'e' };
static mxArray * _mxarray17_;
static mxArray * _mxarray19_;

static mxChar _array21_[5] = { 'd', 'e', 'l', 't', 'a' };
static mxArray * _mxarray20_;

static mxChar _array23_[4] = { 'n', 'o', 'n', 'e' };
static mxArray * _mxarray22_;

static mxChar _array25_[6] = { 'c', 'o', 'm', 'p', 'e', 't' };
static mxArray * _mxarray24_;

static mxChar _array27_[47] = { 'U', 's', 'e', ' ', 'C', 'O', 'M', 'P',
                                'E', 'T', '(', 0x0027, 'd', 'e', 'r', 'i',
                                'v', 0x0027, ')', ' ', 'i', 'n', 's', 't',
                                'e', 'a', 'd', ' ', 'o', 'f', ' ', 'C',
                                'O', 'M', 'P', 'E', 'T', '(', 0x0027, 'd',
                                'e', 'l', 't', 'a', 0x0027, ')', '.' };
static mxArray * _mxarray26_;

static mxChar _array29_[4] = { 'i', 'n', 'i', 't' };
static mxArray * _mxarray28_;

static mxChar _array31_[8] = { 'm', 'i', 'd', 'p', 'o', 'i', 'n', 't' };
static mxArray * _mxarray30_;

static mxChar _array33_[53] = { 'U', 's', 'e', ' ', 'n', 'e', 't', 'w', 'o',
                                'r', 'k', ' ', 'p', 'r', 'o', 'p', 'r', 'e',
                                't', 'i', 'e', 's', ' ', 't', 'o', ' ', 'o',
                                'b', 't', 'a', 'i', 'n', ' ', 'i', 'n', 'i',
                                't', 'i', 'a', 'l', 'i', 'z', 'a', 't', 'i',
                                'o', 'n', ' ', 'i', 'n', 'f', 'o', '.' };
static mxArray * _mxarray32_;

static mxChar _array35_[18] = { 'U', 'n', 'r', 'e', 'c', 'o', 'g', 'n', 'i',
                                'z', 'e', 'd', ' ', 'c', 'o', 'd', 'e', '.' };
static mxArray * _mxarray34_;

static mxChar _array37_[47] = { 'U', 's', 'e', ' ', 'C', 'O', 'M', 'P',
                                'E', 'T', '(', 'N', 'E', 'T', 'S', 'U',
                                'M', '(', 'Z', ',', 'B', ')', ')', ' ',
                                'i', 'n', 's', 't', 'e', 'a', 'd', ' ',
                                'o', 'f', ' ', 'C', 'O', 'M', 'P', 'E',
                                'T', '(', 'Z', ',', 'B', ')', '.' };
static mxArray * _mxarray36_;
static mxArray * _mxarray38_;
static mxArray * _mxarray39_;

void InitializeModule_compet(void) {
    _mxarray0_ = mclInitializeString(21, _array1_);
    _mxarray2_ = mclInitializeString(5, _array3_);
    _mxarray4_ = mclInitializeCharVector(0, 0, (mxChar *)NULL);
    _mxarray5_ = mclInitializeString(4, _array6_);
    _mxarray7_ = mclInitializeString(11, _array8_);
    _mxarray9_ = mclInitializeString(6, _array10_);
    _mxarray11_ = mclInitializeDoubleVector(1, 2, _array12_);
    _mxarray13_ = mclInitializeString(6, _array14_);
    _ieee_minusinf_ = mclGetMinusInf();
    _array16_[0] = _ieee_minusinf_;
    _ieee_plusinf_ = mclGetInf();
    _array16_[1] = _ieee_plusinf_;
    _mxarray15_ = mclInitializeDoubleVector(1, 2, _array16_);
    _mxarray17_ = mclInitializeString(4, _array18_);
    _mxarray19_ = mclInitializeDouble(2.0);
    _mxarray20_ = mclInitializeString(5, _array21_);
    _mxarray22_ = mclInitializeString(4, _array23_);
    _mxarray24_ = mclInitializeString(6, _array25_);
    _mxarray26_ = mclInitializeString(47, _array27_);
    _mxarray28_ = mclInitializeString(4, _array29_);
    _mxarray30_ = mclInitializeString(8, _array31_);
    _mxarray32_ = mclInitializeString(53, _array33_);
    _mxarray34_ = mclInitializeString(18, _array35_);
    _mxarray36_ = mclInitializeString(47, _array37_);
    _mxarray38_ = mclInitializeDouble(1.0);
    _mxarray39_ = mclInitializeDoubleVector(0, 0, (double *)NULL);
}

void TerminateModule_compet(void) {
    mxDestroyArray(_mxarray39_);
    mxDestroyArray(_mxarray38_);
    mxDestroyArray(_mxarray36_);
    mxDestroyArray(_mxarray34_);
    mxDestroyArray(_mxarray32_);
    mxDestroyArray(_mxarray30_);
    mxDestroyArray(_mxarray28_);
    mxDestroyArray(_mxarray26_);
    mxDestroyArray(_mxarray24_);
    mxDestroyArray(_mxarray22_);
    mxDestroyArray(_mxarray20_);
    mxDestroyArray(_mxarray19_);
    mxDestroyArray(_mxarray17_);
    mxDestroyArray(_mxarray15_);
    mxDestroyArray(_mxarray13_);
    mxDestroyArray(_mxarray11_);
    mxDestroyArray(_mxarray9_);
    mxDestroyArray(_mxarray7_);
    mxDestroyArray(_mxarray5_);
    mxDestroyArray(_mxarray4_);
    mxDestroyArray(_mxarray2_);
    mxDestroyArray(_mxarray0_);
}

static mxArray * Mcompet(int nargout_, mxArray * n, mxArray * b);

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

/*
 * The function "mlfCompet" contains the normal interface for the "compet"
 * M-function from file "d:\matlab6p5\toolbox\nnet\nnet\compet.m" (lines 1-98).
 * This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfCompet(mxArray * n, mxArray * b) {
    int nargout = 1;
    mxArray * a = NULL;
    mlfEnterNewContext(0, 2, n, b);
    a = Mcompet(nargout, n, b);
    mlfRestorePreviousContext(0, 2, n, b);
    return mlfReturnValue(a);
}

/*
 * The function "mlxCompet" contains the feval interface for the "compet"
 * M-function from file "d:\matlab6p5\toolbox\nnet\nnet\compet.m" (lines 1-98).
 * The feval function calls the implementation version of compet through this
 * function. This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
void mlxCompet(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: compet Line: 1 Column: "
            "1 The function \"compet\" was called with mor"
            "e than the declared number of outputs (1)."),
          NULL);
    }
    if (nrhs > 2) {
        mlfError(
          mxCreateString(
            "Run-time Error: File: compet Line: 1 Column: "
            "1 The function \"compet\" was called with mor"
            "e than the declared number of inputs (2)."),
          NULL);
    }
    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] = Mcompet(nlhs, mprhs[0], mprhs[1]);
    mlfRestorePreviousContext(0, 2, mprhs[0], mprhs[1]);
    plhs[0] = mplhs[0];
}

/*
 * The function "Mcompet" is the implementation version of the "compet"
 * M-function from file "d:\matlab6p5\toolbox\nnet\nnet\compet.m" (lines 1-98).
 * 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 a = compet(n,b)
 */
static mxArray * Mcompet(int nargout_, mxArray * n, mxArray * b) {
    mexLocalFunctionTable save_local_function_table_
      = mclSetCurrentLocalFunctionTable(&_local_function_table_compet);
    int nargin_ = mclNargin(2, n, b, NULL);

⌨️ 快捷键说明

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