• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ emxEnsureCapacity函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中emxEnsureCapacity函数的典型用法代码示例。如果您正苦于以下问题:C++ emxEnsureCapacity函数的具体用法?C++ emxEnsureCapacity怎么用?C++ emxEnsureCapacity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了emxEnsureCapacity函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: b_sum

/* Function Definitions */
void b_sum(const emxArray_real_T *x, emxArray_real_T *y)
{
  uint32_T sz[2];
  int32_T iy;
  int32_T ixstart;
  int32_T j;
  real_T s;
  for (iy = 0; iy < 2; iy++) {
    sz[iy] = (uint32_T)x->size[iy];
  }

  iy = y->size[0];
  y->size[0] = (int32_T)sz[0];
  emxEnsureCapacity((emxArray__common *)y, iy, (int32_T)sizeof(real_T));
  if (x->size[0] == 0) {
    iy = y->size[0];
    y->size[0] = (int32_T)sz[0];
    emxEnsureCapacity((emxArray__common *)y, iy, (int32_T)sizeof(real_T));
    ixstart = (int32_T)sz[0];
    for (iy = 0; iy < ixstart; iy++) {
      y->data[iy] = 0.0;
    }
  } else {
    iy = -1;
    ixstart = -1;
    for (j = 1; j <= x->size[0]; j++) {
      ixstart++;
      s = x->data[ixstart] + x->data[ixstart + x->size[0]];
      iy++;
      y->data[iy] = s;
    }
  }
}
开发者ID:epfl-disal,项目名称:SwarmViz,代码行数:34,代码来源:sum.c


示例2: Assign_otherMakers_1

 void Assign_otherMakers_1(emxArray_struct1_T *otherMakers, double
	visual_k, double frequency, double time, const emxArray_real_T *Position, int
	otherMakersN)
{
	struct1_T b_otherMakers;
	struct1_T c_otherMakers;
	int i1;
	int loop_ub;
	emxInitStruct_struct1_T(&b_otherMakers);
	emxInitStruct_struct1_T(&c_otherMakers);

	// % 给 otherMakers 赋值函数 1
	otherMakers->data[(int)visual_k - 1].frequency = frequency;
	otherMakers->data[(int)visual_k - 1].time = time;
	i1 = otherMakers->data[(int)visual_k - 1].Position->size[0] *
		otherMakers->data[(int)visual_k - 1].Position->size[1];
	otherMakers->data[(int)visual_k - 1].Position->size[0] = 3;
	emxEnsureCapacity((emxArray__common *)otherMakers->data[(int)visual_k - 1].
		Position, i1, (int)sizeof(double));
	i1 = otherMakers->data[(int)visual_k - 1].Position->size[0] *
		otherMakers->data[(int)visual_k - 1].Position->size[1];
	otherMakers->data[(int)visual_k - 1].Position->size[1] = Position->size[1];
	emxEnsureCapacity((emxArray__common *)otherMakers->data[(int)visual_k - 1].
		Position, i1, (int)sizeof(double));
	emxCopyStruct_struct1_T(&b_otherMakers, &otherMakers->data[(int)visual_k - 1]);
	emxCopyStruct_struct1_T(&c_otherMakers, &otherMakers->data[(int)visual_k - 1]);
	loop_ub = Position->size[0] * Position->size[1];
	emxFreeStruct_struct1_T(&c_otherMakers);
	emxFreeStruct_struct1_T(&b_otherMakers);
	for (i1 = 0; i1 < loop_ub; i1++) {
		otherMakers->data[(int)visual_k - 1].Position->data[i1] = Position->data[i1];
	}

	otherMakers->data[(int)visual_k - 1].otherMakersN = otherMakersN;
}
开发者ID:michille78,项目名称:program_xyz,代码行数:35,代码来源:MATLABSupport1.cpp


示例3: Cone

/* Function Definitions */
void Cone(const emlrtStack *sp, real_T k, const emxArray_real_T *x, const
          emxArray_real_T *gridX, const emxArray_real_T *t, emxArray_real_T
          *vals)
{
    int32_T t_idx_0;
    int32_T i49;
    int32_T l;
    int32_T i50;
    int32_T i51;
    int32_T i52;
    int32_T i53;
    int32_T i54;
    emlrtStack st;
    st.prev = sp;
    st.tls = sp->tls;

    /*  calculate the matrix Cone for a specific space point x_k, for all times */
    /*  t_i in A */
    /*  points x_k=1:numel(spacePoints) */
    t_idx_0 = t->size[1];
    i49 = vals->size[0] * vals->size[1];
    vals->size[0] = t_idx_0;
    emxEnsureCapacity(sp, (emxArray__common *)vals, i49, (int32_T)sizeof(real_T),
                      &v_emlrtRTEI);
    t_idx_0 = x->size[1];
    i49 = vals->size[0] * vals->size[1];
    vals->size[1] = t_idx_0;
    emxEnsureCapacity(sp, (emxArray__common *)vals, i49, (int32_T)sizeof(real_T),
                      &v_emlrtRTEI);
    t_idx_0 = t->size[1] * x->size[1];
    for (i49 = 0; i49 < t_idx_0; i49++) {
        vals->data[i49] = 0.0;
    }

    t_idx_0 = 1;
    while (t_idx_0 - 1 <= t->size[1] - 1) {
        l = 0;
        while (l <= x->size[1] - 1) {
            i49 = vals->size[0];
            i50 = vals->size[1];
            i51 = 1 + l;
            i52 = x->size[1];
            i53 = (int32_T)emlrtIntegerCheckFastR2012b(k, &nb_emlrtDCI, sp);
            i54 = t->size[1];
            st.site = &le_emlrtRSI;
            vals->data[(emlrtDynamicBoundsCheckFastR2012b(t_idx_0, 1, i49,
                        &je_emlrtBCI, sp) + vals->size[0] * (emlrtDynamicBoundsCheckFastR2012b
                                (i51, 1, i50, &ke_emlrtBCI, sp) - 1)) - 1] = b_Ccoeff(&st, 1.0 + (real_T)
                                        l, x->data[emlrtDynamicBoundsCheckFastR2012b(i53, 1, i52, &le_emlrtBCI,
                                                   sp) - 1], t->data[emlrtDynamicBoundsCheckFastR2012b(t_idx_0, 1, i54,
                                                           &me_emlrtBCI, sp) - 1], gridX);
            l++;
            emlrtBreakCheckFastR2012b(emlrtBreakCheckR2012bFlagVar, sp);
        }

        t_idx_0++;
        emlrtBreakCheckFastR2012b(emlrtBreakCheckR2012bFlagVar, sp);
    }
}
开发者ID:ofirENS,项目名称:TestFiles,代码行数:60,代码来源:Cone.c


示例4: b_sum

/* Function Definitions */
void b_sum(const emlrtStack *sp, const emxArray_real_T *x, emxArray_real_T *y)
{
  uint32_T sz[2];
  int32_T iy;
  int32_T ixstart;
  boolean_T overflow;
  int32_T j;
  int32_T ix;
  real_T s;
  int32_T k;
  emlrtStack st;
  emlrtStack b_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  for (iy = 0; iy < 2; iy++) {
    sz[iy] = (uint32_T)x->size[iy];
  }

  iy = y->size[0];
  y->size[0] = (int32_T)sz[0];
  emxEnsureCapacity(sp, (emxArray__common *)y, iy, (int32_T)sizeof(real_T),
                    &q_emlrtRTEI);
  if (x->size[0] == 0) {
    iy = y->size[0];
    y->size[0] = (int32_T)sz[0];
    emxEnsureCapacity(sp, (emxArray__common *)y, iy, (int32_T)sizeof(real_T),
                      &sb_emlrtRTEI);
    ixstart = (int32_T)sz[0];
    for (iy = 0; iy < ixstart; iy++) {
      y->data[iy] = 0.0;
    }
  } else {
    iy = -1;
    ixstart = -1;
    st.site = &be_emlrtRSI;
    overflow = (x->size[0] > 2147483646);
    if (overflow) {
      b_st.site = &db_emlrtRSI;
      check_forloop_overflow_error(&b_st);
    }

    for (j = 1; j <= x->size[0]; j++) {
      ixstart++;
      ix = ixstart;
      s = x->data[ixstart];
      for (k = 0; k < 2; k++) {
        ix += x->size[0];
        s += x->data[ix];
      }

      iy++;
      y->data[iy] = s;
    }
  }
}
开发者ID:ofirENS,项目名称:TestFiles,代码行数:58,代码来源:sum.c


示例5: diag

void diag(const emlrtStack *sp, const emxArray_real_T *v, emxArray_real_T *d)
{
  int32_T m;
  int32_T n;
  int32_T stride;
  boolean_T b1;
  emlrtStack st;
  emlrtStack b_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  if ((v->size[0] == 1) && (v->size[1] == 1)) {
    m = d->size[0];
    d->size[0] = 1;
    emxEnsureCapacity(sp, (emxArray__common *)d, m, (int32_T)sizeof(real_T),
                      &g_emlrtRTEI);
    d->data[0] = v->data[0];
  } else {
    if (!((v->size[0] == 1) || (v->size[1] == 1))) {
    } else {
      emlrtErrorWithMessageIdR2012b(sp, &j_emlrtRTEI,
        "Coder:toolbox:diag_varsizedMatrixVector", 0);
    }

    m = v->size[0];
    n = v->size[1];
    if (0 < v->size[1]) {
      n = muIntScalarMin_sint32(m, n);
      stride = v->size[0] + 1;
    } else {
      n = 0;
      stride = 0;
    }

    m = d->size[0];
    d->size[0] = n;
    emxEnsureCapacity(sp, (emxArray__common *)d, m, (int32_T)sizeof(real_T),
                      &g_emlrtRTEI);
    st.site = &j_emlrtRSI;
    if (1 > n) {
      b1 = false;
    } else {
      b1 = (n > 2147483646);
    }

    if (b1) {
      b_st.site = &k_emlrtRSI;
      check_forloop_overflow_error(&b_st);
    }

    for (m = 0; m + 1 <= n; m++) {
      d->data[m] = v->data[m * stride];
    }
  }
}
开发者ID:ofirENS,项目名称:Utils,代码行数:56,代码来源:diag.c


示例6: deci2bin

/*
 * 十进制数x转化为二进制数,二进制数至少表示为t位
 * Arguments    : double x
 *                double t
 *                emxArray_real_T *y
 * Return Type  : void
 */
void deci2bin(double x, double t, emxArray_real_T *y)
{
  int i2;
  int loop_ub;
  unsigned int i;
  int i3;
  int i4;
  emxArray_real_T *b_y;
  i2 = y->size[0] * y->size[1];
  y->size[0] = 1;
  y->size[1] = (int)t;
  emxEnsureCapacity((emxArray__common *)y, i2, (int)sizeof(double));
  loop_ub = (int)t;
  for (i2 = 0; i2 < loop_ub; i2++) {
    y->data[i2] = 0.0;
  }

  i = 1U;
  while ((x >= 0.0) && (i <= t)) {
    y->data[(int)i - 1] = rt_remd_snf(x, 2.0);
    x = (x - y->data[(int)i - 1]) / 2.0;
    i++;
  }

  if (1.0 > t) {
    i2 = 1;
    i3 = 1;
    i4 = 0;
  } else {
    i2 = (int)t;
    i3 = -1;
    i4 = 1;
  }

  emxInit_real_T(&b_y, 2);
  loop_ub = b_y->size[0] * b_y->size[1];
  b_y->size[0] = 1;
  b_y->size[1] = div_s32_floor(i4 - i2, i3) + 1;
  emxEnsureCapacity((emxArray__common *)b_y, loop_ub, (int)sizeof(double));
  loop_ub = div_s32_floor(i4 - i2, i3);
  for (i4 = 0; i4 <= loop_ub; i4++) {
    b_y->data[b_y->size[0] * i4] = y->data[(i2 + i3 * i4) - 1];
  }

  i2 = y->size[0] * y->size[1];
  y->size[0] = 1;
  y->size[1] = b_y->size[1];
  emxEnsureCapacity((emxArray__common *)y, i2, (int)sizeof(double));
  loop_ub = b_y->size[1];
  for (i2 = 0; i2 < loop_ub; i2++) {
    y->data[y->size[0] * i2] = b_y->data[b_y->size[0] * i2];
  }

  emxFree_real_T(&b_y);
}
开发者ID:Hidestorm,项目名称:decode,代码行数:62,代码来源:deci2bin.c


示例7: b_repmat

//
// Arguments    : const int varargin_1[2]
//                emxArray_uint8_T *b
// Return Type  : void
//
void b_repmat(const int varargin_1[2], emxArray_uint8_T *b)
{
  int i38;
  int loop_ub;
  i38 = b->size[0] * b->size[1];
  b->size[0] = varargin_1[0];
  emxEnsureCapacity((emxArray__common *)b, i38, (int)sizeof(unsigned char));
  i38 = b->size[0] * b->size[1];
  b->size[1] = varargin_1[1];
  emxEnsureCapacity((emxArray__common *)b, i38, (int)sizeof(unsigned char));
  loop_ub = varargin_1[0] * varargin_1[1];
  for (i38 = 0; i38 < loop_ub; i38++) {
    b->data[i38] = 0;
  }
}
开发者ID:NickProkharau,项目名称:GSOC2015,代码行数:20,代码来源:repmat.cpp


示例8: repmat

//
// Arguments    : const int varargin_1[2]
//                emxArray_real_T *b
// Return Type  : void
//
void repmat(const int varargin_1[2], emxArray_real_T *b)
{
  int i11;
  int loop_ub;
  i11 = b->size[0] * b->size[1];
  b->size[0] = varargin_1[0];
  emxEnsureCapacity((emxArray__common *)b, i11, (int)sizeof(double));
  i11 = b->size[0] * b->size[1];
  b->size[1] = varargin_1[1];
  emxEnsureCapacity((emxArray__common *)b, i11, (int)sizeof(double));
  loop_ub = varargin_1[0] * varargin_1[1];
  for (i11 = 0; i11 < loop_ub; i11++) {
    b->data[i11] = rtMinusInf;
  }
}
开发者ID:NickProkharau,项目名称:GSOC2015,代码行数:20,代码来源:repmat.cpp


示例9: b_polyfit

void b_polyfit(const emxArray_real_T *x, const emxArray_real_T *y, double p[3])
{
  emxArray_real_T *V;
  int n;
  unsigned int unnamed_idx_0;
  int i22;
  int k;
  emxArray_real_T *b_y;
  double rr;
  double p1[3];
  emxInit_real_T(&V, 2);
  n = x->size[0] - 1;
  unnamed_idx_0 = (unsigned int)x->size[0];
  i22 = V->size[0] * V->size[1];
  V->size[0] = (int)unnamed_idx_0;
  V->size[1] = 3;
  emxEnsureCapacity((emxArray__common *)V, i22, (int)sizeof(double));
  if ((int)unnamed_idx_0 == 0) {
  } else {
    for (k = 0; k <= n; k++) {
      V->data[k + (V->size[0] << 1)] = 1.0;
    }

    for (k = 0; k <= n; k++) {
      V->data[k + V->size[0]] = x->data[k];
    }

    for (k = 0; k <= n; k++) {
      V->data[k] = x->data[k] * V->data[k + V->size[0]];
    }
  }

  b_emxInit_real_T(&b_y, 1);
  i22 = b_y->size[0];
  b_y->size[0] = y->size[0];
  emxEnsureCapacity((emxArray__common *)b_y, i22, (int)sizeof(double));
  k = y->size[0];
  for (i22 = 0; i22 < k; i22++) {
    b_y->data[i22] = y->data[i22];
  }

  b_eml_qrsolve(V, b_y, p1, &rr);
  emxFree_real_T(&b_y);
  emxFree_real_T(&V);
  for (i22 = 0; i22 < 3; i22++) {
    p[i22] = p1[i22];
  }
}
开发者ID:Erin-Mounts,项目名称:PDScores,代码行数:48,代码来源:polyfit.c


示例10: b_mrdivide

/*
 * Arguments    : emxArray_real_T *A
 *                const emxArray_real_T *B
 * Return Type  : void
 */
void b_mrdivide(emxArray_real_T *A, const emxArray_real_T *B)
{
  emxArray_real_T *b_B;
  emxArray_real_T *b_A;
  int i8;
  int loop_ub;
  double d2;
  emxInit_real_T1(&b_B, 1);
  emxInit_real_T1(&b_A, 1);
  if ((A->size[1] == 0) || (B->size[1] == 0)) {
    i8 = A->size[0] * A->size[1];
    A->size[0] = 1;
    A->size[1] = 1;
    emxEnsureCapacity((emxArray__common *)A, i8, (int)sizeof(double));
    A->data[0] = 0.0;
  } else if (1 == B->size[1]) {
    if (A->size[1] == 0) {
    } else {
      A->data[0] *= 1.0 / B->data[0];
    }
  } else {
    i8 = b_B->size[0];
    b_B->size[0] = B->size[1];
    emxEnsureCapacity((emxArray__common *)b_B, i8, (int)sizeof(double));
    loop_ub = B->size[1];
    for (i8 = 0; i8 < loop_ub; i8++) {
      b_B->data[i8] = B->data[B->size[0] * i8];
    }

    i8 = b_A->size[0];
    b_A->size[0] = A->size[1];
    emxEnsureCapacity((emxArray__common *)b_A, i8, (int)sizeof(double));
    loop_ub = A->size[1];
    for (i8 = 0; i8 < loop_ub; i8++) {
      b_A->data[i8] = A->data[A->size[0] * i8];
    }

    d2 = qrsolve(b_B, b_A);
    i8 = A->size[0] * A->size[1];
    A->size[0] = 1;
    A->size[1] = 1;
    emxEnsureCapacity((emxArray__common *)A, i8, (int)sizeof(double));
    A->data[0] = d2;
  }

  emxFree_real_T(&b_A);
  emxFree_real_T(&b_B);
}
开发者ID:Q55,项目名称:windrose,代码行数:53,代码来源:mrdivide.cpp


示例11: d_sort

/*
 * Arguments    : emxArray_real_T *x
 * Return Type  : void
 */
void d_sort(emxArray_real_T *x)
{
  emxArray_real_T *vwork;
  int i9;
  int k;
  int i10;
  emxArray_int32_T *b_vwork;
  emxInit_real_T2(&vwork, 1);
  i9 = x->size[1];
  k = x->size[1];
  i10 = vwork->size[0];
  vwork->size[0] = k;
  emxEnsureCapacity((emxArray__common *)vwork, i10, (int)sizeof(double));
  for (k = 0; k + 1 <= i9; k++) {
    vwork->data[k] = x->data[k];
  }

  emxInit_int32_T(&b_vwork, 1);
  sortIdx(vwork, b_vwork);
  k = 0;
  emxFree_int32_T(&b_vwork);
  while (k + 1 <= i9) {
    x->data[k] = vwork->data[k];
    k++;
  }

  emxFree_real_T(&vwork);
}
开发者ID:gsohal,项目名称:SeniorDesign,代码行数:32,代码来源:sort1.c


示例12: eye

void eye(real_T n, emxArray_real_T *I)
{
  int32_T q;
  int32_T loop_ub;
  real_T d0;
  q = I->size[0] * I->size[1];
  I->size[0] = (int32_T)n;
  I->size[1] = (int32_T)n;
  emxEnsureCapacity((emxArray__common *)I, q, (int32_T)sizeof(real_T));
  loop_ub = (int32_T)n * (int32_T)n - 1;
  for (q = 0; q <= loop_ub; q++) {
    I->data[q] = 0.0;
  }

  d0 = rt_roundd_snf(n);
  if (d0 < 2.147483648E+9) {
    if (d0 >= -2.147483648E+9) {
      q = (int32_T)d0;
    } else {
      q = MIN_int32_T;
    }
  } else if (d0 >= 2.147483648E+9) {
    q = MAX_int32_T;
  } else {
    q = 0;
  }

  if (q > 0) {
    for (loop_ub = 0; loop_ub + 1 <= q; loop_ub++) {
      I->data[loop_ub + I->size[0] * loop_ub] = 1.0;
    }
  }
}
开发者ID:cynthia-mason,项目名称:GRWorkspace,代码行数:33,代码来源:eye.c


示例13: sort

/*
 * Arguments    : double x_data[]
 *                int x_size[1]
 * Return Type  : void
 */
void sort(double x_data[], int x_size[1])
{
  int dim;
  int i6;
  double vwork_data[252];
  int vwork_size_idx_0;
  int vstride;
  int k;
  int j;
  emxArray_real_T *vwork;
  emxArray_int32_T *b_vwork;
  dim = nonSingletonDim(x_size);
  if (dim <= 1) {
    i6 = x_size[0];
  } else {
    i6 = 1;
  }

  vwork_size_idx_0 = (unsigned char)i6;
  vstride = 1;
  k = 1;
  while (k <= dim - 1) {
    vstride *= x_size[0];
    k = 2;
  }

  j = 0;
  emxInit_real_T2(&vwork, 1);
  emxInit_int32_T(&b_vwork, 1);
  while (j + 1 <= vstride) {
    for (k = 0; k + 1 <= i6; k++) {
      vwork_data[k] = x_data[j + k * vstride];
    }

    dim = vwork->size[0];
    vwork->size[0] = vwork_size_idx_0;
    emxEnsureCapacity((emxArray__common *)vwork, dim, (int)sizeof(double));
    for (dim = 0; dim < vwork_size_idx_0; dim++) {
      vwork->data[dim] = vwork_data[dim];
    }

    sortIdx(vwork, b_vwork);
    vwork_size_idx_0 = vwork->size[0];
    k = vwork->size[0];
    for (dim = 0; dim < k; dim++) {
      vwork_data[dim] = vwork->data[dim];
    }

    for (k = 0; k + 1 <= i6; k++) {
      x_data[j + k * vstride] = vwork->data[k];
    }

    j++;
  }

  emxFree_int32_T(&b_vwork);
  emxFree_real_T(&vwork);
}
开发者ID:gsohal,项目名称:SeniorDesign,代码行数:63,代码来源:sort1.c


示例14: c_sum

void c_sum(const emxArray_real_T *x, emxArray_real_T *y)
{
  uint32_T sz[2];
  int32_T ixstart;
  int32_T k;
  int32_T ix;
  int32_T iy;
  int32_T i;
  real_T s;
  for (ixstart = 0; ixstart < 2; ixstart++) {
    sz[ixstart] = (uint32_T)x->size[ixstart];
  }

  ixstart = y->size[0] * y->size[1];
  y->size[0] = 1;
  y->size[1] = (int32_T)sz[1];
  emxEnsureCapacity((emxArray__common *)y, ixstart, (int32_T)sizeof(real_T));
  if ((x->size[0] == 0) || (x->size[1] == 0)) {
    ixstart = y->size[0] * y->size[1];
    y->size[0] = 1;
    emxEnsureCapacity((emxArray__common *)y, ixstart, (int32_T)sizeof(real_T));
    ixstart = y->size[0] * y->size[1];
    y->size[1] = (int32_T)sz[1];
    emxEnsureCapacity((emxArray__common *)y, ixstart, (int32_T)sizeof(real_T));
    k = (int32_T)sz[1];
    for (ixstart = 0; ixstart < k; ixstart++) {
      y->data[ixstart] = 0.0;
    }
  } else {
    ix = -1;
    iy = -1;
    for (i = 1; i <= x->size[1]; i++) {
      ixstart = ix + 1;
      ix++;
      s = x->data[ixstart];
      for (k = 2; k <= x->size[0]; k++) {
        ix++;
        s += x->data[ix];
      }

      iy++;
      y->data[iy] = s;
    }
  }
}
开发者ID:epfl-disal,项目名称:SwarmViz,代码行数:45,代码来源:sum.c


示例15: b_diag

/* Function Definitions */
void b_diag(const emlrtStack *sp, const emxArray_real_T *v, emxArray_real_T *d)
{
  int32_T j;
  int32_T unnamed_idx_1;
  int32_T i3;
  boolean_T overflow;
  emlrtStack st;
  emlrtStack b_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  j = v->size[0];
  unnamed_idx_1 = v->size[0];
  i3 = d->size[0] * d->size[1];
  d->size[0] = j;
  emxEnsureCapacity(sp, (emxArray__common *)d, i3, (int32_T)sizeof(real_T),
                    &g_emlrtRTEI);
  i3 = d->size[0] * d->size[1];
  d->size[1] = unnamed_idx_1;
  emxEnsureCapacity(sp, (emxArray__common *)d, i3, (int32_T)sizeof(real_T),
                    &g_emlrtRTEI);
  j *= unnamed_idx_1;
  for (i3 = 0; i3 < j; i3++) {
    d->data[i3] = 0.0;
  }

  st.site = &l_emlrtRSI;
  if (1 > v->size[0]) {
    overflow = false;
  } else {
    overflow = (v->size[0] > 2147483646);
  }

  if (overflow) {
    b_st.site = &k_emlrtRSI;
    check_forloop_overflow_error(&b_st);
  }

  for (j = 0; j + 1 <= v->size[0]; j++) {
    d->data[j + d->size[0] * j] = v->data[j];
  }
}
开发者ID:ofirENS,项目名称:Utils,代码行数:44,代码来源:diag.c


示例16: diag

void diag(const emlrtStack *sp, const emxArray_real_T *v, emxArray_real_T *d)
{
  int32_T unnamed_idx_0;
  int32_T unnamed_idx_1;
  int32_T i76;
  boolean_T overflow;
  emlrtStack st;
  emlrtStack b_st;
  st.prev = sp;
  st.tls = sp->tls;
  b_st.prev = &st;
  b_st.tls = st.tls;
  unnamed_idx_0 = v->size[1] + 1;
  unnamed_idx_1 = v->size[1] + 1;
  i76 = d->size[0] * d->size[1];
  d->size[0] = unnamed_idx_0;
  emxEnsureCapacity(sp, (emxArray__common *)d, i76, (int32_T)sizeof(real_T),
                    &ib_emlrtRTEI);
  i76 = d->size[0] * d->size[1];
  d->size[1] = unnamed_idx_1;
  emxEnsureCapacity(sp, (emxArray__common *)d, i76, (int32_T)sizeof(real_T),
                    &ib_emlrtRTEI);
  unnamed_idx_0 *= unnamed_idx_1;
  for (i76 = 0; i76 < unnamed_idx_0; i76++) {
    d->data[i76] = 0.0;
  }

  st.site = &lf_emlrtRSI;
  if (1 > v->size[1]) {
    overflow = false;
  } else {
    overflow = (v->size[1] > 2147483646);
  }

  if (overflow) {
    b_st.site = &ic_emlrtRSI;
    check_forloop_overflow_error(&b_st);
  }

  for (unnamed_idx_0 = 1; unnamed_idx_0 <= v->size[1]; unnamed_idx_0++) {
    d->data[unnamed_idx_0 + d->size[0] * (unnamed_idx_0 - 1)] = 1.0;
  }
}
开发者ID:ofirENS,项目名称:TestFiles,代码行数:43,代码来源:diag.c


示例17: e_power

void e_power(const emxArray_real_T *a, emxArray_real_T *y)
{
  int k;
  k = y->size[0] * y->size[1];
  y->size[0] = 1;
  y->size[1] = a->size[1];
  emxEnsureCapacity((emxArray__common *)y, k, sizeof(double));
  for (k = 0; k + 1 <= a->size[1]; k++) {
    y->data[k] = a->data[k] * a->data[k];
  }
}
开发者ID:rnleander,项目名称:PlosCodes,代码行数:11,代码来源:power.c


示例18: sum

void sum(const emxArray_real_T *x, emxArray_real_T *y)
{
  uint32_T sz[2];
  int32_T iy;
  int32_T ixstart;
  int32_T j;
  int32_T ix;
  real_T s;
  int32_T k;
  for (iy = 0; iy < 2; iy++) {
    sz[iy] = (uint32_T)x->size[iy];
  }

  iy = y->size[0];
  y->size[0] = (int32_T)sz[0];
  emxEnsureCapacity((emxArray__common *)y, iy, (int32_T)sizeof(real_T));
  if ((x->size[0] == 0) || (x->size[1] == 0)) {
    iy = y->size[0];
    y->size[0] = (int32_T)sz[0];
    emxEnsureCapacity((emxArray__common *)y, iy, (int32_T)sizeof(real_T));
    ixstart = (int32_T)sz[0];
    for (iy = 0; iy < ixstart; iy++) {
      y->data[iy] = 0.0;
    }
  } else {
    iy = -1;
    ixstart = -1;
    for (j = 1; j <= x->size[0]; j++) {
      ixstart++;
      ix = ixstart;
      s = x->data[ixstart];
      for (k = 2; k <= x->size[1]; k++) {
        ix += x->size[0];
        s += x->data[ix];
      }

      iy++;
      y->data[iy] = s;
    }
  }
}
开发者ID:epfl-disal,项目名称:SwarmViz,代码行数:41,代码来源:sum.c


示例19: rdivide

void rdivide(const emxArray_real_T *x, double y, emxArray_real_T *z)
{
  int i3;
  int loop_ub;
  i3 = z->size[0];
  z->size[0] = x->size[0];
  emxEnsureCapacity((emxArray__common *)z, i3, (int)sizeof(double));
  loop_ub = x->size[0];
  for (i3 = 0; i3 < loop_ub; i3++) {
    z->data[i3] = x->data[i3] / y;
  }
}
开发者ID:Erin-Mounts,项目名称:PDScores,代码行数:12,代码来源:rdivide.c


示例20: rdivide

/* Function Definitions */
void rdivide(const emxArray_real_T *x, real_T y, emxArray_real_T *z)
{
  int32_T i1;
  int32_T loop_ub;
  i1 = z->size[0];
  z->size[0] = x->size[0];
  emxEnsureCapacity((emxArray__common *)z, i1, (int32_T)sizeof(real_T));
  loop_ub = x->size[0] - 1;
  for (i1 = 0; i1 <= loop_ub; i1++) {
    z->data[i1] = x->data[i1] / y;
  }
}
开发者ID:XuewuOx,项目名称:MatlabCoder_1b,代码行数:13,代码来源:rdivide.c



注:本文中的emxEnsureCapacity函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ emxFree_real_T函数代码示例发布时间:2022-05-30
下一篇:
C++ emu_fatalerror函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap