File: _coder_calculateTransformations_api.c

    1   /*
    2    * Academic License - for use in teaching, academic research, and meeting
    3    * course requirements at degree granting institutions only.  Not for
    4    * government, commercial, or other organizational use.
    5    *
    6    * _coder_calculateTransformations_api.c
    7    *
    8    * Code generation for function '_coder_calculateTransformations_api'
    9    *
   10    */
   11   
   12   /* Include files */
   13   #include "rt_nonfinite.h"
   14   #include "calculateTransformations.h"
   15   #include "_coder_calculateTransformations_api.h"
   16   #include "calculateTransformations_data.h"
   17   
   18   /* Function Declarations */
   19   static real_T (*b_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   20     emlrtMsgIdentifier *parentId))[5];
   21   static real_T (*c_emlrt_marshallIn(const emlrtStack *sp, const mxArray
   22     *eta_marker, const char_T *identifier))[6];
   23   static const mxArray *c_emlrt_marshallOut(const real_T u[16]);
   24   static real_T (*d_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   25     emlrtMsgIdentifier *parentId))[6];
   26   static const mxArray *d_emlrt_marshallOut(const real_T u[9]);
   27   static real_T (*e_emlrt_marshallIn(const emlrtStack *sp, const mxArray
   28     *g_marker2front, const char_T *identifier))[16];
   29   static const mxArray *e_emlrt_marshallOut(const real_T u[6]);
   30   static real_T (*emlrt_marshallIn(const emlrtStack *sp, const mxArray *q1, const
   31     char_T *identifier))[5];
   32   static real_T (*f_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   33     emlrtMsgIdentifier *parentId))[16];
   34   static const mxArray *f_emlrt_marshallOut(const real_T u[8]);
   35   static real_T g_emlrt_marshallIn(const emlrtStack *sp, const mxArray
   36     *controlCenterLink, const char_T *identifier);
   37   static const mxArray *g_emlrt_marshallOut(const real_T u[144]);
   38   static real_T h_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   39     emlrtMsgIdentifier *parentId);
   40   static const mxArray *h_emlrt_marshallOut(const real_T u[112]);
   41   static real_T (*i_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src,
   42     const emlrtMsgIdentifier *msgId))[5];
   43   static real_T (*j_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src,
   44     const emlrtMsgIdentifier *msgId))[6];
   45   static real_T (*k_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src,
   46     const emlrtMsgIdentifier *msgId))[16];
   47   static real_T l_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src, const
   48     emlrtMsgIdentifier *msgId);
   49   
   50   /* Function Definitions */
   51   static real_T (*b_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   52     emlrtMsgIdentifier *parentId))[5]
   53   {
   54     real_T (*y)[5];
   55     y = i_emlrt_marshallIn(sp, emlrtAlias(u), parentId);
   56     emlrtDestroyArray(&u);
   57     return y;
   58   }
   59     static real_T (*c_emlrt_marshallIn(const emlrtStack *sp, const mxArray
   60     *eta_marker, const char_T *identifier))[6]
   61   {
   62     real_T (*y)[6];
   63     emlrtMsgIdentifier thisId;
   64     thisId.fIdentifier = identifier;
   65     thisId.fParent = NULL;
   66     thisId.bParentIsCell = false;
   67     y = d_emlrt_marshallIn(sp, emlrtAlias(eta_marker), &thisId);
   68     emlrtDestroyArray(&eta_marker);
   69     return y;
   70   }
   71   
   72   static const mxArray *c_emlrt_marshallOut(const real_T u[16])
   73   {
   74     const mxArray *y;
   75     static const int32_T iv5[2] = { 0, 0 };
   76   
   77     const mxArray *m2;
   78     static const int32_T iv6[2] = { 4, 4 };
   79   
   80     y = NULL;
   81     m2 = emlrtCreateNumericArray(2, iv5, mxDOUBLE_CLASS, mxREAL);
   82     mxSetData((mxArray *)m2, (void *)u);
   83     emlrtSetDimensions((mxArray *)m2, iv6, 2);
   84     emlrtAssign(&y, m2);
   85     return y;
   86   }
   87   
   88   static real_T (*d_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   89     emlrtMsgIdentifier *parentId))[6]
   90   {
   91     real_T (*y)[6];
   92     y = j_emlrt_marshallIn(sp, emlrtAlias(u), parentId);
   93     emlrtDestroyArray(&u);
   94     return y;
   95   }
   96     static const mxArray *d_emlrt_marshallOut(const real_T u[9])
   97   {
   98     const mxArray *y;
   99     static const int32_T iv7[2] = { 0, 0 };
  100   
  101     const mxArray *m3;
  102     static const int32_T iv8[2] = { 3, 3 };
  103   
  104     y = NULL;
  105     m3 = emlrtCreateNumericArray(2, iv7, mxDOUBLE_CLASS, mxREAL);
  106     mxSetData((mxArray *)m3, (void *)u);
  107     emlrtSetDimensions((mxArray *)m3, iv8, 2);
  108     emlrtAssign(&y, m3);
  109     return y;
  110   }
  111   
  112   static real_T (*e_emlrt_marshallIn(const emlrtStack *sp, const mxArray
  113     *g_marker2front, const char_T *identifier))[16]
  114   {
  115     real_T (*y)[16];
  116     emlrtMsgIdentifier thisId;
  117     thisId.fIdentifier = identifier;
  118     thisId.fParent = NULL;
  119     thisId.bParentIsCell = false;
  120     y = f_emlrt_marshallIn(sp, emlrtAlias(g_marker2front), &thisId);
  121     emlrtDestroyArray(&g_marker2front);
  122     return y;
  123   }
  124     static const mxArray *e_emlrt_marshallOut(const real_T u[6])
  125   {
  126     const mxArray *y;
  127     static const int32_T iv9[1] = { 0 };
  128   
  129     const mxArray *m4;
  130     static const int32_T iv10[1] = { 6 };
  131   
  132     y = NULL;
  133     m4 = emlrtCreateNumericArray(1, iv9, mxDOUBLE_CLASS, mxREAL);
  134     mxSetData((mxArray *)m4, (void *)u);
  135     emlrtSetDimensions((mxArray *)m4, iv10, 1);
  136     emlrtAssign(&y, m4);
  137     return y;
  138   }
  139   
  140   static real_T (*emlrt_marshallIn(const emlrtStack *sp, const mxArray *q1, const
  141     char_T *identifier))[5]
  142   {
  143     real_T (*y)[5];
  144     emlrtMsgIdentifier thisId;
  145     thisId.fIdentifier = identifier;
  146     thisId.fParent = NULL;
  147     thisId.bParentIsCell = false;
  148     y = b_emlrt_marshallIn(sp, emlrtAlias(q1), &thisId);
  149     emlrtDestroyArray(&q1);
  150     return y;
  151   }
  152     static real_T (*f_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u,
  153     const emlrtMsgIdentifier *parentId))[16]
  154   {
  155     real_T (*y)[16];
  156     y = k_emlrt_marshallIn(sp, emlrtAlias(u), parentId);
  157     emlrtDestroyArray(&u);
  158     return y;
  159   }
  160   
  161   static const mxArray *f_emlrt_marshallOut(const real_T u[8])
  162   {
  163     const mxArray *y;
  164     static const int32_T iv11[1] = { 0 };
  165   
  166     const mxArray *m5;
  167     static const int32_T iv12[1] = { 8 };
  168   
  169     y = NULL;
  170     m5 = emlrtCreateNumericArray(1, iv11, mxDOUBLE_CLASS, mxREAL);
  171     mxSetData((mxArray *)m5, (void *)u);
  172     emlrtSetDimensions((mxArray *)m5, iv12, 1);
  173     emlrtAssign(&y, m5);
  174     return y;
  175   }
  176   
  177   static real_T g_emlrt_marshallIn(const emlrtStack *sp, const mxArray
  178     *controlCenterLink, const char_T *identifier)
  179   {
  180     real_T y;
  181     emlrtMsgIdentifier thisId;
  182     thisId.fIdentifier = identifier;
  183     thisId.fParent = NULL;
  184     thisId.bParentIsCell = false;
  185     y = h_emlrt_marshallIn(sp, emlrtAlias(controlCenterLink), &thisId);
  186     emlrtDestroyArray(&controlCenterLink);
  187     return y;
  188   }
  189   
  190   static const mxArray *g_emlrt_marshallOut(const real_T u[144])
  191   {
  192     const mxArray *y;
  193     static const int32_T iv13[3] = { 0, 0, 0 };
  194   
  195     const mxArray *m6;
  196     static const int32_T iv14[3] = { 4, 4, 9 };
  197   
  198     y = NULL;
  199     m6 = emlrtCreateNumericArray(3, iv13, mxDOUBLE_CLASS, mxREAL);
  200     mxSetData((mxArray *)m6, (void *)u);
  201     emlrtSetDimensions((mxArray *)m6, iv14, 3);
  202     emlrtAssign(&y, m6);
  203     return y;
  204   }
  205   
  206   static real_T h_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
  207     emlrtMsgIdentifier *parentId)
  208   {
  209     real_T y;
  210     y = l_emlrt_marshallIn(sp, emlrtAlias(u), parentId);
  211     emlrtDestroyArray(&u);
  212     return y;
  213   }
  214   
  215   static const mxArray *h_emlrt_marshallOut(const real_T u[112])
  216   {
  217     const mxArray *y;
  218     static const int32_T iv15[3] = { 0, 0, 0 };
  219   
  220     const mxArray *m7;
  221     static const int32_T iv16[3] = { 4, 4, 7 };
  222   
  223     y = NULL;
  224     m7 = emlrtCreateNumericArray(3, iv15, mxDOUBLE_CLASS, mxREAL);
  225     mxSetData((mxArray *)m7, (void *)u);
  226     emlrtSetDimensions((mxArray *)m7, iv16, 3);
  227     emlrtAssign(&y, m7);
  228     return y;
  229   }
  230   
  231   static real_T (*i_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src,
  232     const emlrtMsgIdentifier *msgId))[5]
  233   {
  234     real_T (*ret)[5];
  235     static const int32_T dims[1] = { 5 };
  236   
  237     emlrtCheckBuiltInR2012b(sp, msgId, src, "double", false, 1U, dims);
  238     ret = (real_T (*)[5])mxGetData(src);
  239     emlrtDestroyArray(&src);
  240     return ret;
  241   }
  242     static real_T (*j_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src,
  243     const emlrtMsgIdentifier *msgId))[6]
  244   {
  245     real_T (*ret)[6];
  246     static const int32_T dims[1] = { 6 };
  247   
  248     emlrtCheckBuiltInR2012b(sp, msgId, src, "double", false, 1U, dims);
  249     ret = (real_T (*)[6])mxGetData(src);
  250     emlrtDestroyArray(&src);
  251     return ret;
  252   }
  253   
  254   static real_T (*k_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src,
  255     const emlrtMsgIdentifier *msgId))[16]
  256   {
  257     real_T (*ret)[16];
  258     static const int32_T dims[2] = { 4, 4 };
  259   
  260     emlrtCheckBuiltInR2012b(sp, msgId, src, "double", false, 2U, dims);
  261     ret = (real_T (*)[16])mxGetData(src);
  262     emlrtDestroyArray(&src);
  263     return ret;
  264   }
  265     static real_T l_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src,
  266     const emlrtMsgIdentifier *msgId)
  267   {
  268     real_T ret;
  269     static const int32_T dims = 0;
  270     emlrtCheckBuiltInR2012b(sp, msgId, src, "double", false, 0U, &dims);
  271     ret = *(real_T *)mxGetData(src);
  272     emlrtDestroyArray(&src);
  273     return ret;
  274   }
  275   
  276   void calculateTransformations_api(const mxArray * const prhs[5], const mxArray
  277     *plhs[10])
  278   {
  279     real_T (*g_If)[16];
  280     real_T (*R_If)[9];
  281     real_T (*eta_f)[6];
  282     real_T (*g_Ib)[16];
  283     real_T (*R_Ib)[9];
  284     real_T (*eta_b)[6];
  285     real_T (*q)[8];
  286     real_T (*g_joints_home)[144];
  287     real_T (*g_moduleCM)[144];
  288     real_T (*g_thrusters)[112];
  289     real_T (*q1)[5];
  290     real_T (*q2)[5];
  291     real_T (*eta_marker)[6];
  292     real_T (*g_marker2front)[16];
  293     real_T controlCenterLink;
  294     emlrtStack st = { NULL, NULL, NULL };
  295   
  296     st.tls = emlrtRootTLSGlobal;
  297     g_If = (real_T (*)[16])mxMalloc(sizeof(real_T [16]));
  298     R_If = (real_T (*)[9])mxMalloc(sizeof(real_T [9]));
  299     eta_f = (real_T (*)[6])mxMalloc(sizeof(real_T [6]));
  300     g_Ib = (real_T (*)[16])mxMalloc(sizeof(real_T [16]));
  301     R_Ib = (real_T (*)[9])mxMalloc(sizeof(real_T [9]));
  302     eta_b = (real_T (*)[6])mxMalloc(sizeof(real_T [6]));
  303     q = (real_T (*)[8])mxMalloc(sizeof(real_T [8]));
  304     g_joints_home = (real_T (*)[144])mxMalloc(sizeof(real_T [144]));
  305     g_moduleCM = (real_T (*)[144])mxMalloc(sizeof(real_T [144]));
  306     g_thrusters = (real_T (*)[112])mxMalloc(sizeof(real_T [112]));
  307   
  308     /* Marshall function inputs */
  309     q1 = emlrt_marshallIn(&st, emlrtAlias(prhs[0]), "q1");
  310     q2 = emlrt_marshallIn(&st, emlrtAlias(prhs[1]), "q2");
  311     eta_marker = c_emlrt_marshallIn(&st, emlrtAlias(prhs[2]), "eta_marker");
  312     g_marker2front = e_emlrt_marshallIn(&st, emlrtAlias(prhs[3]), "g_marker2front");
  313     controlCenterLink = g_emlrt_marshallIn(&st, emlrtAliasP(prhs[4]),
  314       "controlCenterLink");
  315   
  316     /* Invoke the target function */
  317     calculateTransformations(&st, *q1, *q2, *eta_marker, *g_marker2front,
  318       controlCenterLink, *g_If, *R_If, *eta_f, *g_Ib, *R_Ib, *eta_b, *q,
  319       *g_joints_home, *g_moduleCM, *g_thrusters);
  320   
  321     /* Marshall function outputs */
  322     plhs[0] = c_emlrt_marshallOut(*g_If);
  323     plhs[1] = d_emlrt_marshallOut(*R_If);
  324     plhs[2] = e_emlrt_marshallOut(*eta_f);
  325     plhs[3] = c_emlrt_marshallOut(*g_Ib);
  326     plhs[4] = d_emlrt_marshallOut(*R_Ib);
  327     plhs[5] = e_emlrt_marshallOut(*eta_b);
  328     plhs[6] = f_emlrt_marshallOut(*q);
  329     plhs[7] = g_emlrt_marshallOut(*g_joints_home);
  330     plhs[8] = g_emlrt_marshallOut(*g_moduleCM);
  331     plhs[9] = h_emlrt_marshallOut(*g_thrusters);
  332   }
  333   
  334   /* End of code generation (_coder_calculateTransformations_api.c) */
  335