Beispiel #1
0
/* Function Definitions */
void dynamic_size_checks(const emxArray_creal_T *a, const emxArray_creal_T *b)
{
  const mxArray *y;
  static const int32_T iv32[2] = { 1, 45 };

  const mxArray *m5;
  char_T cv18[45];
  int32_T i;
  static const char_T cv19[45] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'm', 't', 'i', 'm', 'e', 's', '_', 'n', 'o', 'D',
    'y', 'n', 'a', 'm', 'i', 'c', 'S', 'c', 'a', 'l', 'a', 'r', 'E', 'x', 'p',
    'a', 'n', 's', 'i', 'o', 'n' };

  const mxArray *b_y;
  static const int32_T iv33[2] = { 1, 21 };

  char_T cv20[21];
  static const char_T cv21[21] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'i', 'n', 'n', 'e', 'r', 'd', 'i', 'm' };

  if (!(a->size[1] == b->size[0])) {
    if (((a->size[0] == 1) && (a->size[1] == 1)) || ((b->size[0] == 1) &&
         (b->size[1] == 1))) {
      emlrtPushRtStackR2012b(&ih_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_synchGlobalsToML();
      y = NULL;
      m5 = mxCreateCharArray(2, iv32);
      for (i = 0; i < 45; i++) {
        cv18[i] = cv19[i];
      }

      emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 45, m5, cv18);
      emlrtAssign(&y, m5);
      error(message(y, &l_emlrtMCI), &m_emlrtMCI);
      emlrt_synchGlobalsFromML();
      emlrtPopRtStackR2012b(&ih_emlrtRSI, emlrtRootTLSGlobal);
    } else {
      emlrtPushRtStackR2012b(&hh_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_synchGlobalsToML();
      b_y = NULL;
      m5 = mxCreateCharArray(2, iv33);
      for (i = 0; i < 21; i++) {
        cv20[i] = cv21[i];
      }

      emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m5, cv20);
      emlrtAssign(&b_y, m5);
      error(message(b_y, &n_emlrtMCI), &o_emlrtMCI);
      emlrt_synchGlobalsFromML();
      emlrtPopRtStackR2012b(&hh_emlrtRSI, emlrtRootTLSGlobal);
    }
  }
}
Beispiel #2
0
static void eml_warning(void)
{
  const mxArray *y;
  static const int32_T iv3[2] = { 1, 27 };

  const mxArray *m2;
  char_T cv4[27];
  int32_T i;
  static const char_T cv5[27] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 's', 'i', 'n', 'g', 'u', 'l', 'a', 'r', 'M', 'a', 't',
    'r', 'i', 'x' };

  emlrtPushRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal);
  emlrt_synchGlobalsToML();
  y = NULL;
  m2 = mxCreateCharArray(2, iv3);
  for (i = 0; i < 27; i++) {
    cv4[i] = cv5[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 27, m2, cv4);
  emlrtAssign(&y, m2);
  warning(b_message(y, &d_emlrtMCI), &e_emlrtMCI);
  emlrt_synchGlobalsFromML();
  emlrtPopRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal);
}
Beispiel #3
0
/* Function Definitions */
static real_T c_fprintf(real_T varargin_1)
{
  real_T nbytes;
  const mxArray *y;
  static const int32_T iv46[2] = { 1, 7 };

  const mxArray *m6;
  char_T cv22[7];
  int32_T i;
  static const char_T cv23[7] = { 'f', 'p', 'r', 'i', 'n', 't', 'f' };

  const mxArray *b_y;
  static const int32_T iv47[2] = { 1, 48 };

  char_T cv24[48];
  static const char_T cv25[48] = { 'E', 'r', 'r', 'o', 'r', ':', ' ', 'm', 'a',
    't', 'r', 'i', 'x', ' ', 's', 'q', 'u', 'a', 'r', 'e', ' ', 'r', 'o', 'o',
    't', ' ', 'r', 'e', 's', 'i', 'd', 'u', 'a', 'l', ' ', 'n', 'o', 'r', 'm',
    ' ', 'i', 's', ' ', '%', 'g', '.', '\\', 'n' };

  emlrtPushRtStackR2012b(&mi_emlrtRSI, emlrtRootTLSGlobal);
  emlrt_synchGlobalsToML();
  y = NULL;
  m6 = mxCreateCharArray(2, iv46);
  for (i = 0; i < 7; i++) {
    cv22[i] = cv23[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 7, m6, cv22);
  emlrtAssign(&y, m6);
  b_y = NULL;
  m6 = mxCreateCharArray(2, iv47);
  for (i = 0; i < 48; i++) {
    cv24[i] = cv25[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 48, m6, cv24);
  emlrtAssign(&b_y, m6);
  nbytes = emlrt_marshallIn(feval(y, emlrt_marshallOut(1.0), b_y,
    emlrt_marshallOut(varargin_1), &p_emlrtMCI), "feval");
  emlrt_synchGlobalsFromML();
  emlrtPopRtStackR2012b(&mi_emlrtRSI, emlrtRootTLSGlobal);
  return nbytes;
}
Beispiel #4
0
static real_T e_fprintf(real_T varargin_1)
{
  real_T nbytes;
  const mxArray *y;
  static const int32_T iv2[2] = { 1, 7 };

  const mxArray *m1;
  char_T cv4[7];
  int32_T i;
  static const char_T cv5[7] = { 'f', 'p', 'r', 'i', 'n', 't', 'f' };

  const mxArray *b_y;
  static const int32_T iv3[2] = { 1, 25 };

  char_T cv6[25];
  static const char_T cv7[25] = { 'B', 'E', 'R', ' ', 'f', 'o', 'r', ' ', 'p',
    'r', 'e', 'a', 'm', 'b', 'l', 'e', ':', ' ', '%', '.', '1', '0', 'f', '\\',
    'n' };

  emlrtPushRtStackR2012b(&d_emlrtRSI, emlrtRootTLSGlobal);
  emlrt_synchGlobalsToML();
  y = NULL;
  m1 = mxCreateCharArray(2, iv2);
  for (i = 0; i < 7; i++) {
    cv4[i] = cv5[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 7, m1, cv4);
  emlrtAssign(&y, m1);
  b_y = NULL;
  m1 = mxCreateCharArray(2, iv3);
  for (i = 0; i < 25; i++) {
    cv6[i] = cv7[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 25, m1, cv6);
  emlrtAssign(&b_y, m1);
  nbytes = emlrt_marshallIn(feval(y, emlrt_marshallOut(1.0), b_y,
    emlrt_marshallOut(varargin_1), &emlrtMCI), "feval");
  emlrt_synchGlobalsFromML();
  emlrtPopRtStackR2012b(&d_emlrtRSI, emlrtRootTLSGlobal);
  return nbytes;
}
Beispiel #5
0
/* Function Definitions */
static real_T c_fprintf(real_T varargin_1)
{
  real_T nbytes;
  const mxArray *y;
  static const int32_T iv0[2] = { 1, 7 };

  const mxArray *m0;
  char_T cv0[7];
  int32_T i;
  static const char_T cv1[7] = { 'f', 'p', 'r', 'i', 'n', 't', 'f' };

  const mxArray *b_y;
  static const int32_T iv1[2] = { 1, 21 };

  char_T cv2[21];
  static const char_T cv3[21] = { 'B', 'E', 'R', ' ', 'f', 'o', 'r', ' ', 'd',
    'a', 't', 'a', ':', ' ', '%', '.', '1', '0', 'f', '\\', 'n' };

  emlrtPushRtStackR2012b(&d_emlrtRSI, emlrtRootTLSGlobal);
  emlrt_synchGlobalsToML();
  y = NULL;
  m0 = mxCreateCharArray(2, iv0);
  for (i = 0; i < 7; i++) {
    cv0[i] = cv1[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 7, m0, cv0);
  emlrtAssign(&y, m0);
  b_y = NULL;
  m0 = mxCreateCharArray(2, iv1);
  for (i = 0; i < 21; i++) {
    cv2[i] = cv3[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m0, cv2);
  emlrtAssign(&b_y, m0);
  nbytes = emlrt_marshallIn(feval(y, emlrt_marshallOut(1.0), b_y,
    emlrt_marshallOut(varargin_1), &emlrtMCI), "feval");
  emlrt_synchGlobalsFromML();
  emlrtPopRtStackR2012b(&d_emlrtRSI, emlrtRootTLSGlobal);
  return nbytes;
}
Beispiel #6
0
void check_forloop_overflow_error(void)
{
  const mxArray *y;
  static const int32_T iv0[2] = { 1, 34 };

  const mxArray *m1;
  char_T cv0[34];
  int32_T i;
  static const char_T cv1[34] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'i', 'n', 't', '_', 'f', 'o', 'r', 'l', 'o', 'o',
    'p', '_', 'o', 'v', 'e', 'r', 'f', 'l', 'o', 'w' };

  const mxArray *b_y;
  static const int32_T iv1[2] = { 1, 23 };

  char_T cv2[23];
  static const char_T cv3[23] = { 'c', 'o', 'd', 'e', 'r', '.', 'i', 'n', 't',
    'e', 'r', 'n', 'a', 'l', '.', 'i', 'n', 'd', 'e', 'x', 'I', 'n', 't' };

  emlrtPushRtStackR2012b(&h_emlrtRSI, emlrtRootTLSGlobal);
  emlrt_synchGlobalsToML();
  y = NULL;
  m1 = mxCreateCharArray(2, iv0);
  for (i = 0; i < 34; i++) {
    cv0[i] = cv1[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 34, m1, cv0);
  emlrtAssign(&y, m1);
  b_y = NULL;
  m1 = mxCreateCharArray(2, iv1);
  for (i = 0; i < 23; i++) {
    cv2[i] = cv3[i];
  }

  emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 23, m1, cv2);
  emlrtAssign(&b_y, m1);
  error(message(y, b_y, &b_emlrtMCI), &c_emlrtMCI);
  emlrt_synchGlobalsFromML();
  emlrtPopRtStackR2012b(&h_emlrtRSI, emlrtRootTLSGlobal);
}
Beispiel #7
0
/* Function Definitions */
real_T signalPower(const emxArray_creal_T *input)
{
  real_T out;
  emxArray_real_T *a;
  emxArray_real_T *b;
  int32_T i2;
  int32_T i;
  const mxArray *y;
  static const int32_T iv11[2] = { 1, 45 };

  const mxArray *m1;
  char_T cv17[45];
  static const char_T cv18[45] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'm', 't', 'i', 'm', 'e', 's', '_', 'n', 'o', 'D',
    'y', 'n', 'a', 'm', 'i', 'c', 'S', 'c', 'a', 'l', 'a', 'r', 'E', 'x', 'p',
    'a', 'n', 's', 'i', 'o', 'n' };

  const mxArray *b_y;
  static const int32_T iv12[2] = { 1, 21 };

  char_T cv19[21];
  static const char_T cv20[21] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'i', 'n', 'n', 'e', 'r', 'd', 'i', 'm' };

  real_T c_y;
  ptrdiff_t n_t;
  ptrdiff_t incx_t;
  ptrdiff_t incy_t;
  double * xix0_t;
  double * yiy0_t;
  emlrtHeapReferenceStackEnterFcnR2012b(emlrtRootTLSGlobal);
  b_emxInit_real_T(&a, 2, &f_emlrtRTEI, TRUE);
  emxInit_real_T(&b, 1, &f_emlrtRTEI, TRUE);

  /* out=input'*input/sentBitsSize; */
  /* out=abs(out); */
  emlrtPushRtStackR2012b(&l_emlrtRSI, emlrtRootTLSGlobal);
  b_abs(input, b);
  i2 = a->size[0] * a->size[1];
  a->size[0] = 1;
  emxEnsureCapacity((emxArray__common *)a, i2, (int32_T)sizeof(real_T),
                    &f_emlrtRTEI);
  i = b->size[0];
  i2 = a->size[0] * a->size[1];
  a->size[1] = i;
  emxEnsureCapacity((emxArray__common *)a, i2, (int32_T)sizeof(real_T),
                    &f_emlrtRTEI);
  i = b->size[0];
  for (i2 = 0; i2 < i; i2++) {
    a->data[i2] = b->data[i2];
  }

  b_abs(input, b);
  emlrtPushRtStackR2012b(&n_emlrtRSI, emlrtRootTLSGlobal);
  if (!(a->size[1] == b->size[0])) {
    if ((a->size[1] == 1) || (b->size[0] == 1)) {
      emlrtPushRtStackR2012b(&p_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_synchGlobalsToML();
      y = NULL;
      m1 = mxCreateCharArray(2, iv11);
      for (i = 0; i < 45; i++) {
        cv17[i] = cv18[i];
      }

      emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 45, m1, cv17);
      emlrtAssign(&y, m1);
      error(message(y, &i_emlrtMCI), &j_emlrtMCI);
      emlrt_synchGlobalsFromML();
      emlrtPopRtStackR2012b(&p_emlrtRSI, emlrtRootTLSGlobal);
    } else {
      emlrtPushRtStackR2012b(&o_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_synchGlobalsToML();
      b_y = NULL;
      m1 = mxCreateCharArray(2, iv12);
      for (i = 0; i < 21; i++) {
        cv19[i] = cv20[i];
      }

      emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m1, cv19);
      emlrtAssign(&b_y, m1);
      error(message(b_y, &k_emlrtMCI), &l_emlrtMCI);
      emlrt_synchGlobalsFromML();
      emlrtPopRtStackR2012b(&o_emlrtRSI, emlrtRootTLSGlobal);
    }
  }

  emlrtPopRtStackR2012b(&n_emlrtRSI, emlrtRootTLSGlobal);
  if ((a->size[1] == 1) || (b->size[0] == 1)) {
    c_y = 0.0;
    for (i2 = 0; i2 < a->size[1]; i2++) {
      c_y += a->data[a->size[0] * i2] * b->data[i2];
    }
  } else {
    emlrtPushRtStackR2012b(&m_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPushRtStackR2012b(&q_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPushRtStackR2012b(&r_emlrtRSI, emlrtRootTLSGlobal);
    if (a->size[1] < 1) {
      c_y = 0.0;
    } else {
      emlrtPushRtStackR2012b(&t_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&y_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&eb_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_checkEscapedGlobals();
      n_t = (ptrdiff_t)(a->size[1]);
      emlrtPopRtStackR2012b(&eb_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPopRtStackR2012b(&y_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&eb_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_checkEscapedGlobals();
      incx_t = (ptrdiff_t)(1);
      emlrtPopRtStackR2012b(&eb_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPopRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&bb_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&eb_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_checkEscapedGlobals();
      incy_t = (ptrdiff_t)(1);
      emlrtPopRtStackR2012b(&eb_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPopRtStackR2012b(&bb_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&cb_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_checkEscapedGlobals();
      xix0_t = (double *)(&a->data[0]);
      emlrtPopRtStackR2012b(&cb_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPushRtStackR2012b(&db_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_checkEscapedGlobals();
      yiy0_t = (double *)(&b->data[0]);
      emlrtPopRtStackR2012b(&db_emlrtRSI, emlrtRootTLSGlobal);
      emlrt_checkEscapedGlobals();
      c_y = ddot(&n_t, xix0_t, &incx_t, yiy0_t, &incy_t);
      emlrtPopRtStackR2012b(&t_emlrtRSI, emlrtRootTLSGlobal);
    }

    emlrtPopRtStackR2012b(&r_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPopRtStackR2012b(&q_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPopRtStackR2012b(&m_emlrtRSI, emlrtRootTLSGlobal);
  }

  emxFree_real_T(&b);
  emxFree_real_T(&a);
  out = c_y / (real_T)input->size[0];
  emlrtPopRtStackR2012b(&l_emlrtRSI, emlrtRootTLSGlobal);
  emlrtHeapReferenceStackLeaveFcnR2012b(emlrtRootTLSGlobal);
  return out;
}
Beispiel #8
0
/* Function Definitions */
void repmat(const real_T a_data[2201], const int32_T a_size[2], real_T m,
            emxArray_real_T *b)
{
  boolean_T p;
  const mxArray *y;
  static const int32_T iv27[2] = { 1, 28 };

  const mxArray *m7;
  char_T cv27[28];
  int32_T i;
  static const char_T cv28[28] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'N', 'o', 'n', 'I', 'n', 't', 'e', 'g', 'e', 'r', 'I',
    'n', 'p', 'u', 't' };

  real_T b_m;
  const mxArray *b_y;
  static const int32_T iv28[2] = { 1, 21 };

  char_T cv29[21];
  static const char_T cv30[21] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'p', 'm', 'a', 'x', 's', 'i', 'z', 'e' };

  int32_T mv[2];
  int32_T outsize[2];
  int32_T ib;
  int32_T iacol;
  int32_T jcol;
  boolean_T b2;
  int32_T itilerow;
  emlrtPushRtStackR2012b(&ki_emlrtRSI, emlrtRootTLSGlobal);
  if ((m != m) || muDoubleScalarIsInf(m)) {
    p = FALSE;
  } else {
    p = TRUE;
  }

  if (p) {
  } else {
    emlrtPushRtStackR2012b(&oi_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    y = NULL;
    m7 = mxCreateCharArray(2, iv27);
    for (i = 0; i < 28; i++) {
      cv27[i] = cv28[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 28, m7, cv27);
    emlrtAssign(&y, m7);
    error(message(y, &s_emlrtMCI), &t_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&oi_emlrtRSI, emlrtRootTLSGlobal);
  }

  if (m <= 0.0) {
    b_m = 0.0;
  } else {
    b_m = m;
  }

  if (2.147483647E+9 >= b_m) {
  } else {
    emlrtPushRtStackR2012b(&pi_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    b_y = NULL;
    m7 = mxCreateCharArray(2, iv28);
    for (i = 0; i < 21; i++) {
      cv29[i] = cv30[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m7, cv29);
    emlrtAssign(&b_y, m7);
    error(message(b_y, &u_emlrtMCI), &v_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&pi_emlrtRSI, emlrtRootTLSGlobal);
  }

  emlrtPopRtStackR2012b(&ki_emlrtRSI, emlrtRootTLSGlobal);
  mv[0] = (int32_T)m;
  mv[1] = 1;
  for (i = 0; i < 2; i++) {
    outsize[i] = a_size[i] * mv[i];
  }

  i = b->size[0] * b->size[1];
  b->size[0] = outsize[0];
  b->size[1] = outsize[1];
  emxEnsureCapacity((emxArray__common *)b, i, (int32_T)sizeof(real_T),
                    &y_emlrtRTEI);
  if (outsize[0] == 0) {
  } else {
    i = 0;
    ib = 0;
    emlrtPushRtStackR2012b(&li_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPopRtStackR2012b(&li_emlrtRSI, emlrtRootTLSGlobal);
    iacol = 0;
    emlrtPushRtStackR2012b(&mi_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPopRtStackR2012b(&mi_emlrtRSI, emlrtRootTLSGlobal);
    for (jcol = 1; jcol <= a_size[1]; jcol++) {
      emlrtPushRtStackR2012b(&ni_emlrtRSI, emlrtRootTLSGlobal);
      if (1 > (int32_T)m) {
        b2 = FALSE;
      } else {
        b2 = ((int32_T)m > 2147483646);
      }

      if (b2) {
        emlrtPushRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
        check_forloop_overflow_error();
        emlrtPopRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
      }

      emlrtPopRtStackR2012b(&ni_emlrtRSI, emlrtRootTLSGlobal);
      for (itilerow = 1; itilerow <= (int32_T)m; itilerow++) {
        b->data[ib] = a_data[iacol];
        i = iacol + 1;
        ib++;
      }

      iacol = i;
    }
  }
}
Beispiel #9
0
/* Function Definitions */
void eye(real_T n, emxArray_real_T *I)
{
  boolean_T p;
  const mxArray *y;
  static const int32_T iv37[2] = { 1, 28 };

  const mxArray *m11;
  char_T cv43[28];
  int32_T i;
  static const char_T cv44[28] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'N', 'o', 'n', 'I', 'n', 't', 'e', 'g', 'e', 'r', 'I',
    'n', 'p', 'u', 't' };

  const mxArray *b_y;
  static const int32_T iv38[2] = { 1, 28 };

  real_T b_n;
  real_T c_n;
  const mxArray *c_y;
  static const int32_T iv39[2] = { 1, 21 };

  char_T cv45[21];
  static const char_T cv46[21] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 'p', 'm', 'a', 'x', 's', 'i', 'z', 'e' };

  int32_T loop_ub;
  real_T minval;
  boolean_T b6;
  emlrtPushRtStackR2012b(&dm_emlrtRSI, emlrtRootTLSGlobal);
  emlrtPushRtStackR2012b(&em_emlrtRSI, emlrtRootTLSGlobal);
  if ((n != n) || muDoubleScalarIsInf(n)) {
    p = FALSE;
  } else {
    p = TRUE;
  }

  if (p) {
  } else {
    emlrtPushRtStackR2012b(&oi_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    y = NULL;
    m11 = mxCreateCharArray(2, iv37);
    for (i = 0; i < 28; i++) {
      cv43[i] = cv44[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 28, m11, cv43);
    emlrtAssign(&y, m11);
    error(message(y, &s_emlrtMCI), &t_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&oi_emlrtRSI, emlrtRootTLSGlobal);
  }

  if ((n != n) || muDoubleScalarIsInf(n)) {
    p = FALSE;
  } else {
    p = TRUE;
  }

  if (p) {
  } else {
    emlrtPushRtStackR2012b(&oi_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    b_y = NULL;
    m11 = mxCreateCharArray(2, iv38);
    for (i = 0; i < 28; i++) {
      cv43[i] = cv44[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 28, m11, cv43);
    emlrtAssign(&b_y, m11);
    error(message(b_y, &s_emlrtMCI), &t_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&oi_emlrtRSI, emlrtRootTLSGlobal);
  }

  if (n <= 0.0) {
    b_n = 0.0;
  } else {
    if (n <= 0.0) {
      c_n = 0.0;
    } else {
      c_n = n;
    }

    b_n = c_n * n;
  }

  if (2.147483647E+9 >= b_n) {
  } else {
    emlrtPushRtStackR2012b(&pi_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    c_y = NULL;
    m11 = mxCreateCharArray(2, iv39);
    for (i = 0; i < 21; i++) {
      cv45[i] = cv46[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m11, cv45);
    emlrtAssign(&c_y, m11);
    error(message(c_y, &u_emlrtMCI), &v_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&pi_emlrtRSI, emlrtRootTLSGlobal);
  }

  emlrtPopRtStackR2012b(&em_emlrtRSI, emlrtRootTLSGlobal);
  i = I->size[0] * I->size[1];
  I->size[0] = (int32_T)n;
  I->size[1] = (int32_T)n;
  emxEnsureCapacity((emxArray__common *)I, i, (int32_T)sizeof(real_T),
                    &pb_emlrtRTEI);
  loop_ub = (int32_T)n * (int32_T)n;
  for (i = 0; i < loop_ub; i++) {
    I->data[i] = 0.0;
  }

  minval = muDoubleScalarMin(n, n);
  if ((int32_T)minval > 0) {
    emlrtPushRtStackR2012b(&fm_emlrtRSI, emlrtRootTLSGlobal);
    if (1 > (int32_T)minval) {
      b6 = FALSE;
    } else {
      b6 = ((int32_T)minval > 2147483646);
    }

    if (b6) {
      emlrtPushRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
      check_forloop_overflow_error();
      emlrtPopRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
    }

    emlrtPopRtStackR2012b(&fm_emlrtRSI, emlrtRootTLSGlobal);
    for (i = 0; i + 1 <= (int32_T)minval; i++) {
      I->data[i + I->size[0] * i] = 1.0;
    }
  }

  emlrtPopRtStackR2012b(&dm_emlrtRSI, emlrtRootTLSGlobal);
}
Beispiel #10
0
void sqrtm(const emxArray_real_T *A, emxArray_creal_T *X, real_T *arg2)
{
  emxArray_creal_T *T;
  emxArray_creal_T *y;
  boolean_T b0;
  const mxArray *b_y;
  static const int32_T iv40[2] = { 1, 19 };

  const mxArray *m2;
  char_T cv12[19];
  int32_T i;
  static const char_T cv13[19] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T',
    'L', 'A', 'B', ':', 's', 'q', 'u', 'a', 'r', 'e' };

  emxArray_creal_T *Q;
  emxArray_creal_T *r25;
  int32_T loop_ub;
  int16_T iv41[2];
  emxArray_creal_T *R;
  real_T s_re;
  real_T s_im;
  int32_T k;
  real_T R_re;
  real_T R_im;
  real_T T_re;
  real_T T_im;
  real_T brm;
  int32_T i1;
  int32_T b_loop_ub;
  int32_T i2;
  emxArray_creal_T *b_T;
  emxArray_real_T *b_X;
  emlrtHeapReferenceStackEnterFcnR2012b(emlrtRootTLSGlobal);
  emxInit_creal_T(&T, 2, &k_emlrtRTEI, TRUE);
  emxInit_creal_T(&y, 2, &k_emlrtRTEI, TRUE);
  b0 = (A->size[0] == A->size[1]);
  if (b0) {
  } else {
    emlrtPushRtStackR2012b(&hb_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    b_y = NULL;
    m2 = mxCreateCharArray(2, iv40);
    for (i = 0; i < 19; i++) {
      cv12[i] = cv13[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 19, m2, cv12);
    emlrtAssign(&b_y, m2);
    error(message(b_y, &f_emlrtMCI), &g_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&hb_emlrtRSI, emlrtRootTLSGlobal);
  }

  emxInit_creal_T(&Q, 2, &k_emlrtRTEI, TRUE);
  emxInit_creal_T(&r25, 2, &k_emlrtRTEI, TRUE);
  emlrtPushRtStackR2012b(&ib_emlrtRSI, emlrtRootTLSGlobal);
  schur(A, Q, r25);
  i = T->size[0] * T->size[1];
  T->size[0] = r25->size[0];
  T->size[1] = r25->size[1];
  emxEnsureCapacity((emxArray__common *)T, i, (int32_T)sizeof(creal_T),
                    &k_emlrtRTEI);
  loop_ub = r25->size[0] * r25->size[1];
  for (i = 0; i < loop_ub; i++) {
    T->data[i] = r25->data[i];
  }

  emxFree_creal_T(&r25);
  emlrtPopRtStackR2012b(&ib_emlrtRSI, emlrtRootTLSGlobal);
  for (i = 0; i < 2; i++) {
    iv41[i] = (int16_T)T->size[i];
  }

  emxInit_creal_T(&R, 2, &l_emlrtRTEI, TRUE);
  i = R->size[0] * R->size[1];
  R->size[0] = iv41[0];
  emxEnsureCapacity((emxArray__common *)R, i, (int32_T)sizeof(creal_T),
                    &k_emlrtRTEI);
  i = R->size[0] * R->size[1];
  R->size[1] = iv41[1];
  emxEnsureCapacity((emxArray__common *)R, i, (int32_T)sizeof(creal_T),
                    &k_emlrtRTEI);
  loop_ub = iv41[0] * iv41[1];
  for (i = 0; i < loop_ub; i++) {
    R->data[i].re = 0.0;
    R->data[i].im = 0.0;
  }

  emlrtPushRtStackR2012b(&jb_emlrtRSI, emlrtRootTLSGlobal);
  b0 = isUTmatD(T);
  emlrtPopRtStackR2012b(&jb_emlrtRSI, emlrtRootTLSGlobal);
  if (b0) {
    emlrtPushRtStackR2012b(&kb_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPopRtStackR2012b(&kb_emlrtRSI, emlrtRootTLSGlobal);
    for (loop_ub = 0; loop_ub + 1 <= A->size[0]; loop_ub++) {
      R->data[loop_ub + R->size[0] * loop_ub] = T->data[loop_ub + T->size[0] *
        loop_ub];
      c_sqrt(&R->data[loop_ub + R->size[0] * loop_ub]);
    }
  } else {
    emlrtPushRtStackR2012b(&lb_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPopRtStackR2012b(&lb_emlrtRSI, emlrtRootTLSGlobal);
    for (loop_ub = 0; loop_ub + 1 <= A->size[0]; loop_ub++) {
      R->data[loop_ub + R->size[0] * loop_ub] = T->data[loop_ub + T->size[0] *
        loop_ub];
      c_sqrt(&R->data[loop_ub + R->size[0] * loop_ub]);
      for (i = loop_ub - 1; i + 1 > 0; i--) {
        s_re = 0.0;
        s_im = 0.0;
        emlrtPushRtStackR2012b(&mb_emlrtRSI, emlrtRootTLSGlobal);
        emlrtPopRtStackR2012b(&mb_emlrtRSI, emlrtRootTLSGlobal);
        for (k = i + 1; k + 1 <= loop_ub; k++) {
          R_re = R->data[i + R->size[0] * k].re * R->data[k + R->size[0] *
            loop_ub].re - R->data[i + R->size[0] * k].im * R->data[k + R->size[0]
            * loop_ub].im;
          R_im = R->data[i + R->size[0] * k].re * R->data[k + R->size[0] *
            loop_ub].im + R->data[i + R->size[0] * k].im * R->data[k + R->size[0]
            * loop_ub].re;
          s_re += R_re;
          s_im += R_im;
        }

        T_re = T->data[i + T->size[0] * loop_ub].re - s_re;
        T_im = T->data[i + T->size[0] * loop_ub].im - s_im;
        R_re = R->data[i + R->size[0] * i].re + R->data[loop_ub + R->size[0] *
          loop_ub].re;
        R_im = R->data[i + R->size[0] * i].im + R->data[loop_ub + R->size[0] *
          loop_ub].im;
        if (R_im == 0.0) {
          if (T_im == 0.0) {
            R->data[i + R->size[0] * loop_ub].re = T_re / R_re;
            R->data[i + R->size[0] * loop_ub].im = 0.0;
          } else if (T_re == 0.0) {
            R->data[i + R->size[0] * loop_ub].re = 0.0;
            R->data[i + R->size[0] * loop_ub].im = T_im / R_re;
          } else {
            R->data[i + R->size[0] * loop_ub].re = T_re / R_re;
            R->data[i + R->size[0] * loop_ub].im = T_im / R_re;
          }
        } else if (R_re == 0.0) {
          if (T_re == 0.0) {
            R->data[i + R->size[0] * loop_ub].re = T_im / R_im;
            R->data[i + R->size[0] * loop_ub].im = 0.0;
          } else if (T_im == 0.0) {
            R->data[i + R->size[0] * loop_ub].re = 0.0;
            R->data[i + R->size[0] * loop_ub].im = -(T_re / R_im);
          } else {
            R->data[i + R->size[0] * loop_ub].re = T_im / R_im;
            R->data[i + R->size[0] * loop_ub].im = -(T_re / R_im);
          }
        } else {
          brm = muDoubleScalarAbs(R_re);
          s_re = muDoubleScalarAbs(R_im);
          if (brm > s_re) {
            s_re = R_im / R_re;
            s_im = R_re + s_re * R_im;
            R->data[i + R->size[0] * loop_ub].re = (T_re + s_re * T_im) / s_im;
            R->data[i + R->size[0] * loop_ub].im = (T_im - s_re * T_re) / s_im;
          } else if (s_re == brm) {
            if (R_re > 0.0) {
              s_im = 0.5;
            } else {
              s_im = -0.5;
            }

            if (R_im > 0.0) {
              s_re = 0.5;
            } else {
              s_re = -0.5;
            }

            R->data[i + R->size[0] * loop_ub].re = (T_re * s_im + T_im * s_re) /
              brm;
            R->data[i + R->size[0] * loop_ub].im = (T_im * s_im - T_re * s_re) /
              brm;
          } else {
            s_re = R_re / R_im;
            s_im = R_im + s_re * R_re;
            R->data[i + R->size[0] * loop_ub].re = (s_re * T_re + T_im) / s_im;
            R->data[i + R->size[0] * loop_ub].im = (s_re * T_im - T_re) / s_im;
          }
        }
      }
    }
  }

  emlrtPushRtStackR2012b(&nb_emlrtRSI, emlrtRootTLSGlobal);
  emlrtPushRtStackR2012b(&kh_emlrtRSI, emlrtRootTLSGlobal);
  dynamic_size_checks(Q, R);
  emlrtPopRtStackR2012b(&kh_emlrtRSI, emlrtRootTLSGlobal);
  if ((Q->size[1] == 1) || (R->size[0] == 1)) {
    i = y->size[0] * y->size[1];
    y->size[0] = Q->size[0];
    y->size[1] = R->size[1];
    emxEnsureCapacity((emxArray__common *)y, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    loop_ub = Q->size[0];
    for (i = 0; i < loop_ub; i++) {
      k = R->size[1];
      for (i1 = 0; i1 < k; i1++) {
        y->data[i + y->size[0] * i1].re = 0.0;
        y->data[i + y->size[0] * i1].im = 0.0;
        b_loop_ub = Q->size[1];
        for (i2 = 0; i2 < b_loop_ub; i2++) {
          s_re = Q->data[i + Q->size[0] * i2].re * R->data[i2 + R->size[0] * i1]
            .re - Q->data[i + Q->size[0] * i2].im * R->data[i2 + R->size[0] * i1]
            .im;
          s_im = Q->data[i + Q->size[0] * i2].re * R->data[i2 + R->size[0] * i1]
            .im + Q->data[i + Q->size[0] * i2].im * R->data[i2 + R->size[0] * i1]
            .re;
          y->data[i + y->size[0] * i1].re += s_re;
          y->data[i + y->size[0] * i1].im += s_im;
        }
      }
    }
  } else {
    iv41[0] = (int16_T)Q->size[0];
    iv41[1] = (int16_T)R->size[1];
    emlrtPushRtStackR2012b(&jh_emlrtRSI, emlrtRootTLSGlobal);
    i = y->size[0] * y->size[1];
    y->size[0] = iv41[0];
    emxEnsureCapacity((emxArray__common *)y, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    i = y->size[0] * y->size[1];
    y->size[1] = iv41[1];
    emxEnsureCapacity((emxArray__common *)y, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    loop_ub = iv41[0] * iv41[1];
    for (i = 0; i < loop_ub; i++) {
      y->data[i].re = 0.0;
      y->data[i].im = 0.0;
    }

    eml_xgemm(Q->size[0], R->size[1], Q->size[1], Q, Q->size[0], R, Q->size[1],
              y, Q->size[0]);
    emlrtPopRtStackR2012b(&jh_emlrtRSI, emlrtRootTLSGlobal);
  }

  emxFree_creal_T(&R);
  i = T->size[0] * T->size[1];
  T->size[0] = Q->size[1];
  T->size[1] = Q->size[0];
  emxEnsureCapacity((emxArray__common *)T, i, (int32_T)sizeof(creal_T),
                    &k_emlrtRTEI);
  loop_ub = Q->size[0];
  for (i = 0; i < loop_ub; i++) {
    k = Q->size[1];
    for (i1 = 0; i1 < k; i1++) {
      T->data[i1 + T->size[0] * i].re = Q->data[i + Q->size[0] * i1].re;
      T->data[i1 + T->size[0] * i].im = -Q->data[i + Q->size[0] * i1].im;
    }
  }

  emxFree_creal_T(&Q);
  emlrtPushRtStackR2012b(&kh_emlrtRSI, emlrtRootTLSGlobal);
  dynamic_size_checks(y, T);
  emlrtPopRtStackR2012b(&kh_emlrtRSI, emlrtRootTLSGlobal);
  if ((y->size[1] == 1) || (T->size[0] == 1)) {
    i = X->size[0] * X->size[1];
    X->size[0] = y->size[0];
    X->size[1] = T->size[1];
    emxEnsureCapacity((emxArray__common *)X, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    loop_ub = y->size[0];
    for (i = 0; i < loop_ub; i++) {
      k = T->size[1];
      for (i1 = 0; i1 < k; i1++) {
        X->data[i + X->size[0] * i1].re = 0.0;
        X->data[i + X->size[0] * i1].im = 0.0;
        b_loop_ub = y->size[1];
        for (i2 = 0; i2 < b_loop_ub; i2++) {
          s_re = y->data[i + y->size[0] * i2].re * T->data[i2 + T->size[0] * i1]
            .re - y->data[i + y->size[0] * i2].im * T->data[i2 + T->size[0] * i1]
            .im;
          s_im = y->data[i + y->size[0] * i2].re * T->data[i2 + T->size[0] * i1]
            .im + y->data[i + y->size[0] * i2].im * T->data[i2 + T->size[0] * i1]
            .re;
          X->data[i + X->size[0] * i1].re += s_re;
          X->data[i + X->size[0] * i1].im += s_im;
        }
      }
    }
  } else {
    iv41[0] = (int16_T)y->size[0];
    iv41[1] = (int16_T)T->size[1];
    emlrtPushRtStackR2012b(&jh_emlrtRSI, emlrtRootTLSGlobal);
    i = X->size[0] * X->size[1];
    X->size[0] = iv41[0];
    emxEnsureCapacity((emxArray__common *)X, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    i = X->size[0] * X->size[1];
    X->size[1] = iv41[1];
    emxEnsureCapacity((emxArray__common *)X, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    loop_ub = iv41[0] * iv41[1];
    for (i = 0; i < loop_ub; i++) {
      X->data[i].re = 0.0;
      X->data[i].im = 0.0;
    }

    eml_xgemm(y->size[0], T->size[1], y->size[1], y, y->size[0], T, y->size[1],
              X, y->size[0]);
    emlrtPopRtStackR2012b(&jh_emlrtRSI, emlrtRootTLSGlobal);
  }

  emlrtPopRtStackR2012b(&nb_emlrtRSI, emlrtRootTLSGlobal);
  emlrtPushRtStackR2012b(&ob_emlrtRSI, emlrtRootTLSGlobal);
  emlrtPushRtStackR2012b(&kh_emlrtRSI, emlrtRootTLSGlobal);
  dynamic_size_checks(X, X);
  emlrtPopRtStackR2012b(&kh_emlrtRSI, emlrtRootTLSGlobal);
  if ((X->size[1] == 1) || (X->size[0] == 1)) {
    i = T->size[0] * T->size[1];
    T->size[0] = X->size[0];
    T->size[1] = X->size[1];
    emxEnsureCapacity((emxArray__common *)T, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    loop_ub = X->size[0];
    for (i = 0; i < loop_ub; i++) {
      k = X->size[1];
      for (i1 = 0; i1 < k; i1++) {
        T->data[i + T->size[0] * i1].re = 0.0;
        T->data[i + T->size[0] * i1].im = 0.0;
        b_loop_ub = X->size[1];
        for (i2 = 0; i2 < b_loop_ub; i2++) {
          s_re = X->data[i + X->size[0] * i2].re * X->data[i2 + X->size[0] * i1]
            .re - X->data[i + X->size[0] * i2].im * X->data[i2 + X->size[0] * i1]
            .im;
          s_im = X->data[i + X->size[0] * i2].re * X->data[i2 + X->size[0] * i1]
            .im + X->data[i + X->size[0] * i2].im * X->data[i2 + X->size[0] * i1]
            .re;
          T->data[i + T->size[0] * i1].re += s_re;
          T->data[i + T->size[0] * i1].im += s_im;
        }
      }
    }
  } else {
    iv41[0] = (int16_T)X->size[0];
    iv41[1] = (int16_T)X->size[1];
    emlrtPushRtStackR2012b(&jh_emlrtRSI, emlrtRootTLSGlobal);
    i = T->size[0] * T->size[1];
    T->size[0] = iv41[0];
    emxEnsureCapacity((emxArray__common *)T, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    i = T->size[0] * T->size[1];
    T->size[1] = iv41[1];
    emxEnsureCapacity((emxArray__common *)T, i, (int32_T)sizeof(creal_T),
                      &k_emlrtRTEI);
    loop_ub = iv41[0] * iv41[1];
    for (i = 0; i < loop_ub; i++) {
      T->data[i].re = 0.0;
      T->data[i].im = 0.0;
    }

    eml_xgemm(X->size[0], X->size[1], X->size[1], X, X->size[0], X, X->size[1],
              T, X->size[0]);
    emlrtPopRtStackR2012b(&jh_emlrtRSI, emlrtRootTLSGlobal);
  }

  emxInit_creal_T(&b_T, 2, &k_emlrtRTEI, TRUE);
  emlrtPopRtStackR2012b(&ob_emlrtRSI, emlrtRootTLSGlobal);
  emlrtPushRtStackR2012b(&ob_emlrtRSI, emlrtRootTLSGlobal);
  i = b_T->size[0] * b_T->size[1];
  b_T->size[0] = T->size[0];
  b_T->size[1] = T->size[1];
  emxEnsureCapacity((emxArray__common *)b_T, i, (int32_T)sizeof(creal_T),
                    &k_emlrtRTEI);
  loop_ub = T->size[0] * T->size[1];
  for (i = 0; i < loop_ub; i++) {
    b_T->data[i].re = T->data[i].re - A->data[i];
    b_T->data[i].im = T->data[i].im;
  }

  emxInit_real_T(&b_X, 2, &k_emlrtRTEI, TRUE);
  s_re = norm(b_T);
  s_im = b_norm(A);
  *arg2 = s_re / s_im;
  emlrtPopRtStackR2012b(&ob_emlrtRSI, emlrtRootTLSGlobal);
  i = b_X->size[0] * b_X->size[1];
  b_X->size[0] = X->size[0];
  b_X->size[1] = X->size[1];
  emxEnsureCapacity((emxArray__common *)b_X, i, (int32_T)sizeof(real_T),
                    &k_emlrtRTEI);
  loop_ub = X->size[0] * X->size[1];
  emxFree_creal_T(&b_T);
  for (i = 0; i < loop_ub; i++) {
    b_X->data[i] = X->data[i].im;
  }

  if (c_norm(b_X) <= 10.0 * (real_T)A->size[0] * 2.2204460492503131E-16 * d_norm
      (X)) {
    emlrtPushRtStackR2012b(&pb_emlrtRSI, emlrtRootTLSGlobal);
    emlrtPopRtStackR2012b(&pb_emlrtRSI, emlrtRootTLSGlobal);
    for (loop_ub = 0; loop_ub + 1 <= A->size[0]; loop_ub++) {
      emlrtPushRtStackR2012b(&qb_emlrtRSI, emlrtRootTLSGlobal);
      emlrtPopRtStackR2012b(&qb_emlrtRSI, emlrtRootTLSGlobal);
      for (i = 0; i + 1 <= A->size[0]; i++) {
        s_re = X->data[i + X->size[0] * loop_ub].re;
        X->data[i + X->size[0] * loop_ub].re = s_re;
        X->data[i + X->size[0] * loop_ub].im = 0.0;
      }
    }
  }

  emxFree_real_T(&b_X);
  emxFree_creal_T(&y);
  emxFree_creal_T(&T);
  emlrtHeapReferenceStackLeaveFcnR2012b(emlrtRootTLSGlobal);
}
Beispiel #11
0
/* Function Definitions */
void any(const emxArray_boolean_T *x, emxArray_boolean_T *y)
{
  boolean_T overflow;
  boolean_T p;
  int32_T i;
  int32_T exitg2;
  const mxArray *b_y;
  static const int32_T iv33[2] = { 1, 41 };

  const mxArray *m9;
  char_T cv35[41];
  static const char_T cv36[41] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'e', 'm', 'l', '_', 'a', 'l', 'l', '_', 'o', 'r',
    '_', 'a', 'n', 'y', '_', 's', 'p', 'e', 'c', 'i', 'a', 'l', 'E', 'm', 'p',
    't', 'y' };

  const mxArray *c_y;
  static const int32_T iv34[2] = { 1, 51 };

  char_T cv37[51];
  static const char_T cv38[51] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'e', 'm', 'l', '_', 'a', 'l', 'l', '_', 'o', 'r',
    '_', 'a', 'n', 'y', '_', 'a', 'u', 't', 'o', 'D', 'i', 'm', 'I', 'n', 'c',
    'o', 'm', 'p', 'a', 't', 'i', 'b', 'i', 'l', 'i', 't', 'y' };

  uint32_T outsize[2];
  int32_T i2;
  int32_T iy;
  int32_T i1;
  boolean_T b_i1;
  boolean_T exitg1;
  emlrtPushRtStackR2012b(&gj_emlrtRSI, emlrtRootTLSGlobal);
  overflow = FALSE;
  p = FALSE;
  i = 0;
  do {
    exitg2 = 0;
    if (i < 2) {
      if (x->size[i] != 0) {
        exitg2 = 1;
      } else {
        i++;
      }
    } else {
      p = TRUE;
      exitg2 = 1;
    }
  } while (exitg2 == 0);

  if (!p) {
  } else {
    overflow = TRUE;
  }

  if (!overflow) {
  } else {
    emlrtPushRtStackR2012b(&hj_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    b_y = NULL;
    m9 = mxCreateCharArray(2, iv33);
    for (i = 0; i < 41; i++) {
      cv35[i] = cv36[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 41, m9, cv35);
    emlrtAssign(&b_y, m9);
    error(message(b_y, &bb_emlrtMCI), &cb_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&hj_emlrtRSI, emlrtRootTLSGlobal);
  }

  if (((x->size[0] == 1) && (x->size[1] == 1)) || (x->size[0] != 1)) {
    overflow = TRUE;
  } else {
    overflow = FALSE;
  }

  if (overflow) {
  } else {
    emlrtPushRtStackR2012b(&ij_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    c_y = NULL;
    m9 = mxCreateCharArray(2, iv34);
    for (i = 0; i < 51; i++) {
      cv37[i] = cv38[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 51, m9, cv37);
    emlrtAssign(&c_y, m9);
    error(message(c_y, &db_emlrtMCI), &eb_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&ij_emlrtRSI, emlrtRootTLSGlobal);
  }

  for (i = 0; i < 2; i++) {
    outsize[i] = (uint32_T)x->size[i];
  }

  i = y->size[0] * y->size[1];
  y->size[0] = 1;
  emxEnsureCapacity((emxArray__common *)y, i, (int32_T)sizeof(boolean_T),
                    &hb_emlrtRTEI);
  i = y->size[0] * y->size[1];
  y->size[1] = (int32_T)outsize[1];
  emxEnsureCapacity((emxArray__common *)y, i, (int32_T)sizeof(boolean_T),
                    &hb_emlrtRTEI);
  i2 = (int32_T)outsize[1];
  for (i = 0; i < i2; i++) {
    y->data[i] = FALSE;
  }

  i2 = 0;
  iy = -1;
  emlrtPushRtStackR2012b(&oj_emlrtRSI, emlrtRootTLSGlobal);
  if (1 > x->size[1]) {
    overflow = FALSE;
  } else {
    overflow = (x->size[1] > 2147483646);
  }

  if (overflow) {
    emlrtPushRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
    check_forloop_overflow_error();
    emlrtPopRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
  }

  emlrtPopRtStackR2012b(&oj_emlrtRSI, emlrtRootTLSGlobal);
  for (i = 1; i <= x->size[1]; i++) {
    i1 = i2 + 1;
    i2 += x->size[0];
    iy++;
    emlrtPushRtStackR2012b(&jj_emlrtRSI, emlrtRootTLSGlobal);
    if (i1 > i2) {
      b_i1 = FALSE;
    } else {
      b_i1 = (i2 > 2147483646);
    }

    if (b_i1) {
      emlrtPushRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
      check_forloop_overflow_error();
      emlrtPopRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
    }

    emlrtPopRtStackR2012b(&jj_emlrtRSI, emlrtRootTLSGlobal);
    exitg1 = FALSE;
    while ((exitg1 == FALSE) && (i1 <= i2)) {
      overflow = (x->data[i1 - 1] == 0);
      if (!overflow) {
        y->data[iy] = TRUE;
        exitg1 = TRUE;
      } else {
        i1++;
      }
    }
  }

  emlrtPopRtStackR2012b(&gj_emlrtRSI, emlrtRootTLSGlobal);
}
Beispiel #12
0
boolean_T b_any(const emxArray_boolean_T *x)
{
  boolean_T y;
  boolean_T overflow;
  boolean_T p;
  int32_T i;
  int32_T exitg2;
  const mxArray *b_y;
  static const int32_T iv35[2] = { 1, 41 };

  const mxArray *m10;
  char_T cv39[41];
  static const char_T cv40[41] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'e', 'm', 'l', '_', 'a', 'l', 'l', '_', 'o', 'r',
    '_', 'a', 'n', 'y', '_', 's', 'p', 'e', 'c', 'i', 'a', 'l', 'E', 'm', 'p',
    't', 'y' };

  const mxArray *c_y;
  static const int32_T iv36[2] = { 1, 51 };

  char_T cv41[51];
  static const char_T cv42[51] = { 'C', 'o', 'd', 'e', 'r', ':', 't', 'o', 'o',
    'l', 'b', 'o', 'x', ':', 'e', 'm', 'l', '_', 'a', 'l', 'l', '_', 'o', 'r',
    '_', 'a', 'n', 'y', '_', 'a', 'u', 't', 'o', 'D', 'i', 'm', 'I', 'n', 'c',
    'o', 'm', 'p', 'a', 't', 'i', 'b', 'i', 'l', 'i', 't', 'y' };

  boolean_T exitg1;
  emlrtPushRtStackR2012b(&gj_emlrtRSI, emlrtRootTLSGlobal);
  overflow = FALSE;
  p = FALSE;
  i = 0;
  do {
    exitg2 = 0;
    if (i < 2) {
      if (x->size[i] != 0) {
        exitg2 = 1;
      } else {
        i++;
      }
    } else {
      p = TRUE;
      exitg2 = 1;
    }
  } while (exitg2 == 0);

  if (!p) {
  } else {
    overflow = TRUE;
  }

  if (!overflow) {
  } else {
    emlrtPushRtStackR2012b(&hj_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    b_y = NULL;
    m10 = mxCreateCharArray(2, iv35);
    for (i = 0; i < 41; i++) {
      cv39[i] = cv40[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 41, m10, cv39);
    emlrtAssign(&b_y, m10);
    error(message(b_y, &bb_emlrtMCI), &cb_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&hj_emlrtRSI, emlrtRootTLSGlobal);
  }

  if ((x->size[1] == 1) || (x->size[1] != 1)) {
    overflow = TRUE;
  } else {
    overflow = FALSE;
  }

  if (overflow) {
  } else {
    emlrtPushRtStackR2012b(&ij_emlrtRSI, emlrtRootTLSGlobal);
    emlrt_synchGlobalsToML();
    c_y = NULL;
    m10 = mxCreateCharArray(2, iv36);
    for (i = 0; i < 51; i++) {
      cv41[i] = cv42[i];
    }

    emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 51, m10, cv41);
    emlrtAssign(&c_y, m10);
    error(message(c_y, &db_emlrtMCI), &eb_emlrtMCI);
    emlrt_synchGlobalsFromML();
    emlrtPopRtStackR2012b(&ij_emlrtRSI, emlrtRootTLSGlobal);
  }

  y = FALSE;
  emlrtPushRtStackR2012b(&jj_emlrtRSI, emlrtRootTLSGlobal);
  if (1 > x->size[1]) {
    overflow = FALSE;
  } else {
    overflow = (x->size[1] > 2147483646);
  }

  if (overflow) {
    emlrtPushRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
    check_forloop_overflow_error();
    emlrtPopRtStackR2012b(&ab_emlrtRSI, emlrtRootTLSGlobal);
  }

  emlrtPopRtStackR2012b(&jj_emlrtRSI, emlrtRootTLSGlobal);
  i = 1;
  exitg1 = FALSE;
  while ((exitg1 == FALSE) && (i <= x->size[1])) {
    overflow = (x->data[i - 1] == 0);
    if (!overflow) {
      y = TRUE;
      exitg1 = TRUE;
    } else {
      i++;
    }
  }

  emlrtPopRtStackR2012b(&gj_emlrtRSI, emlrtRootTLSGlobal);
  return y;
}