File: D:\TMTmethod\simulator\codegen\mex\testspline\mldivide.c

    1   /*
    2    * mldivide.c
    3    *
    4    * Code generation for function 'mldivide'
    5    *
    6    * C source code generated on: Thu Aug 30 14:03:55 2012
    7    *
    8    */
    9   
   10   /* Include files */
   11   #include "rt_nonfinite.h"
   12   #include "testspline.h"
   13   #include "mldivide.h"
   14   #include "mrdivide.h"
   15   #include "testspline_mexutil.h"
   16   #include "testspline_data.h"
   17   
   18   /* Type Definitions */
   19   
   20   /* Named Constants */
   21   
   22   /* Variable Declarations */
   23   
   24   /* Variable Definitions */
   25   static emlrtRSInfo q_emlrtRSI = { 1, "mldivide", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/ops/mldivide.p" };
   26   static emlrtRSInfo r_emlrtRSI = { 1, "mldivide", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/ops/mldivide.p" };
   27   static emlrtRSInfo t_emlrtRSI = { 20, "eml_lusolve", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/eml_lusolve.m" };
   28   static emlrtRSInfo u_emlrtRSI = { 92, "eml_lusolve", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/eml_lusolve.m" };
   29   static emlrtRSInfo v_emlrtRSI = { 90, "eml_lusolve", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/eml_lusolve.m" };
   30   static emlrtRSInfo w_emlrtRSI = { 70, "eml_lusolve", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/eml_lusolve.m" };
   31   static emlrtRSInfo x_emlrtRSI = { 72, "eml_lusolve", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/eml_lusolve.m" };
   32   static emlrtRSInfo tb_emlrtRSI = { 54, "eml_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/eml_xtrsm.m" };
   33   static emlrtRSInfo vb_emlrtRSI = { 28, "eml_blas_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m" };
   34   static emlrtRSInfo wb_emlrtRSI = { 80, "eml_blas_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m" };
   35   static emlrtRSInfo xb_emlrtRSI = { 54, "eml_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/eml_xtrsm.m" };
   36   static emlrtRSInfo ac_emlrtRSI = { 28, "eml_blas_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m" };
   37   static emlrtRSInfo bc_emlrtRSI = { 80, "eml_blas_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m" };
   38   static emlrtMCInfo g_emlrtMCI = { 1, 1, "mldivide", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/ops/mldivide.p" };
   39   static emlrtMCInfo h_emlrtMCI = { 1, 1, "mldivide", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/ops/mldivide.p" };
   40   static emlrtBCInfo vh_emlrtBCI = { -1, -1, 82, 5, "", "eml_blas_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m", 0 };
   41   static emlrtBCInfo wh_emlrtBCI = { -1, -1, 82, 40, "", "eml_blas_xtrsm", "C:/Program Files/MATLAB/R2011b/toolbox/eml/lib/matlab/eml/blas/external/eml_blas_xtrsm.m", 0 };
   42   
   43   /* Function Declarations */
   44   static void eml_xtrsm(int32_T m, int32_T n, const real_T A_data[1], const int32_T A_sizes[2], int32_T lda, real_T B_data[1], int32_T B_sizes[2], int32_T ldb);
   45   
   46   /* Function Definitions */
   47   
   48   static void eml_xtrsm(int32_T m, int32_T n, const real_T A_data[1], const int32_T A_sizes[2], int32_T lda, real_T B_data[1], int32_T B_sizes[2], int32_T ldb)
   49   {
   50       int32_T b_m;
   51       int32_T b_n;
   52       real_T alpha1;
   53       char_T SIDE;
   54       char_T UPLO;
   55       char_T TRANSA;
   56       char_T DIAGA;
   57       EMLRTPUSHRTSTACK(&xb_emlrtRSI);
   58       if ((m < 1) || (n < 1)) {
   59       } else {
   60           EMLRTPUSHRTSTACK(&ac_emlrtRSI);
   61           b_m = 1;
   62           b_n = 1;
   63           alpha1 = 1.0;
   64           SIDE = 'L';
   65           UPLO = 'U';
   66           TRANSA = 'N';
   67           DIAGA = 'N';
   68           emlrtDynamicBoundsCheck(1, 1, A_sizes[0] * A_sizes[1], &vh_emlrtBCI);
   69           emlrtDynamicBoundsCheck(1, 1, B_sizes[0] * B_sizes[1], &wh_emlrtBCI);
   70           EMLRTPUSHRTSTACK(&bc_emlrtRSI);
   71           dtrsm32(&SIDE, &UPLO, &TRANSA, &DIAGA, &b_m, &b_n, &alpha1, &A_data[0], &lda, &B_data[0], &ldb);
   72           EMLRTPOPRTSTACK(&bc_emlrtRSI);
   73           EMLRTPOPRTSTACK(&ac_emlrtRSI);
   74       }
   75       EMLRTPOPRTSTACK(&xb_emlrtRSI);
   76   }
   77   
   78   void mldivide(const real_T A_data[1], const int32_T A_sizes[2], const real_T B_data[1], const int32_T B_sizes[2], real_T Y_data[1], int32_T Y_sizes[2])
   79   {
   80       const mxArray *y;
   81       static const int32_T iv7[2] = { 1, 21 };
   82       const mxArray *m3;
   83       static const char_T cv3[21] = { 'C', 'o', 'd', 'e', 'r', ':', 'M', 'A', 'T', 'L', 'A', 'B', ':', 'd', 'i', 'm', 'a', 'g', 'r', 'e', 'e' };
   84       int32_T info;
   85       int32_T n;
   86       int32_T b_n;
   87       real_T alpha1;
   88       char_T SIDE;
   89       char_T UPLO;
   90       char_T TRANSA;
   91       char_T DIAGA;
   92       if (B_sizes[0] == A_sizes[0]) {
   93       } else {
   94           EMLRTPUSHRTSTACK(&q_emlrtRSI);
   95           y = NULL;
   96           m3 = mxCreateCharArray(2, iv7);
   97           emlrtInitCharArray(21, m3, cv3);
   98           emlrtAssign(&y, m3);
   99           error(message(y, &g_emlrtMCI), &h_emlrtMCI);
  100           EMLRTPOPRTSTACK(&q_emlrtRSI);
  101       }
  102       if ((A_sizes[0] == 0) || (A_sizes[1] == 0) || ((B_sizes[0] == 0) || (B_sizes[1] == 0))) {
  103           Y_sizes[0] = (int32_T)(int8_T)A_sizes[1];
  104           Y_sizes[1] = (int32_T)(int8_T)B_sizes[1];
  105           info = (int8_T)A_sizes[1] * (int8_T)B_sizes[1] - 1;
  106           for (n = 0; n <= info; n++) {
  107               Y_data[n] = 0.0;
  108           }
  109       } else {
  110           EMLRTPUSHRTSTACK(&r_emlrtRSI);
  111           EMLRTPUSHRTSTACK(&t_emlrtRSI);
  112           b_n = 1;
  113           EMLRTPUSHRTSTACK(&w_emlrtRSI);
  114           EMLRTPUSHRTSTACK(&y_emlrtRSI);
  115           EMLRTPUSHRTSTACK(&ab_emlrtRSI);
  116           EMLRTPUSHRTSTACK(&bb_emlrtRSI);
  117           EMLRTPUSHRTSTACK(&cb_emlrtRSI);
  118           EMLRTPUSHRTSTACK(&db_emlrtRSI);
  119           EMLRTPUSHRTSTACK(&eb_emlrtRSI);
  120           EMLRTPOPRTSTACK(&eb_emlrtRSI);
  121           EMLRTPOPRTSTACK(&db_emlrtRSI);
  122           EMLRTPOPRTSTACK(&cb_emlrtRSI);
  123           EMLRTPOPRTSTACK(&bb_emlrtRSI);
  124           info = 0;
  125           if (!(A_data[0] != 0.0)) {
  126               info = 1;
  127           }
  128           EMLRTPOPRTSTACK(&ab_emlrtRSI);
  129           EMLRTPOPRTSTACK(&y_emlrtRSI);
  130           EMLRTPOPRTSTACK(&w_emlrtRSI);
  131           if (info > 0) {
  132               EMLRTPUSHRTSTACK(&x_emlrtRSI);
  133               EMLRTPUSHRTSTACK(&rb_emlrtRSI);
  134               eml_warning();
  135               EMLRTPOPRTSTACK(&rb_emlrtRSI);
  136               EMLRTPOPRTSTACK(&x_emlrtRSI);
  137           }
  138           EMLRTPUSHRTSTACK(&v_emlrtRSI);
  139           EMLRTPUSHRTSTACK(&tb_emlrtRSI);
  140           Y_sizes[0] = B_sizes[0];
  141           Y_sizes[1] = B_sizes[1];
  142           info = B_sizes[0] * B_sizes[1] - 1;
  143           for (n = 0; n <= info; n++) {
  144               Y_data[n] = B_data[n];
  145           }
  146           EMLRTPUSHRTSTACK(&vb_emlrtRSI);
  147           info = 1;
  148           n = 1;
  149           alpha1 = 1.0;
  150           SIDE = 'L';
  151           UPLO = 'L';
  152           TRANSA = 'N';
  153           DIAGA = 'U';
  154           EMLRTPUSHRTSTACK(&wb_emlrtRSI);
  155           dtrsm32(&SIDE, &UPLO, &TRANSA, &DIAGA, &info, &n, &alpha1, &A_data[0], &b_n, &Y_data[0], &b_n);
  156           EMLRTPOPRTSTACK(&wb_emlrtRSI);
  157           EMLRTPOPRTSTACK(&vb_emlrtRSI);
  158           EMLRTPOPRTSTACK(&tb_emlrtRSI);
  159           EMLRTPOPRTSTACK(&v_emlrtRSI);
  160           EMLRTPUSHRTSTACK(&u_emlrtRSI);
  161           eml_xtrsm(1, 1, A_data, A_sizes, 1, Y_data, Y_sizes, 1);
  162           EMLRTPOPRTSTACK(&u_emlrtRSI);
  163           EMLRTPOPRTSTACK(&t_emlrtRSI);
  164           EMLRTPOPRTSTACK(&r_emlrtRSI);
  165       }
  166   }
  167   /* End of code generation (mldivide.c) */
  168