/* * any.c * * Code generation for function 'any' * * C source code generated on: Wed Aug 26 14:59:33 2015 * */ /* Include files */ #include "rt_nonfinite.h" #include "Select_Ground_Motions.h" #include "any.h" #include "isequal.h" #include "Select_Ground_Motions_emxutil.h" #include "Select_Ground_Motions_mexutil.h" #include "Select_Ground_Motions_data.h" /* Variable Definitions */ static emlrtRSInfo nc_emlrtRSI = { 12, "any", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/ops/any.m" }; static emlrtRTEInfo ad_emlrtRTEI = { 1, 14, "any", "/usr/local/MATLAB/R2013a/toolbox/eml/lib/matlab/ops/any.m" }; /* Function Definitions */ boolean_T any(const emxArray_boolean_T *x) { boolean_T y; boolean_T overflow; const mxArray *b_y; static const int32_T iv20[2] = { 1, 41 }; const mxArray *m2; char_T cv14[41]; int32_T i; static const char_T cv15[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 iv21[2] = { 1, 51 }; char_T cv16[51]; static const char_T cv17[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(&nc_emlrtRSI, emlrtRootTLSGlobal); overflow = !isequal(x); if (overflow) { } else { emlrtPushRtStackR2012b(&oc_emlrtRSI, emlrtRootTLSGlobal); b_y = NULL; m2 = mxCreateCharArray(2, iv20); for (i = 0; i < 41; i++) { cv14[i] = cv15[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 41, m2, cv14); emlrtAssign(&b_y, m2); error(message(b_y, &i_emlrtMCI), &j_emlrtMCI); emlrtPopRtStackR2012b(&oc_emlrtRSI, emlrtRootTLSGlobal); } if ((x->size[1] == 1) || (x->size[1] != 1)) { overflow = TRUE; } else { overflow = FALSE; } if (overflow) { } else { emlrtPushRtStackR2012b(&pc_emlrtRSI, emlrtRootTLSGlobal); c_y = NULL; m2 = mxCreateCharArray(2, iv21); for (i = 0; i < 51; i++) { cv16[i] = cv17[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 51, m2, cv16); emlrtAssign(&c_y, m2); error(message(c_y, &k_emlrtMCI), &l_emlrtMCI); emlrtPopRtStackR2012b(&pc_emlrtRSI, emlrtRootTLSGlobal); } y = FALSE; emlrtPushRtStackR2012b(&qc_emlrtRSI, emlrtRootTLSGlobal); if (1 > x->size[1]) { overflow = FALSE; } else { overflow = (x->size[1] > 2147483646); } if (overflow) { emlrtPushRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); check_forloop_overflow_error(); emlrtPopRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); } emlrtPopRtStackR2012b(&qc_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(&nc_emlrtRSI, emlrtRootTLSGlobal); return y; } void b_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 iv65[2] = { 1, 41 }; const mxArray *m23; char_T cv89[41]; static const char_T cv90[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 iv66[2] = { 1, 51 }; char_T cv91[51]; static const char_T cv92[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(&nc_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(&oc_emlrtRSI, emlrtRootTLSGlobal); b_y = NULL; m23 = mxCreateCharArray(2, iv65); for (i = 0; i < 41; i++) { cv89[i] = cv90[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 41, m23, cv89); emlrtAssign(&b_y, m23); error(message(b_y, &i_emlrtMCI), &j_emlrtMCI); emlrtPopRtStackR2012b(&oc_emlrtRSI, emlrtRootTLSGlobal); } if (((x->size[0] == 1) && (x->size[1] == 1)) || (x->size[0] != 1)) { overflow = TRUE; } else { overflow = FALSE; } if (overflow) { } else { emlrtPushRtStackR2012b(&pc_emlrtRSI, emlrtRootTLSGlobal); c_y = NULL; m23 = mxCreateCharArray(2, iv66); for (i = 0; i < 51; i++) { cv91[i] = cv92[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 51, m23, cv91); emlrtAssign(&c_y, m23); error(message(c_y, &k_emlrtMCI), &l_emlrtMCI); emlrtPopRtStackR2012b(&pc_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), &ad_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), &ad_emlrtRTEI); i2 = (int32_T)outsize[1]; for (i = 0; i < i2; i++) { y->data[i] = FALSE; } i2 = 0; iy = -1; emlrtPushRtStackR2012b(&ng_emlrtRSI, emlrtRootTLSGlobal); if (1 > x->size[1]) { overflow = FALSE; } else { overflow = (x->size[1] > 2147483646); } if (overflow) { emlrtPushRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); check_forloop_overflow_error(); emlrtPopRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); } emlrtPopRtStackR2012b(&ng_emlrtRSI, emlrtRootTLSGlobal); for (i = 1; i <= x->size[1]; i++) { i1 = i2 + 1; i2 += x->size[0]; iy++; emlrtPushRtStackR2012b(&qc_emlrtRSI, emlrtRootTLSGlobal); if (i1 > i2) { b_i1 = FALSE; } else { b_i1 = (i2 > 2147483646); } if (b_i1) { emlrtPushRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); check_forloop_overflow_error(); emlrtPopRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); } emlrtPopRtStackR2012b(&qc_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(&nc_emlrtRSI, emlrtRootTLSGlobal); } boolean_T c_any(const emxArray_boolean_T *x) { boolean_T y; boolean_T overflow; const mxArray *b_y; static const int32_T iv74[2] = { 1, 41 }; const mxArray *m28; char_T cv103[41]; int32_T i; static const char_T cv104[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 iv75[2] = { 1, 51 }; char_T cv105[51]; static const char_T cv106[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(&nc_emlrtRSI, emlrtRootTLSGlobal); overflow = !c_isequal(x); if (overflow) { } else { emlrtPushRtStackR2012b(&oc_emlrtRSI, emlrtRootTLSGlobal); b_y = NULL; m28 = mxCreateCharArray(2, iv74); for (i = 0; i < 41; i++) { cv103[i] = cv104[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 41, m28, cv103); emlrtAssign(&b_y, m28); error(message(b_y, &i_emlrtMCI), &j_emlrtMCI); emlrtPopRtStackR2012b(&oc_emlrtRSI, emlrtRootTLSGlobal); } if ((x->size[0] == 1) || (x->size[0] != 1)) { overflow = TRUE; } else { overflow = FALSE; } if (overflow) { } else { emlrtPushRtStackR2012b(&pc_emlrtRSI, emlrtRootTLSGlobal); c_y = NULL; m28 = mxCreateCharArray(2, iv75); for (i = 0; i < 51; i++) { cv105[i] = cv106[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 51, m28, cv105); emlrtAssign(&c_y, m28); error(message(c_y, &k_emlrtMCI), &l_emlrtMCI); emlrtPopRtStackR2012b(&pc_emlrtRSI, emlrtRootTLSGlobal); } y = FALSE; emlrtPushRtStackR2012b(&qc_emlrtRSI, emlrtRootTLSGlobal); if (1 > x->size[0]) { overflow = FALSE; } else { overflow = (x->size[0] > 2147483646); } if (overflow) { emlrtPushRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); check_forloop_overflow_error(); emlrtPopRtStackR2012b(&lc_emlrtRSI, emlrtRootTLSGlobal); } emlrtPopRtStackR2012b(&qc_emlrtRSI, emlrtRootTLSGlobal); i = 1; exitg1 = FALSE; while ((exitg1 == FALSE) && (i <= x->size[0])) { overflow = (x->data[i - 1] == 0); if (!overflow) { y = TRUE; exitg1 = TRUE; } else { i++; } } emlrtPopRtStackR2012b(&nc_emlrtRSI, emlrtRootTLSGlobal); return y; } boolean_T d_any(const boolean_T x[501]) { boolean_T y; int32_T k; boolean_T exitg1; y = FALSE; k = 0; exitg1 = FALSE; while ((exitg1 == FALSE) && (k < 501)) { if (!(x[k] == 0)) { y = TRUE; exitg1 = TRUE; } else { k++; } } return y; } /* End of code generation (any.c) */