text: /*
   * Academic License - for use in teaching, academic research, and meeting
   * course requirements at degree granting institutions only.  Not for
   * government, commercial, or other organizational use.
   *
   * predict_emxutil.c
   *
   * Code generation for function 'predict_emxutil'
   *
   */
  
  /* Include files */
  #include "predict_emxutil.h"
  #include "predict_types.h"
  #include "rt_nonfinite.h"
  #include <stdlib.h>
  #include <string.h>
  
  /* Function Definitions */
  void c_emxInitStruct_classreg_learni(c_classreg_learning_regr_Compac *pStruct)
  {
    pStruct->PruneList.size[0] = 0;
  }
  
  void emxEnsureCapacity_real_T(emxArray_real_T *emxArray, int oldNumel)
  {
    int i;
    int newNumel;
    void *newData;
    if (oldNumel < 0) {
      oldNumel = 0;
    }
    newNumel = 1;
    for (i = 0; i < emxArray->numDimensions; i++) {
      newNumel *= emxArray->size[i];
    }
    if (newNumel > emxArray->allocatedSize) {
      i = emxArray->allocatedSize;
      if (i < 16) {
        i = 16;
      }
      while (i < newNumel) {
        if (i > 1073741823) {
          i = MAX_int32_T;
        } else {
          i *= 2;
        }
      }
      newData = calloc((unsigned int)i, sizeof(double));
      if (emxArray->data != NULL) {
        memcpy(newData, emxArray->data, sizeof(double) * oldNumel);
        if (emxArray->canFreeData) {
          free(emxArray->data);
        }
      }
      emxArray->data = (double *)newData;
      emxArray->allocatedSize = i;
      emxArray->canFreeData = true;
    }
  }
  
  void emxEnsureCapacity_uint8_T(emxArray_uint8_T *emxArray, int oldNumel)
  {
    int i;
    int newNumel;
    void *newData;
    if (oldNumel < 0) {
      oldNumel = 0;
    }
    newNumel = 1;
    for (i = 0; i < emxArray->numDimensions; i++) {
      newNumel *= emxArray->size[i];
    }
    if (newNumel > emxArray->allocatedSize) {
      i = emxArray->allocatedSize;
      if (i < 16) {
        i = 16;
      }
      while (i < newNumel) {
        if (i > 1073741823) {
          i = MAX_int32_T;
        } else {
          i *= 2;
        }
      }
      newData = calloc((unsigned int)i, sizeof(unsigned char));
      if (emxArray->data != NULL) {
        memcpy(newData, emxArray->data, sizeof(unsigned char) * oldNumel);
        if (emxArray->canFreeData) {
          free(emxArray->data);
        }
      }
      emxArray->data = (unsigned char *)newData;
      emxArray->allocatedSize = i;
      emxArray->canFreeData = true;
    }
  }
  
  void emxFree_real_T(emxArray_real_T **pEmxArray)
  {
    if (*pEmxArray != (emxArray_real_T *)NULL) {
      if (((*pEmxArray)->data != (double *)NULL) && (*pEmxArray)->canFreeData) {
        free((*pEmxArray)->data);
      }
      free((*pEmxArray)->size);
      free(*pEmxArray);
      *pEmxArray = (emxArray_real_T *)NULL;
    }
  }
  
  void emxFree_uint8_T(emxArray_uint8_T **pEmxArray)
  {
    if (*pEmxArray != (emxArray_uint8_T *)NULL) {
      if (((*pEmxArray)->data != (unsigned char *)NULL) &&
          (*pEmxArray)->canFreeData) {
        free((*pEmxArray)->data);
      }
      free((*pEmxArray)->size);
      free(*pEmxArray);
      *pEmxArray = (emxArray_uint8_T *)NULL;
    }
  }
  
  void emxInit_real_T(emxArray_real_T **pEmxArray, int numDimensions)
  {
    emxArray_real_T *emxArray;
    int i;
    *pEmxArray = (emxArray_real_T *)malloc(sizeof(emxArray_real_T));
    emxArray = *pEmxArray;
    emxArray->data = (double *)NULL;
    emxArray->numDimensions = numDimensions;
    emxArray->size = (int *)malloc(sizeof(int) * numDimensions);
    emxArray->allocatedSize = 0;
    emxArray->canFreeData = true;
    for (i = 0; i < numDimensions; i++) {
      emxArray->size[i] = 0;
    }
  }
  
  void emxInit_uint8_T(emxArray_uint8_T **pEmxArray, int numDimensions)
  {
    emxArray_uint8_T *emxArray;
    int i;
    *pEmxArray = (emxArray_uint8_T *)malloc(sizeof(emxArray_uint8_T));
    emxArray = *pEmxArray;
    emxArray->data = (unsigned char *)NULL;
    emxArray->numDimensions = numDimensions;
    emxArray->size = (int *)malloc(sizeof(int) * numDimensions);
    emxArray->allocatedSize = 0;
    emxArray->canFreeData = true;
    for (i = 0; i < numDimensions; i++) {
      emxArray->size[i] = 0;
    }
  }
  
  /* End of code generation (predict_emxutil.c) */
  