Optimal_affine_tracking_3d16_fast_realtime_emxutil.cpp
Go to the documentation of this file.
00001 /*
00002  * Optimal_affine_tracking_3d16_fast_realtime_emxutil.cpp
00003  *
00004  * Code generation for function 'Optimal_affine_tracking_3d16_fast_realtime_emxutil'
00005  *
00006  * C source code generated on: Wed Jul 24 16:11:35 2013
00007  *
00008  */
00009 
00010 /* Include files */
00011 #include "rt_nonfinite.h"
00012 #include "Optimal_affine_tracking_3d16_fast_realtime.h"
00013 #include "Optimal_affine_tracking_3d16_fast_realtime_emxutil.h"
00014 
00015 /* Type Definitions */
00016 
00017 /* Named Constants */
00018 
00019 /* Variable Declarations */
00020 
00021 /* Variable Definitions */
00022 
00023 /* Function Declarations */
00024 
00025 /* Function Definitions */
00026 void emxEnsureCapacity(emxArray__common *emxArray, int32_T oldNumel, int32_T
00027   elementSize)
00028 {
00029   int32_T newNumel;
00030   int32_T loop_ub;
00031   int32_T i;
00032   void *newData;
00033   newNumel = 1;
00034   loop_ub = emxArray->numDimensions - 1;
00035   for (i = 0; i <= loop_ub; i++) {
00036     newNumel *= emxArray->size[i];
00037   }
00038 
00039   if (newNumel > emxArray->allocatedSize) {
00040     loop_ub = emxArray->allocatedSize;
00041     if (loop_ub < 16) {
00042       loop_ub = 16;
00043     }
00044 
00045     while (loop_ub < newNumel) {
00046       loop_ub <<= 1;
00047     }
00048 
00049     newData = calloc((uint32_T)loop_ub, (uint32_T)elementSize);
00050     if (emxArray->data != NULL) {
00051       memcpy(newData, emxArray->data, (uint32_T)(elementSize * oldNumel));
00052       if (emxArray->canFreeData) {
00053         free(emxArray->data);
00054       }
00055     }
00056 
00057     emxArray->data = newData;
00058     emxArray->allocatedSize = loop_ub;
00059     emxArray->canFreeData = TRUE;
00060   }
00061 }
00062 
00063 void emxFree_real_T(emxArray_real_T **pEmxArray)
00064 {
00065   if (*pEmxArray != (emxArray_real_T *)NULL) {
00066     if ((*pEmxArray)->canFreeData) {
00067       free((void *)(*pEmxArray)->data);
00068     }
00069 
00070     free((void *)(*pEmxArray)->size);
00071     free((void *)*pEmxArray);
00072     *pEmxArray = (emxArray_real_T *)NULL;
00073   }
00074 }
00075 
00076 void emxInit_real_T(emxArray_real_T **pEmxArray, int32_T numDimensions)
00077 {
00078   emxArray_real_T *emxArray;
00079   int32_T loop_ub;
00080   int32_T i;
00081   *pEmxArray = (emxArray_real_T *)malloc(sizeof(emxArray_real_T));
00082   emxArray = *pEmxArray;
00083   emxArray->data = (real_T *)NULL;
00084   emxArray->numDimensions = numDimensions;
00085   emxArray->size = (int32_T *)malloc((uint32_T)(sizeof(int32_T) * numDimensions));
00086   emxArray->allocatedSize = 0;
00087   emxArray->canFreeData = TRUE;
00088   loop_ub = numDimensions - 1;
00089   for (i = 0; i <= loop_ub; i++) {
00090     emxArray->size[i] = 0;
00091   }
00092 }
00093 
00094 /* End of code generation (Optimal_affine_tracking_3d16_fast_realtime_emxutil.cpp) */


depth_tracker_ros_vr8
Author(s): shusain
autogenerated on Fri Dec 6 2013 20:45:47