/* * CB_2008_nga_high.c * * Code generation for function 'CB_2008_nga_high' * * C source code generated on: Wed Aug 26 14:59:34 2015 * */ /* Include files */ #include "rt_nonfinite.h" #include "Select_Ground_Motions.h" #include "CB_2008_nga_high.h" #include "Select_Ground_Motions_emxutil.h" #include "sqrt.h" #include "mpower.h" #include "mrdivide.h" #include "CB_2008_nga_T0.h" #include "all.h" #include "exp.h" #include "log.h" #include "Select_Ground_Motions_mexutil.h" #include "Select_Ground_Motions_data.h" /* Variable Definitions */ static emlrtRSInfo rr_emlrtRSI = { 143, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo sr_emlrtRSI = { 160, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo tr_emlrtRSI = { 161, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo ur_emlrtRSI = { 163, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo vr_emlrtRSI = { 165, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo wr_emlrtRSI = { 183, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo xr_emlrtRSI = { 184, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo yr_emlrtRSI = { 192, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo as_emlrtRSI = { 193, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo bs_emlrtRSI = { 196, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo cs_emlrtRSI = { 198, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo ds_emlrtRSI = { 159, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo es_emlrtRSI = { 175, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRSInfo fs_emlrtRSI = { 182, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtRTEInfo rd_emlrtRTEI = { 105, 23, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo wc_emlrtECI = { 2, 198, 18, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo xc_emlrtECI = { 2, 196, 12, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo yc_emlrtECI = { 2, 193, 15, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo ad_emlrtECI = { 2, 179, 10, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo bd_emlrtECI = { 2, 165, 14, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo cd_emlrtECI = { 2, 163, 14, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo dd_emlrtECI = { 2, 161, 13, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo ed_emlrtECI = { 2, 147, 8, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo fd_emlrtECI = { 2, 143, 9, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo gd_emlrtECI = { 2, 138, 16, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo hd_emlrtECI = { 2, 136, 16, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; static emlrtECInfo id_emlrtECI = { 2, 134, 12, "CB_2008_nga_high", "/home/sebenik/Projects/Ground_Motion_Selection/GMS_con_cms_1gmc_dynamicInput_501_jure/CB_2008_nga_high.m" }; /* Function Definitions */ void d_CB_2008_nga_sub(real_T M, const real_T ip_data[24], const int32_T ip_size[2], real_T Rrup, real_T Rjb, real_T Ztor, real_T delta, real_T lambda, real_T Vs30, real_T Zvs, real_T arb, real_T ffltz, real_T fhngr, boolean_T Frv, boolean_T Fnm, real_T fhngm, real_T Sa_data[24], int32_T Sa_size[2], real_T sigma_data[24], int32_T sigma_size[2]) { emxArray_real_T *y; emxArray_real_T *b_y; emxArray_real_T *c_y; int32_T fmag_size[2]; int32_T i; int32_T d_y; static const real_T dv55[24] = { -1.715, -1.68, -1.552, -1.209, -0.657, -0.314, -0.133, -0.486, -0.89, -1.171, -1.466, -2.569, -4.844, -6.406, -8.692, -9.701, -10.556, -11.212, -11.684, -12.505, -13.087, -1.715, 0.954, -5.27 }; real_T fmag_data[24]; static const real_T dv56[24] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.656, 0.972, 1.196, 1.513, 1.6, 1.6, 1.6, 1.6, 1.6, 1.6, 0.5, 0.696, 1.6 }; int32_T fmag[2]; int32_T e_y[2]; real_T fhngz; static const real_T dv57[24] = { -0.53, -0.53, -0.53, -0.53, -0.53, -0.53, -0.53, -0.446, -0.362, -0.294, -0.186, -0.304, -0.578, -0.772, -1.046, -0.978, -0.638, -0.316, -0.07, -0.07, -0.07, -0.53, -0.309, -0.07 }; static const real_T dv58[24] = { -0.262, -0.262, -0.262, -0.267, -0.302, -0.324, -0.339, -0.398, -0.458, -0.511, -0.592, -0.536, -0.406, -0.314, -0.185, -0.236, -0.491, -0.77, -0.986, -0.656, -0.422, -0.262, -0.019, 0.0 }; int32_T fsed_size[2]; static const real_T dv59[24] = { -2.118, -2.123, -2.145, -2.199, -2.277, -2.318, -2.309, -2.22, -2.146, -2.095, -2.066, -2.041, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.118, -2.016, -2.0 }; real_T fsed_data[24]; int32_T fsed[2]; real_T tmp_data[24]; int32_T tmp_size[2]; static const real_T dv60[24] = { 5.6, 5.6, 5.6, 5.74, 7.09, 8.05, 8.79, 7.6, 6.58, 6.04, 5.3, 4.73, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.6, 4.0, 4.0 }; emxArray_real_T b_tmp_data; const mxArray *f_y; static const int32_T iv108[2] = { 1, 45 }; const mxArray *m38; char_T cv138[45]; static const char_T cv139[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 *g_y; static const int32_T iv109[2] = { 1, 21 }; char_T cv140[21]; static const char_T cv141[21] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T', 'L', 'A', 'B', ':', 'i', 'n', 'n', 'e', 'r', 'd', 'i', 'm' }; static const real_T dv61[24] = { 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.28, 0.255, 0.161, 0.094, 0.0, 0.0, 0.0, 0.0, 0.0, 0.28, 0.245, 0.0 }; int32_T fflt_size[2]; static const real_T dv62[24] = { -0.12, -0.12, -0.12, -0.12, -0.12, -0.099, -0.048, -0.012, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.12, 0.0, 0.0 }; real_T fflt_data[24]; int32_T fflt[2]; boolean_T b; real_T fhngdelta; static const real_T dv63[24] = { 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.49, 0.371, 0.154, 0.0, 0.0, 0.0, 0.0, 0.49, 0.358, 0.0 }; boolean_T Vs30_data[24]; int32_T Vs30_size[2]; static const int16_T iv110[24] = { 865, 865, 908, 1054, 1086, 1032, 878, 748, 654, 587, 503, 457, 410, 400, 400, 400, 400, 400, 400, 400, 400, 865, 400, 400 }; emxArray_boolean_T b_Vs30_data; emxArray_real_T *h_y; real_T c_tmp_data[24]; int32_T b_tmp_size[2]; real_T b_b; static const real_T dv64[24] = { 1.058, 1.102, 1.174, 1.272, 1.438, 1.604, 1.928, 2.194, 2.351, 2.46, 2.587, 2.544, 2.133, 1.571, 0.406, -0.456, -0.82, -0.82, -0.82, -0.82, -0.82, 1.058, 1.694, -0.82 }; int32_T c_tmp_size[2]; static const real_T dv65[24] = { -1.186, -1.219, -1.273, -1.346, -1.471, -1.624, -1.931, -2.188, -2.381, -2.518, -2.657, -2.669, -2.401, -1.955, -1.025, -0.299, 0.0, 0.0, 0.0, 0.0, 0.0, -1.186, -1.955, 0.0 }; int32_T fsite_size[2]; real_T fsite_data[24]; static const real_T dv66[24] = { 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.077, 0.15, 0.253, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.04, 0.092, 0.3 }; static const real_T dv67[24] = { 0.61, 0.61, 0.61, 0.61, 0.61, 0.61, 0.61, 0.61, 0.7, 0.75, 0.85, 0.883, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.61, 1.0, 1.0 }; static const real_T dv68[24] = { 1.839, 1.84, 1.841, 1.843, 1.845, 1.847, 1.852, 1.856, 1.861, 1.865, 1.874, 1.883, 1.906, 1.929, 1.974, 2.019, 2.11, 2.2, 2.291, 2.517, 2.744, 1.839, 1.929, 2.744 }; const mxArray *i_y; static const int32_T iv111[2] = { 1, 45 }; const mxArray *j_y; static const int32_T iv112[2] = { 1, 21 }; boolean_T c_Vs30_data[24]; int32_T b_Vs30_size[2]; emxArray_boolean_T d_Vs30_data; int32_T d_tmp_size[2]; real_T d_tmp_data[24]; int32_T e_tmp_size[2]; static const real_T dv69[24] = { 0.478, 0.48, 0.498, 0.51, 0.52, 0.531, 0.532, 0.534, 0.534, 0.544, 0.541, 0.55, 0.568, 0.568, 0.564, 0.571, 0.558, 0.576, 0.601, 0.628, 0.667, 0.478, 0.484, 0.667 }; emxArray_real_T e_tmp_data; real_T f_tmp_data[24]; int32_T f_tmp_size[2]; emxArray_real_T g_tmp_data; emxArray_real_T b_fflt_data; static const real_T dv70[24] = { 1.0, 0.999, 0.989, 0.963, 0.922, 0.898, 0.89, 0.871, 0.852, 0.831, 0.785, 0.735, 0.628, 0.534, 0.411, 0.331, 0.289, 0.261, 0.2, 0.174, 0.174, 1.0, 0.691, 0.174 }; const mxArray *k_y; static const int32_T iv113[2] = { 1, 45 }; const mxArray *l_y; static const int32_T iv114[2] = { 1, 21 }; const mxArray *m_y; static const int32_T iv115[2] = { 1, 45 }; const mxArray *n_y; static const int32_T iv116[2] = { 1, 21 }; emxArray_real_T c_fflt_data; real_T h_tmp_data[24]; int32_T g_tmp_size[2]; static const real_T dv71[24] = { 0.219, 0.219, 0.235, 0.258, 0.292, 0.286, 0.28, 0.249, 0.24, 0.215, 0.217, 0.214, 0.227, 0.255, 0.296, 0.296, 0.326, 0.297, 0.359, 0.428, 0.485, 0.219, 0.203, 0.485 }; emxArray_real_T i_tmp_data; emxArray_real_T b_sigma_data; real_T j_tmp_data[24]; int32_T h_tmp_size[2]; static const real_T dv72[24] = { 0.166, 0.166, 0.165, 0.162, 0.158, 0.17, 0.18, 0.186, 0.191, 0.198, 0.206, 0.208, 0.221, 0.225, 0.222, 0.226, 0.229, 0.237, 0.237, 0.271, 0.29, 0.166, 0.19, 0.29 }; emxArray_real_T k_tmp_data; emlrtHeapReferenceStackEnterFcnR2012b(emlrtRootTLSGlobal); /* Magnitude dependence */ b_emxInit_real_T(&y, 2, &rd_emlrtRTEI, TRUE); b_emxInit_real_T(&b_y, 2, &rd_emlrtRTEI, TRUE); b_emxInit_real_T(&c_y, 2, &rd_emlrtRTEI, TRUE); if (M <= 5.5) { fmag_size[0] = 1; fmag_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fmag_data[d_y] = dv55[(int32_T)ip_data[d_y] - 1]; } d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[d_y] = dv56[(int32_T)ip_data[d_y] - 1] * M; } for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &id_emlrtECI, emlrtRootTLSGlobal); fmag_size[0] = 1; i = ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fhngz = fmag_data[d_y] + y->data[d_y]; fmag_data[d_y] = fhngz; } } else if (M <= 6.5) { fmag_size[0] = 1; fmag_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fmag_data[d_y] = dv55[(int32_T)ip_data[d_y] - 1]; } d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[d_y] = dv56[(int32_T)ip_data[d_y] - 1] * M; } for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &hd_emlrtECI, emlrtRootTLSGlobal); d_y = b_y->size[0] * b_y->size[1]; b_y->size[0] = 1; b_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)b_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { b_y->data[d_y] = dv57[(int32_T)ip_data[d_y] - 1] * (M - 5.5); } for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = b_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &hd_emlrtECI, emlrtRootTLSGlobal); fmag_size[0] = 1; i = ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fhngz = (fmag_data[d_y] + y->data[d_y]) + b_y->data[d_y]; fmag_data[d_y] = fhngz; } } else { fmag_size[0] = 1; fmag_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fmag_data[d_y] = dv55[(int32_T)ip_data[d_y] - 1]; } d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[d_y] = dv56[(int32_T)ip_data[d_y] - 1] * M; } for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &gd_emlrtECI, emlrtRootTLSGlobal); d_y = b_y->size[0] * b_y->size[1]; b_y->size[0] = 1; b_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)b_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { b_y->data[d_y] = dv57[(int32_T)ip_data[d_y] - 1] * (M - 5.5); } for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = b_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &gd_emlrtECI, emlrtRootTLSGlobal); d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = dv58[(int32_T)ip_data[d_y] - 1] * (M - 6.5); } for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = c_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &gd_emlrtECI, emlrtRootTLSGlobal); fmag_size[0] = 1; i = ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fhngz = ((fmag_data[d_y] + y->data[d_y]) + b_y->data[d_y]) + c_y->data[d_y]; fmag_data[d_y] = fhngz; } } /* Distance dependence */ fsed_size[0] = 1; fsed_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fsed_data[d_y] = dv59[(int32_T)ip_data[d_y] - 1]; } d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[d_y] = 0.17 * M; } for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = fsed_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fsed, e_y, &fd_emlrtECI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&rr_emlrtRSI, emlrtRootTLSGlobal); fhngz = Rrup * Rrup; d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[d_y] += fsed_data[d_y]; } tmp_size[0] = 1; tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { tmp_data[d_y] = dv60[(int32_T)ip_data[d_y] - 1]; } b_tmp_data.data = (real_T *)&tmp_data; b_tmp_data.size = (int32_T *)&tmp_size; b_tmp_data.allocatedSize = 24; b_tmp_data.numDimensions = 2; b_tmp_data.canFreeData = FALSE; mpower(&b_tmp_data, c_y); d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = c_y->size[0]; d_y = c_y->size[1]; i *= d_y; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] += fhngz; } c_sqrt(c_y); c_log(c_y); emlrtPushRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); if (!(y->size[1] == 1)) { if ((y->size[1] == 1) || (c_y->size[1] == 1)) { emlrtPushRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); f_y = NULL; m38 = mxCreateCharArray(2, iv108); for (i = 0; i < 45; i++) { cv138[i] = cv139[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 45, m38, cv138); emlrtAssign(&f_y, m38); error(message(f_y, &r_emlrtMCI), &s_emlrtMCI); emlrtPopRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); } else { emlrtPushRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); g_y = NULL; m38 = mxCreateCharArray(2, iv109); for (i = 0; i < 21; i++) { cv140[i] = cv141[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m38, cv140); emlrtAssign(&g_y, m38); error(message(g_y, &t_emlrtMCI), &u_emlrtMCI); emlrtPopRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); } } emlrtPopRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); fhngz = y->data[0]; d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = c_y->size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[y->size[0] * d_y] = fhngz * c_y->data[c_y->size[0] * d_y]; } emlrtPopRtStackR2012b(&rr_emlrtRSI, emlrtRootTLSGlobal); /* Style of faulting */ d_y = b_y->size[0] * b_y->size[1]; b_y->size[0] = 1; b_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)b_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { b_y->data[d_y] = dv61[(int32_T)ip_data[d_y] - 1] * (real_T)Frv * ffltz; } fflt_size[0] = 1; fflt_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fflt_data[d_y] = dv62[(int32_T)ip_data[d_y] - 1] * (real_T)Fnm; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = b_y->size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { fflt[d_y] = fflt_size[d_y]; } emlrtSizeEqCheck2DFastR2012b(e_y, fflt, &ed_emlrtECI, emlrtRootTLSGlobal); fflt_size[0] = 1; fflt_size[1] = b_y->size[1]; i = b_y->size[0] * b_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fflt_data[d_y] += b_y->data[d_y]; } /* Hanging-wall effects */ if ((Ztor >= 0.0) && (Ztor < 20.0)) { b = TRUE; } else { b = FALSE; } fhngz = (20.0 - Ztor) / 20.0 * (real_T)b; fhngdelta = (real_T)(delta <= 70.0) + (90.0 - delta) / 20.0 * (real_T)(delta > 70.0); d_y = b_y->size[0] * b_y->size[1]; b_y->size[0] = 1; b_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)b_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { b_y->data[d_y] = dv63[(int32_T)ip_data[d_y] - 1] * fhngr * fhngm * fhngz * fhngdelta; } /* Site conditions */ emlrtPushRtStackR2012b(&ds_emlrtRSI, emlrtRootTLSGlobal); Vs30_size[0] = 1; Vs30_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { Vs30_data[d_y] = (Vs30 < iv110[(int32_T)ip_data[d_y] - 1]); } b_Vs30_data.data = (boolean_T *)&Vs30_data; b_Vs30_data.size = (int32_T *)&Vs30_size; b_Vs30_data.allocatedSize = 24; b_Vs30_data.numDimensions = 2; b_Vs30_data.canFreeData = FALSE; b = b_all(&b_Vs30_data); emlrtPopRtStackR2012b(&ds_emlrtRSI, emlrtRootTLSGlobal); b_emxInit_real_T(&h_y, 2, &rd_emlrtRTEI, TRUE); if (b) { emlrtPushRtStackR2012b(&sr_emlrtRSI, emlrtRootTLSGlobal); fhngz = CB_2008_nga_T0(M, Rrup, Rjb, Ztor, delta, lambda, Zvs, arb); emlrtPopRtStackR2012b(&sr_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&tr_emlrtRSI, emlrtRootTLSGlobal); b_tmp_size[0] = 1; b_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_tmp_data[d_y] = iv110[(int32_T)ip_data[d_y] - 1]; } b_b = c_mrdivide(Vs30, c_tmp_data, b_tmp_size); b_log(&b_b); d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = dv64[(int32_T)ip_data[d_y] - 1] * b_b; } emlrtPopRtStackR2012b(&tr_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&tr_emlrtRSI, emlrtRootTLSGlobal); c_tmp_size[0] = 1; c_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_tmp_data[d_y] = iv110[(int32_T)ip_data[d_y] - 1]; } b_b = b_mpower(c_mrdivide(Vs30, c_tmp_data, c_tmp_size)); fhngdelta = fhngz + 1.88; b_log(&fhngdelta); fhngz += 1.88 * b_b; b_log(&fhngz); b_b = fhngz - fhngdelta; d_y = h_y->size[0] * h_y->size[1]; h_y->size[0] = 1; h_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)h_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { h_y->data[d_y] = dv65[(int32_T)ip_data[d_y] - 1] * b_b; } emlrtPopRtStackR2012b(&tr_emlrtRSI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = c_y->size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = h_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(e_y, fsed, &dd_emlrtECI, emlrtRootTLSGlobal); fsite_size[0] = 1; fsite_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fsite_data[d_y] = c_y->data[d_y] + h_y->data[d_y]; } } else if (Vs30 < 1100.0) { fsite_size[0] = 1; fsite_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fsite_data[d_y] = dv64[(int32_T)ip_data[d_y] - 1]; } d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = dv65[(int32_T)ip_data[d_y] - 1] * 1.18; } for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = fsite_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = c_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fsed, e_y, &cd_emlrtECI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&ur_emlrtRSI, emlrtRootTLSGlobal); b_tmp_size[0] = 1; b_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_tmp_data[d_y] = iv110[(int32_T)ip_data[d_y] - 1]; } b_b = c_mrdivide(Vs30, c_tmp_data, b_tmp_size); b_log(&b_b); fsite_size[0] = 1; i = ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fhngz = (fsite_data[d_y] + c_y->data[d_y]) * b_b; fsite_data[d_y] = fhngz; } emlrtPopRtStackR2012b(&ur_emlrtRSI, emlrtRootTLSGlobal); } else { fsite_size[0] = 1; fsite_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fsite_data[d_y] = dv64[(int32_T)ip_data[d_y] - 1]; } d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = dv65[(int32_T)ip_data[d_y] - 1] * 1.18; } for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = fsite_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = c_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fsed, e_y, &bd_emlrtECI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&vr_emlrtRSI, emlrtRootTLSGlobal); b_tmp_size[0] = 1; b_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_tmp_data[d_y] = iv110[(int32_T)ip_data[d_y] - 1]; } b_b = b_mrdivide(c_tmp_data, b_tmp_size); b_log(&b_b); fsite_size[0] = 1; i = ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fhngz = (fsite_data[d_y] + c_y->data[d_y]) * b_b; fsite_data[d_y] = fhngz; } emlrtPopRtStackR2012b(&vr_emlrtRSI, emlrtRootTLSGlobal); } /* Sediment effects */ if (Zvs < 1.0) { fsed_size[0] = 1; fsed_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fsed_data[d_y] = dv66[(int32_T)ip_data[d_y] - 1] * (Zvs - 1.0); } } else if (Zvs <= 3.0) { fsed_size[0] = 1; fsed_size[1] = 1; fsed_data[0] = 0.0; } else { emlrtPushRtStackR2012b(&es_emlrtRSI, emlrtRootTLSGlobal); d_y = h_y->size[0] * h_y->size[1]; h_y->size[0] = 1; h_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)h_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { h_y->data[d_y] = dv67[(int32_T)ip_data[d_y] - 1]; } d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = dv68[(int32_T)ip_data[d_y] - 1]; } emlrtPushRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); if (!(h_y->size[1] == 1)) { if ((h_y->size[1] == 1) || (c_y->size[1] == 1)) { emlrtPushRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); i_y = NULL; m38 = mxCreateCharArray(2, iv111); for (i = 0; i < 45; i++) { cv138[i] = cv139[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 45, m38, cv138); emlrtAssign(&i_y, m38); error(message(i_y, &r_emlrtMCI), &s_emlrtMCI); emlrtPopRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); } else { emlrtPushRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); j_y = NULL; m38 = mxCreateCharArray(2, iv112); for (i = 0; i < 21; i++) { cv140[i] = cv141[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m38, cv140); emlrtAssign(&j_y, m38); error(message(j_y, &t_emlrtMCI), &u_emlrtMCI); emlrtPopRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); } } emlrtPopRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); b_b = 1.0 - muDoubleScalarExp(-0.25 * (Zvs - 3.0)); fsed_size[0] = 1; fsed_size[1] = c_y->size[1]; fhngz = h_y->data[0]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fsed_data[d_y] = fhngz * c_y->data[d_y] * 0.47236655274101469 * b_b; } emlrtPopRtStackR2012b(&es_emlrtRSI, emlrtRootTLSGlobal); } /* Median value */ for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &ad_emlrtECI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { fflt[d_y] = fflt_size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, fflt, &ad_emlrtECI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = b_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, e_y, &ad_emlrtECI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; fsed[d_y] = fsite_size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, fsed, &ad_emlrtECI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fmag[d_y] = fmag_size[d_y]; fsed[d_y] = fsed_size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fmag, fsed, &ad_emlrtECI, emlrtRootTLSGlobal); d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = fmag_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = fmag_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[d_y] = ((((fmag_data[d_y] + y->data[d_y]) + fflt_data[d_y]) + b_y->data[d_y]) + fsite_data[d_y]) + fsed_data[d_y]; } emxFree_real_T(&b_y); b_exp(y); Sa_size[0] = 1; Sa_size[1] = y->size[1]; i = y->size[0] * y->size[1]; for (d_y = 0; d_y < i; d_y++) { Sa_data[d_y] = y->data[d_y]; } /* Standard deviation computations */ emlrtPushRtStackR2012b(&fs_emlrtRSI, emlrtRootTLSGlobal); b_Vs30_size[0] = 1; b_Vs30_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_Vs30_data[d_y] = (Vs30 < iv110[(int32_T)ip_data[d_y] - 1]); } d_Vs30_data.data = (boolean_T *)&c_Vs30_data; d_Vs30_data.size = (int32_T *)&b_Vs30_size; d_Vs30_data.allocatedSize = 24; d_Vs30_data.numDimensions = 2; d_Vs30_data.canFreeData = FALSE; b = b_all(&d_Vs30_data); emlrtPopRtStackR2012b(&fs_emlrtRSI, emlrtRootTLSGlobal); if (b) { emlrtPushRtStackR2012b(&wr_emlrtRSI, emlrtRootTLSGlobal); fhngz = CB_2008_nga_T0(M, Rrup, Rjb, Ztor, delta, lambda, Zvs, arb); emlrtPopRtStackR2012b(&wr_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&xr_emlrtRSI, emlrtRootTLSGlobal); d_tmp_size[0] = 1; d_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_tmp_data[d_y] = iv110[(int32_T)ip_data[d_y] - 1]; } b_b = b_mpower(c_mrdivide(Vs30, c_tmp_data, d_tmp_size)); b_b = c_mpower(fhngz + 1.88 * b_b) - c_mpower(fhngz + 1.88); fflt_size[0] = 1; fflt_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { fflt_data[d_y] = dv65[(int32_T)ip_data[d_y] - 1] * fhngz * b_b; } emlrtPopRtStackR2012b(&xr_emlrtRSI, emlrtRootTLSGlobal); } else { fflt_size[0] = 1; fflt_size[1] = 1; fflt_data[0] = 0.0; } emlrtPushRtStackR2012b(&yr_emlrtRSI, emlrtRootTLSGlobal); e_tmp_size[0] = 1; e_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { d_tmp_data[d_y] = dv69[(int32_T)ip_data[d_y] - 1]; } e_tmp_data.data = (real_T *)&d_tmp_data; e_tmp_data.size = (int32_T *)&e_tmp_size; e_tmp_data.allocatedSize = 24; e_tmp_data.numDimensions = 2; e_tmp_data.canFreeData = FALSE; mpower(&e_tmp_data, c_y); d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = c_y->size[0]; d_y = c_y->size[1]; i *= d_y; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] -= 0.09; } c_sqrt(c_y); fsite_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fsite_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&yr_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); f_tmp_size[0] = 1; f_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { f_tmp_data[d_y] = dv69[(int32_T)ip_data[d_y] - 1]; } g_tmp_data.data = (real_T *)&f_tmp_data; g_tmp_data.size = (int32_T *)&f_tmp_size; g_tmp_data.allocatedSize = 24; g_tmp_data.numDimensions = 2; g_tmp_data.canFreeData = FALSE; mpower(&g_tmp_data, c_y); fsed_size[0] = 1; fsed_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fsed_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); b_fflt_data.data = (real_T *)&fflt_data; b_fflt_data.size = (int32_T *)&fflt_size; b_fflt_data.allocatedSize = 24; b_fflt_data.numDimensions = 2; b_fflt_data.canFreeData = FALSE; mpower(&b_fflt_data, h_y); d_y = h_y->size[0] * h_y->size[1]; h_y->size[0] = 1; emxEnsureCapacity((emxArray__common *)h_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = h_y->size[0]; d_y = h_y->size[1]; i *= d_y; for (d_y = 0; d_y < i; d_y++) { h_y->data[d_y] *= 0.138484; } emlrtPopRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = fsed_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = h_y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fsed, e_y, &yc_emlrtECI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = fflt_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = fflt_size[0] * fflt_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[d_y] = 2.0 * fflt_data[d_y]; } d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = ip_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = dv70[(int32_T)ip_data[d_y] - 1]; } emlrtPushRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); if (!(y->size[1] == 1)) { if ((y->size[1] == 1) || (c_y->size[1] == 1)) { emlrtPushRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); k_y = NULL; m38 = mxCreateCharArray(2, iv113); for (i = 0; i < 45; i++) { cv138[i] = cv139[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 45, m38, cv138); emlrtAssign(&k_y, m38); error(message(k_y, &r_emlrtMCI), &s_emlrtMCI); emlrtPopRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); } else { emlrtPushRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); l_y = NULL; m38 = mxCreateCharArray(2, iv114); for (i = 0; i < 21; i++) { cv140[i] = cv141[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m38, cv140); emlrtAssign(&l_y, m38); error(message(l_y, &t_emlrtMCI), &u_emlrtMCI); emlrtPopRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); } } emlrtPopRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); fhngz = y->data[0]; d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = c_y->size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[y->size[0] * d_y] = fhngz * c_y->data[c_y->size[0] * d_y]; } emlrtPushRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); if (!(y->size[1] == 1)) { if ((y->size[1] == 1) || (fsite_size[1] == 1)) { emlrtPushRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); m_y = NULL; m38 = mxCreateCharArray(2, iv115); for (i = 0; i < 45; i++) { cv138[i] = cv139[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 45, m38, cv138); emlrtAssign(&m_y, m38); error(message(m_y, &r_emlrtMCI), &s_emlrtMCI); emlrtPopRtStackR2012b(&wd_emlrtRSI, emlrtRootTLSGlobal); } else { emlrtPushRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); n_y = NULL; m38 = mxCreateCharArray(2, iv116); for (i = 0; i < 21; i++) { cv140[i] = cv141[i]; } emlrtInitCharArrayR2013a(emlrtRootTLSGlobal, 21, m38, cv140); emlrtAssign(&n_y, m38); error(message(n_y, &t_emlrtMCI), &u_emlrtMCI); emlrtPopRtStackR2012b(&vd_emlrtRSI, emlrtRootTLSGlobal); } } emlrtPopRtStackR2012b(&ud_emlrtRSI, emlrtRootTLSGlobal); fhngz = y->data[0]; d_y = y->size[0] * y->size[1]; y->size[0] = 1; y->size[1] = fsite_size[1]; emxEnsureCapacity((emxArray__common *)y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = fsite_size[1]; for (d_y = 0; d_y < i; d_y++) { y->data[y->size[0] * d_y] = fhngz * fsite_data[d_y] * 0.37213438432910229; } emlrtPopRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = fsed_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { e_y[d_y] = y->size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fsed, e_y, &yc_emlrtECI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); d_y = h_y->size[0] * h_y->size[1]; h_y->size[0] = 1; h_y->size[1] = fsed_size[1]; emxEnsureCapacity((emxArray__common *)h_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = fsed_size[1]; for (d_y = 0; d_y < i; d_y++) { h_y->data[d_y] = (fsed_data[d_y] + h_y->data[d_y]) + y->data[d_y]; } emxFree_real_T(&y); c_sqrt(h_y); fflt_size[0] = 1; fflt_size[1] = h_y->size[1]; i = h_y->size[0] * h_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fflt_data[d_y] = h_y->data[d_y]; } emxFree_real_T(&h_y); emlrtPopRtStackR2012b(&as_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&bs_emlrtRSI, emlrtRootTLSGlobal); c_fflt_data.data = (real_T *)&fflt_data; c_fflt_data.size = (int32_T *)&fflt_size; c_fflt_data.allocatedSize = 24; c_fflt_data.numDimensions = 2; c_fflt_data.canFreeData = FALSE; mpower(&c_fflt_data, c_y); fsed_size[0] = 1; fsed_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fsed_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&bs_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&bs_emlrtRSI, emlrtRootTLSGlobal); g_tmp_size[0] = 1; g_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { h_tmp_data[d_y] = dv71[(int32_T)ip_data[d_y] - 1]; } i_tmp_data.data = (real_T *)&h_tmp_data; i_tmp_data.size = (int32_T *)&g_tmp_size; i_tmp_data.allocatedSize = 24; i_tmp_data.numDimensions = 2; i_tmp_data.canFreeData = FALSE; mpower(&i_tmp_data, c_y); fflt_size[0] = 1; fflt_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fflt_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&bs_emlrtRSI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = fsed_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { fflt[d_y] = fflt_size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fsed, fflt, &xc_emlrtECI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&bs_emlrtRSI, emlrtRootTLSGlobal); d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = fsed_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = fsed_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = fsed_data[d_y] + fflt_data[d_y]; } c_sqrt(c_y); sigma_size[0] = 1; sigma_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { sigma_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&bs_emlrtRSI, emlrtRootTLSGlobal); if (arb == 1.0) { emlrtPushRtStackR2012b(&cs_emlrtRSI, emlrtRootTLSGlobal); b_sigma_data.data = (real_T *)sigma_data; b_sigma_data.size = (int32_T *)sigma_size; b_sigma_data.allocatedSize = 24; b_sigma_data.numDimensions = 2; b_sigma_data.canFreeData = FALSE; mpower(&b_sigma_data, c_y); fsed_size[0] = 1; fsed_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fsed_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&cs_emlrtRSI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&cs_emlrtRSI, emlrtRootTLSGlobal); h_tmp_size[0] = 1; h_tmp_size[1] = ip_size[1]; i = ip_size[0] * ip_size[1]; for (d_y = 0; d_y < i; d_y++) { j_tmp_data[d_y] = dv72[(int32_T)ip_data[d_y] - 1]; } k_tmp_data.data = (real_T *)&j_tmp_data; k_tmp_data.size = (int32_T *)&h_tmp_size; k_tmp_data.allocatedSize = 24; k_tmp_data.numDimensions = 2; k_tmp_data.canFreeData = FALSE; mpower(&k_tmp_data, c_y); fflt_size[0] = 1; fflt_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { fflt_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&cs_emlrtRSI, emlrtRootTLSGlobal); for (d_y = 0; d_y < 2; d_y++) { fsed[d_y] = fsed_size[d_y]; } for (d_y = 0; d_y < 2; d_y++) { fflt[d_y] = fflt_size[d_y]; } emlrtSizeEqCheck2DFastR2012b(fsed, fflt, &wc_emlrtECI, emlrtRootTLSGlobal); emlrtPushRtStackR2012b(&cs_emlrtRSI, emlrtRootTLSGlobal); d_y = c_y->size[0] * c_y->size[1]; c_y->size[0] = 1; c_y->size[1] = fsed_size[1]; emxEnsureCapacity((emxArray__common *)c_y, d_y, (int32_T)sizeof(real_T), &rd_emlrtRTEI); i = fsed_size[1]; for (d_y = 0; d_y < i; d_y++) { c_y->data[d_y] = fsed_data[d_y] + fflt_data[d_y]; } c_sqrt(c_y); sigma_size[0] = 1; sigma_size[1] = c_y->size[1]; i = c_y->size[0] * c_y->size[1]; for (d_y = 0; d_y < i; d_y++) { sigma_data[d_y] = c_y->data[d_y]; } emlrtPopRtStackR2012b(&cs_emlrtRSI, emlrtRootTLSGlobal); } emxFree_real_T(&c_y); emlrtHeapReferenceStackLeaveFcnR2012b(emlrtRootTLSGlobal); } /* End of code generation (CB_2008_nga_high.c) */