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

📄 adptive_bitpow_allocate_systems_mex.c

📁 好东西
💻 C
📖 第 1 页 / 共 3 页
字号:
/*
 * MATLAB Compiler: 3.0
 * Date: Fri Mar 24 11:31:23 2006
 * 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" "-x" "-W" "mex" "-L" "C"
 * "-t" "-T" "link:mexlibrary" "libmatlbmx.mlib"
 * "adptive_bitpow_allocate_systems" 
 */

#ifndef MLF_V2
#define MLF_V2 1
#endif

#include "libmatlb.h"
#include "mwservices.h"
#include "adptive_bitpow_allocate_systems.h"
#include "add_noise.h"
#include "bitandpoweralloct2.h"
#include "cut_cp.h"
#include "de_map_module_adp.h"
#include "etime.h"
#include "hold.h"
#include "insert_cp.h"
#include "log10.h"
#include "map_module.h"
#include "map_module_adp.h"
#include "multipath_chann.h"
#include "xlabel.h"
#include "ylabel.h"

extern _mex_information _mex_info;

static mexFunctionTableEntry function_table[1]
  = { { "adptive_bitpow_allocate_systems", mlxAdptive_bitpow_allocate_systems,
        1, 0, &_local_function_table_adptive_bitpow_allocate_systems } };

static _mexInitTermTableEntry init_term_table[1]
  = { { InitializeModule_adptive_bitpow_allocate_systems,
        TerminateModule_adptive_bitpow_allocate_systems } };

/*
 * The function "Mylabel" is the MATLAB callback version of the "ylabel"
 * function from file "c:\matlab6p5\toolbox\matlab\graph2d\ylabel.m". It
 * performs a callback to MATLAB to run the "ylabel" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mylabel(int nargout_, mxArray * string, mxArray * varargin) {
    mxArray * hh = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &hh, NULL),
      "ylabel",
      string, mlfIndexRef(varargin, "{?}", mlfCreateColonIndex()), NULL);
    return hh;
}

/*
 * The function "Mxlabel" is the MATLAB callback version of the "xlabel"
 * function from file "c:\matlab6p5\toolbox\matlab\graph2d\xlabel.m". It
 * performs a callback to MATLAB to run the "xlabel" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mxlabel(int nargout_, mxArray * string, mxArray * varargin) {
    mxArray * hh = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &hh, NULL),
      "xlabel",
      string, mlfIndexRef(varargin, "{?}", mlfCreateColonIndex()), NULL);
    return hh;
}

/*
 * The function "Mmultipath_chann" is the MATLAB callback version of the
 * "multipath_chann" function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\multipath_chann.m". It performs
 * a callback to MATLAB to run the "multipath_chann" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mmultipath_chann(mxArray * * Hk,
                                  int nargout_,
                                  mxArray * input_sig,
                                  mxArray * num,
                                  mxArray * var_pow,
                                  mxArray * delay,
                                  mxArray * fd,
                                  mxArray * t_interval,
                                  mxArray * counter,
                                  mxArray * count_begin,
                                  mxArray * cp_n) {
    mxArray * output_sig = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &output_sig, Hk, NULL),
      "multipath_chann",
      input_sig,
      num,
      var_pow,
      delay,
      fd,
      t_interval,
      counter,
      count_begin,
      cp_n,
      NULL);
    return output_sig;
}

/*
 * The function "Mmap_module_adp" is the MATLAB callback version of the
 * "map_module_adp" function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\map_module_adp.m". It performs
 * a callback to MATLAB to run the "map_module_adp" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mmap_module_adp(int nargout_,
                                 mxArray * input,
                                 mxArray * map_flag) {
    mxArray * output = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &output, NULL),
      "map_module_adp",
      input, map_flag, NULL);
    return output;
}

/*
 * The function "Mmap_module" is the MATLAB callback version of the
 * "map_module" function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\map_module.m". It performs a
 * callback to MATLAB to run the "map_module" function, and passes any
 * resulting output arguments back to its calling function.
 */
static mxArray * Mmap_module(int nargout_,
                             mxArray * input,
                             mxArray * map_flag) {
    mxArray * output = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &output, NULL),
      "map_module",
      input, map_flag, NULL);
    return output;
}

/*
 * The function "Mlog10" is the MATLAB callback version of the "log10" function
 * from file "c:\matlab6p5\toolbox\matlab\elfun\log10.m". It performs a
 * callback to MATLAB to run the "log10" function, and passes any resulting
 * output arguments back to its calling function.
 */
static mxArray * Mlog10(int nargout_, mxArray * x) {
    mxArray * y = NULL;
    mclFevalCallMATLAB(mclNVarargout(nargout_, 0, &y, NULL), "log10", x, NULL);
    return y;
}

/*
 * The function "Minsert_cp" is the MATLAB callback version of the "insert_cp"
 * function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\insert_cp.m". It performs a
 * callback to MATLAB to run the "insert_cp" function, and passes any resulting
 * output arguments back to its calling function.
 */
static mxArray * Minsert_cp(int nargout_,
                            mxArray * input,
                            mxArray * cp_length) {
    mxArray * output = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &output, NULL),
      "insert_cp",
      input, cp_length, NULL);
    return output;
}

/*
 * The function "Mhold" is the MATLAB callback version of the "hold" function
 * from file "c:\matlab6p5\toolbox\matlab\graphics\hold.m". It performs a
 * callback to MATLAB to run the "hold" function, and passes any resulting
 * output arguments back to its calling function.
 */
static void Mhold(mxArray * opt_hold_state) {
    mclFevalCallMATLAB(mclAnsVarargout(), "hold", opt_hold_state, NULL);
}

/*
 * The function "Metime" is the MATLAB callback version of the "etime" function
 * from file "c:\matlab6p5\toolbox\matlab\timefun\etime.m". It performs a
 * callback to MATLAB to run the "etime" function, and passes any resulting
 * output arguments back to its calling function.
 */
static mxArray * Metime(int nargout_, mxArray * t1, mxArray * t0) {
    mxArray * t = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &t, NULL), "etime", t1, t0, NULL);
    return t;
}

/*
 * The function "Mde_map_module_adp" is the MATLAB callback version of the
 * "de_map_module_adp" function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\de_map_module_adp.m". It
 * performs a callback to MATLAB to run the "de_map_module_adp" function, and
 * passes any resulting output arguments back to its calling function.
 */
static mxArray * Mde_map_module_adp(int nargout_,
                                    mxArray * input,
                                    mxArray * map_flag,
                                    mxArray * groupsize,
                                    mxArray * groupnumber,
                                    mxArray * bit_num_ofdmsig) {
    mxArray * output = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &output, NULL),
      "de_map_module_adp",
      input, map_flag, groupsize, groupnumber, bit_num_ofdmsig, NULL);
    return output;
}

/*
 * The function "Mcut_cp" is the MATLAB callback version of the "cut_cp"
 * function from file "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\cut_cp.m".
 * It performs a callback to MATLAB to run the "cut_cp" function, and passes
 * any resulting output arguments back to its calling function.
 */
static mxArray * Mcut_cp(int nargout_, mxArray * input, mxArray * cp_length) {
    mxArray * output = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &output, NULL),
      "cut_cp",
      input, cp_length, NULL);
    return output;
}

/*
 * The function "Mbitandpoweralloct2" is the MATLAB callback version of the
 * "bitandpoweralloct2" function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\bitandpoweralloct2.m". It
 * performs a callback to MATLAB to run the "bitandpoweralloct2" function, and
 * passes any resulting output arguments back to its calling function.
 */
static mxArray * Mbitandpoweralloct2(mxArray * * Cbitvector,
                                     mxArray * * gama,
                                     int nargout_,
                                     mxArray * N_carrier,
                                     mxArray * groupnumber,
                                     mxArray * Hk,
                                     mxArray * SNR,
                                     mxArray * Pe,
                                     mxArray * N_ofdm) {
    mxArray * poweralloctvector = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &poweralloctvector, Cbitvector, gama, NULL),
      "bitandpoweralloct2",
      N_carrier, groupnumber, Hk, SNR, Pe, N_ofdm, NULL);
    return poweralloctvector;
}

/*
 * The function "Madd_noise" is the MATLAB callback version of the "add_noise"
 * function from file
 * "c:\matlab6p5\work\adptive_ofdm\adptive_ofdm\add_noise.m". It performs a
 * callback to MATLAB to run the "add_noise" function, and passes any resulting
 * output arguments back to its calling function.
 */
static mxArray * Madd_noise(int nargout_, mxArray * sgma, mxArray * input) {
    mxArray * output = NULL;
    mclFevalCallMATLAB(
      mclNVarargout(nargout_, 0, &output, NULL),
      "add_noise",
      sgma, input, NULL);
    return output;
}

/*
 * The function "mexLibrary" is a Compiler-generated mex wrapper, suitable for
 * building a MEX-function. It initializes any persistent variables as well as
 * a function table for use by the feval function. It then calls the function
 * "mlxAdptive_bitpow_allocate_systems". Finally, it clears the feval table and
 * exits.
 */
mex_information mexLibrary(void) {
    mclMexLibraryInit();
    return &_mex_info;
}

_mex_information _mex_info
  = { 1, 1, function_table, 0, NULL, 0, NULL, 1, init_term_table };

/*
 * The function "mlfNYlabel" contains the nargout interface for the "ylabel"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graph2d\ylabel.m" (lines
 * 0-0). 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 * mlfNYlabel(int nargout, mxArray * string, ...) {
    mxArray * varargin = NULL;
    mxArray * hh = NULL;
    mlfVarargin(&varargin, string, 0);
    mlfEnterNewContext(0, -2, string, varargin);
    hh = Mylabel(nargout, string, varargin);
    mlfRestorePreviousContext(0, 1, string);
    mxDestroyArray(varargin);
    return mlfReturnValue(hh);
}

/*
 * The function "mlfYlabel" contains the normal interface for the "ylabel"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graph2d\ylabel.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfYlabel(mxArray * string, ...) {
    mxArray * varargin = NULL;
    int nargout = 1;
    mxArray * hh = NULL;
    mlfVarargin(&varargin, string, 0);
    mlfEnterNewContext(0, -2, string, varargin);
    hh = Mylabel(nargout, string, varargin);
    mlfRestorePreviousContext(0, 1, string);
    mxDestroyArray(varargin);
    return mlfReturnValue(hh);
}

/*
 * The function "mlfVYlabel" contains the void interface for the "ylabel"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graph2d\ylabel.m" (lines
 * 0-0). 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 mlfVYlabel(mxArray * string, ...) {
    mxArray * varargin = NULL;
    mxArray * hh = NULL;
    mlfVarargin(&varargin, string, 0);
    mlfEnterNewContext(0, -2, string, varargin);
    hh = Mylabel(0, string, varargin);
    mlfRestorePreviousContext(0, 1, string);
    mxDestroyArray(varargin);
}

/*
 * The function "mlxYlabel" contains the feval interface for the "ylabel"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graph2d\ylabel.m" (lines
 * 0-0). The feval function calls the implementation version of ylabel through
 * this function. This function processes any input arguments and passes them
 * to the implementation version of the function, appearing above.
 */
void mlxYlabel(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: ylabel Line: 1 Column: "
            "1 The function \"ylabel\" was called with mor"
            "e than the declared number of outputs (1)."),
          NULL);
    }
    for (i = 0; i < 1; ++i) {
        mplhs[i] = 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]);
    mprhs[1] = NULL;
    mlfAssign(&mprhs[1], mclCreateVararginCell(nrhs - 1, prhs + 1));
    mplhs[0] = Mylabel(nlhs, mprhs[0], mprhs[1]);
    mlfRestorePreviousContext(0, 1, mprhs[0]);
    plhs[0] = mplhs[0];
    mxDestroyArray(mprhs[1]);
}

/*
 * The function "mlfNXlabel" contains the nargout interface for the "xlabel"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graph2d\xlabel.m" (lines
 * 0-0). 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 * mlfNXlabel(int nargout, mxArray * string, ...) {
    mxArray * varargin = NULL;
    mxArray * hh = NULL;
    mlfVarargin(&varargin, string, 0);
    mlfEnterNewContext(0, -2, string, varargin);
    hh = Mxlabel(nargout, string, varargin);
    mlfRestorePreviousContext(0, 1, string);
    mxDestroyArray(varargin);
    return mlfReturnValue(hh);
}

/*
 * The function "mlfXlabel" contains the normal interface for the "xlabel"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graph2d\xlabel.m" (lines
 * 0-0). This function processes any input arguments and passes them to the
 * implementation version of the function, appearing above.
 */
mxArray * mlfXlabel(mxArray * string, ...) {
    mxArray * varargin = NULL;
    int nargout = 1;
    mxArray * hh = NULL;
    mlfVarargin(&varargin, string, 0);
    mlfEnterNewContext(0, -2, string, varargin);
    hh = Mxlabel(nargout, string, varargin);
    mlfRestorePreviousContext(0, 1, string);
    mxDestroyArray(varargin);
    return mlfReturnValue(hh);
}

/*
 * The function "mlfVXlabel" contains the void interface for the "xlabel"
 * M-function from file "c:\matlab6p5\toolbox\matlab\graph2d\xlabel.m" (lines

⌨️ 快捷键说明

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