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

📄 createdictionary.cpp

📁 mwpack_mwunpack 处理varargin输入和varargout输出
💻 CPP
字号:
//
// MATLAB Compiler: 3.0
// Date: Mon May 24 15:47:05 2004
// 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:/MATLAB6p5p1/work/book/dataconversion/mwpack_mwunpack/src" "-v" "-B"
// "cppcom:testmwutil,testmwutil,1.0" "-B" "ccom:testmwutil,testmwutil,1.0"
// "-t" "-W" "com:testmwutil,testmwutil,1.0" "-T" "link:lib" "-h"
// "libmmfile.mlib" "-i" "-L" "cpp" "-g" "-G" "-A" "debugline:on" "-O" "none"
// "-O" "fold_scalar_mxarrays:off" "-O" "fold_non_scalar_mxarrays:off" "-O"
// "optimize_integer_for_loops:off" "-O" "array_indexing:off" "-O"
// "optimize_conditionals:off" "-O" "speculate:off" "-i"
// "D:/MATLAB6p5p1/work/book/dataconversion/mwpack_mwunpack/mfiles/creatediction
// ary.m"
// "D:/MATLAB6p5p1/work/book/dataconversion/mwpack_mwunpack/mfiles/displayinput.
// m"
// "D:/MATLAB6p5p1/work/book/dataconversion/mwpack_mwunpack/mfiles/sortinputstri
// ng.m" 
//
#include "createdictionary.hpp"
#include "libmatlbm.hpp"

void InitializeModule_createdictionary() {
}

void TerminateModule_createdictionary() {
}

static mwArray Mcreatedictionary(int nargout_);

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

//
// The function "Ncreatedictionary" contains the nargout interface for the
// "createdictionary" M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\mwpack_mwunpack\mfiles\creatediction
// ary.m" (lines 1-16). 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.
//
mwArray Ncreatedictionary(int nargout, mwVarargout varargout) {
    nargout += varargout.Nargout();
    varargout.GetCell() = Mcreatedictionary(nargout);
    return varargout.AssignOutputs();
}

//
// The function "createdictionary" contains the normal interface for the
// "createdictionary" M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\mwpack_mwunpack\mfiles\creatediction
// ary.m" (lines 1-16). This function processes any input arguments and passes
// them to the implementation version of the function, appearing above.
//
mwArray createdictionary(mwVarargout varargout) {
    int nargout = 0;
    nargout += varargout.Nargout();
    varargout.GetCell() = Mcreatedictionary(nargout);
    return varargout.AssignOutputs();
}

//
// The function "Vcreatedictionary" contains the void interface for the
// "createdictionary" M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\mwpack_mwunpack\mfiles\creatediction
// ary.m" (lines 1-16). 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 Vcreatedictionary() {
    mwArray varargout = mwArray::UNDEFINED;
    varargout = Mcreatedictionary(0);
}

//
// The function "mlxCreatedictionary" contains the feval interface for the
// "createdictionary" M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\mwpack_mwunpack\mfiles\creatediction
// ary.m" (lines 1-16). The feval function calls the implementation version of
// createdictionary through this function. This function processes any input
// arguments and passes them to the implementation version of the function,
// appearing above.
//
void mlxCreatedictionary(int nlhs,
                         mxArray * plhs[],
                         int nrhs,
                         mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        mwArray mplhs[1];
        mclCppUndefineArrays(1, mplhs);
        if (nrhs > 0) {
            error(
              mwVarargin(
                mwArray(
                  "Run-time Error: File: createdictionary Line: 1 Colum"
                  "n: 1 The function \"createdictionary\" was called wi"
                  "th more than the declared number of inputs (0).")));
        }
        mplhs[0] = Mcreatedictionary(nlhs);
        mclAssignVarargoutCell(0, nlhs, plhs, mplhs[0].FreezeData());
    }
    MW_END_MLX();
}

//
// The function "Mcreatedictionary" is the implementation version of the
// "createdictionary" M-function from file
// "d:\matlab6p5p1\work\book\dataconversion\mwpack_mwunpack\mfiles\creatediction
// ary.m" (lines 1-16). 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 [varargout]=createdictionary()
//
static mwArray Mcreatedictionary(int nargout_) {
    mclMlineEnterFunction(
      "d:\\matlab6p5p1\\work\\book\\dataconversion\\"
      "mwpack_mwunpack\\mfiles\\createdictionary.m",
      "createdictionary")
    mwLocalFunctionTable save_local_function_table_
      = &_local_function_table_createdictionary;
    mwArray varargout = mwArray::UNDEFINED;
    mwArray i = mwArray::UNDEFINED;
    mwArray dic = mwArray::UNDEFINED;
    //
    // %function [y]=createdictionary()
    // dic=cell(1,10);
    //
    mclMline(3);
    dic = cell(mwVarargin(mwArray(1), mwArray(10)));
    //
    // dic{1}='edit';
    //
    mclMline(4);
    dic.cell(1) = "edit";
    //
    // dic{2}='file';
    //
    mclMline(5);
    dic.cell(2) = "file";
    //
    // dic{3}='view';
    //
    mclMline(6);
    dic.cell(3) = "view";
    //
    // dic{4}='window';
    //
    mclMline(7);
    dic.cell(4) = "window";
    //
    // dic{5}='help';
    //
    mclMline(8);
    dic.cell(5) = "help";
    //
    // dic{6}='format';
    //
    mclMline(9);
    dic.cell(6) = "format";
    //
    // dic{7}='project';
    //
    mclMline(10);
    dic.cell(7) = "project";
    //
    // dic{8}='search';
    //
    mclMline(11);
    dic.cell(8) = "search";
    //
    // dic{9}='column';
    //
    mclMline(12);
    dic.cell(9) = "column";
    //
    // dic{10}='properity';
    //
    mclMline(13);
    dic.cell(10) = "properity";
    //
    // for i=1:nargout
    //
    mclMline(14);
    {
        mwForLoopIterator viter__;
        for (viter__.Start(1, nargout_, mwArray::DIN); viter__.Next(&i); ) {
            //
            // varargout{i}=dic{i};
            //
            mclMline(15);
            varargout.cell(mwVv(i, "i")) = mwVv(dic, "dic").cell(mwVv(i, "i"));
        //
        // end
        //
        }
    }
    mclMlineFunctionReturn()
    return varargout;
    mclMlineExitFunctionReturn();
}

⌨️ 快捷键说明

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