/*
 * Academic License - for use in teaching, academic research, and meeting
 * course requirements at degree granting institutions only.  Not for
 * government, commercial, or other organizational use.
 *
 * _coder_digital_option_price_cg_mex.c
 *
 * Code generation for function '_coder_digital_option_price_cg_mex'
 *
 */

/* Include files */
#include "_coder_digital_option_price_cg_mex.h"
#include "_coder_digital_option_price_cg_api.h"
#include "digital_option_price_cg_data.h"
#include "digital_option_price_cg_initialize.h"
#include "digital_option_price_cg_terminate.h"
#include "rt_nonfinite.h"

/* Function Definitions */
void digital_option_price_cg_mexFunction(int32_T nlhs, mxArray *plhs[5],
                                         int32_T nrhs, const mxArray *prhs[13])
{
  emlrtStack st = {
      NULL, /* site */
      NULL, /* tls */
      NULL  /* prev */
  };
  const mxArray *outputs[5];
  int32_T i;
  st.tls = emlrtRootTLSGlobal;
  /* Check for proper number of arguments. */
  if (nrhs < 13) {
    emlrtErrMsgIdAndTxt(&st, "EMLRT:runTime:TooFewInputsConstants", 9, 4, 23,
                        "digital_option_price_cg", 4, 23,
                        "digital_option_price_cg", 4, 23,
                        "digital_option_price_cg");
  }
  if (nrhs != 13) {
    emlrtErrMsgIdAndTxt(&st, "EMLRT:runTime:WrongNumberOfInputs", 5, 12, 13, 4,
                        23, "digital_option_price_cg");
  }
  if (nlhs > 5) {
    emlrtErrMsgIdAndTxt(&st, "EMLRT:runTime:TooManyOutputArguments", 3, 4, 23,
                        "digital_option_price_cg");
  }
  /* Call the function. */
  digital_option_price_cg_api(prhs, nlhs, outputs);
  /* Copy over outputs to the caller. */
  if (nlhs < 1) {
    i = 1;
  } else {
    i = nlhs;
  }
  emlrtReturnArrays(i, &plhs[0], &outputs[0]);
}

void mexFunction(int32_T nlhs, mxArray *plhs[], int32_T nrhs,
                 const mxArray *prhs[])
{
  mexAtExit(&digital_option_price_cg_atexit);
  digital_option_price_cg_initialize();
  digital_option_price_cg_mexFunction(nlhs, plhs, nrhs, prhs);
  digital_option_price_cg_terminate();
}

emlrtCTX mexFunctionCreateRootTLS(void)
{
  emlrtCreateRootTLSR2022a(&emlrtRootTLSGlobal, &emlrtContextGlobal, NULL, 1,
                           NULL, "UTF-8", true);
  return emlrtRootTLSGlobal;
}

/* End of code generation (_coder_digital_option_price_cg_mex.c) */
