//
// MATLAB Compiler: 2.2
// Date: Mon Apr 19 22:58:26 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" "-p" "-W" "main" "-L"
// "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-B" "sglcpp" "-p" "-W"
// "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-W" "mainhg"
// "libmwsglm.mlib" "hier_community.m" "Default.m" "Stop_Simulation.m"
// "Call_SaveLoad_Fig.m" "SaveLoad_Fig.m" "SaveLoad.m" "Load_Population_Data.m"
// "Save_Population_Data.m" "Start_hier_community.m" "MyInline.m" "My_SymVar.m"
// "Find_Var.m" "isnumber.m" "isoperation.m" "Change_Number_of_Populations.m"
// "Switch_Populations.m" "Store_Parameters.m" 
//
#include "isoperation.hpp"
#include "libmatlbm.hpp"

static mxChar _array1_[140] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'i', 's', 'o', 'p', 'e',
                                'r', 'a', 't', 'i', 'o', 'n', ' ', 'L', 'i',
                                'n', 'e', ':', ' ', '1', ' ', 'C', 'o', 'l',
                                'u', 'm', 'n', ':', ' ', '1', ' ', 'T', 'h',
                                'e', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
                                'n', ' ', '"', 'i', 's', 'o', 'p', 'e', 'r',
                                'a', 't', 'i', 'o', 'n', '"', ' ', 'w', 'a',
                                's', ' ', 'c', 'a', 'l', 'l', 'e', 'd', ' ',
                                'w', 'i', 't', 'h', ' ', 'm', 'o', 'r', 'e',
                                ' ', 't', 'h', 'a', 'n', ' ', 't', 'h', 'e',
                                ' ', 'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd',
                                ' ', 'n', 'u', 'm', 'b', 'e', 'r', ' ', 'o',
                                'f', ' ', 'o', 'u', 't', 'p', 'u', 't', 's',
                                ' ', '(', '1', ')', '.' };
static mwArray _mxarray0_ = mclInitializeString(140, _array1_);

static mxChar _array3_[139] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'i', 's', 'o', 'p', 'e',
                                'r', 'a', 't', 'i', 'o', 'n', ' ', 'L', 'i',
                                'n', 'e', ':', ' ', '1', ' ', 'C', 'o', 'l',
                                'u', 'm', 'n', ':', ' ', '1', ' ', 'T', 'h',
                                'e', ' ', 'f', 'u', 'n', 'c', 't', 'i', 'o',
                                'n', ' ', '"', 'i', 's', 'o', 'p', 'e', 'r',
                                'a', 't', 'i', 'o', 'n', '"', ' ', 'w', 'a',
                                's', ' ', 'c', 'a', 'l', 'l', 'e', 'd', ' ',
                                'w', 'i', 't', 'h', ' ', 'm', 'o', 'r', 'e',
                                ' ', 't', 'h', 'a', 'n', ' ', 't', 'h', 'e',
                                ' ', 'd', 'e', 'c', 'l', 'a', 'r', 'e', 'd',
                                ' ', 'n', 'u', 'm', 'b', 'e', 'r', ' ', 'o',
                                'f', ' ', 'i', 'n', 'p', 'u', 't', 's', ' ',
                                '(', '1', ')', '.' };
static mwArray _mxarray2_ = mclInitializeString(139, _array3_);

static mxChar _array5_[5] = { '+', '-', '*', '/', '^' };
static mwArray _mxarray4_ = mclInitializeString(5, _array5_);

void InitializeModule_isoperation() {
}

void TerminateModule_isoperation() {
}

static mwArray Misoperation(int nargout_, mwArray var);

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

//
// The function "isoperation" contains the normal interface for the
// "isoperation" M-function from file "C:\shu\hier_community_exe\isoperation.m"
// (lines 1-4). This function processes any input arguments and passes them to
// the implementation version of the function, appearing above.
//
mwArray isoperation(mwArray var) {
    int nargout(1);
    mwArray value(mclGetUninitializedArray());
    value = Misoperation(nargout, var);
    return value;
}

//
// The function "mlxIsoperation" contains the feval interface for the
// "isoperation" M-function from file "C:\shu\hier_community_exe\isoperation.m"
// (lines 1-4). The feval function calls the implementation version of
// isoperation through this function. This function processes any input
// arguments and passes them to the implementation version of the function,
// appearing above.
//
void mlxIsoperation(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        mwArray mprhs[1];
        mwArray mplhs[1];
        int i;
        mclCppUninitializeArrays(1, mplhs);
        if (nlhs > 1) {
            error(_mxarray0_);
        }
        if (nrhs > 1) {
            error(_mxarray2_);
        }
        for (i = 0; i < 1 && i < nrhs; ++i) {
            mprhs[i] = mwArray(prhs[i], 0);
        }
        for (; i < 1; ++i) {
            mprhs[i].MakeDIN();
        }
        mplhs[0] = Misoperation(nlhs, mprhs[0]);
        plhs[0] = mplhs[0].FreezeData();
    }
    MW_END_MLX();
}

//
// The function "Misoperation" is the implementation version of the
// "isoperation" M-function from file "C:\shu\hier_community_exe\isoperation.m"
// (lines 1-4). 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 value = isoperation(var)
//
static mwArray Misoperation(int nargout_, mwArray var) {
    mwLocalFunctionTable save_local_function_table_
      (&_local_function_table_isoperation);
    mwArray value(mclGetUninitializedArray());
    mwArray num(mclGetUninitializedArray());
    //
    // 
    // num = ['+','-','*','/','^'];
    //
    num = _mxarray4_;
    //
    // value = any(var==num);
    //
    value = any(mwVa(var, "var") == mwVv(num, "num"));
    mwValidateOutput(value, 1, nargout_, "value", "isoperation");
    return value;
}
