您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ vec_copy函数代码示例

51自学网 2021-06-03 09:35:59
  C++
这篇教程C++ vec_copy函数代码示例写得很实用,希望能帮到您。

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

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

示例1: column

void SMat<CoeffRing>::column2by2(size_t c1,                                 size_t c2,                                 elem a1,                                 elem a2,                                 elem b1,                                 elem b2)/* column(c1) <- a1 * column(c1) + a2 * column(c2),   column(c2) <- b1 * column(c1) + b2 * column(c2)*/{  // Make first column: v1 = a1*c1+a2*c2  sparsevec *v1 = vec_copy(columns_[c1]);  sparsevec *v2 = vec_copy(columns_[c2]);  vec_scale(v1, a1);  vec_scale(v2, a2);  vec_add_to(v1, v2);  // Second column: w1 = b1*c1 + b2*c2  sparsevec *w1 = columns_[c1];  sparsevec *w2 = columns_[c2];  vec_scale(w1, b1);  vec_scale(w2, b2);  vec_add_to(w1, w2);  // Set the matrices:  columns_[c1] = v1;  columns_[c2] = w1;}
开发者ID:BertiniM2,项目名称:M2,代码行数:28,


示例2: fprintf

// draw a line from a to bvoid POV3DisplayDevice::line(float *a, float*b) {  int i, j, test;  float dirvec[3], unitdirvec[3];  float from[3], to[3], tmp1[3], tmp2[3];  if (lineStyle == ::SOLIDLINE) {    // transform the world coordinates    (transMat.top()).multpoint3d(a, from);    (transMat.top()).multpoint3d(b, to);//    write_materials();    // Draw the line    fprintf(outfile, "VMD_line(<%.4f,%.4f,%.4f>,<%.4f,%.4f,%.4f>,",            from[0], from[1], -from[2], to[0], to[1], -to[2]);    fprintf(outfile, "rgbt<%.3f,%.3f,%.3f,%.3f>)/n",      matData[colorIndex][0], matData[colorIndex][1], matData[colorIndex][2],      1 - mat_opacity);  }   else if (lineStyle == ::DASHEDLINE) {    // transform the world coordinates    (transMat.top()).multpoint3d(a, tmp1);    (transMat.top()).multpoint3d(b, tmp2);    // how to create a dashed line    vec_sub(dirvec, tmp2, tmp1);  // vector from a to b    vec_copy(unitdirvec, dirvec);    vec_normalize(unitdirvec);    // unit vector from a to b    test = 1;    i = 0;    while (test == 1) {      for (j=0; j<3; j++) {        from[j] = (float) (tmp1[j] + (2*i)*DASH_LENGTH*unitdirvec[j]);        to[j] =   (float) (tmp1[j] + (2*i + 1)*DASH_LENGTH*unitdirvec[j]);      }      if (fabsf(tmp1[0] - to[0]) >= fabsf(dirvec[0])) {        vec_copy(to, tmp2);        test = 0;      }//      write_materials();      // Draw the line      fprintf(outfile, "VMD_line(<%.4f,%.4f,%.4f>,<%.4f,%.4f,%.4f>,",              from[0], from[1], -from[2], to[0], to[1], -to[2]);      fprintf(outfile, "rgbt<%.3f,%.3f,%.3f,%.3f>)/n",        matData[colorIndex][0], matData[colorIndex][1], matData[colorIndex][2],        1 - mat_opacity);      i++;    }  }   else {    msgErr << "POV3DisplayDevice: Unknown line style " << lineStyle << sendmsg;  }}
开发者ID:tmd-gpat,项目名称:MOLding,代码行数:58,


示例3: get_camera

static void get_camera(vector eye, vector at, vector up){	vector x, y, z;	get_camera_frame(x, y, z);	vec_copy(at, center);	vec_copy(eye, center);	vec_mad(eye, focal_len, z);	vec_copy(up, y);}
开发者ID:tianxiao,项目名称:catmull-clark,代码行数:10,


示例4: orthonormal_basis

void orthonormal_basis(const float b[9], float e[9]) {  float ob[3*3];  vec_copy(ob+0, b+0);  vec_copy(e+0, ob+0);  vec_normalize(e+0);  vec_triad(ob+3, b+3, -dot_prod(e+0, b+3), e+0);  vec_copy(e+3, ob+3);  vec_normalize(e+3);  vec_triad(ob+6,  b+6, -dot_prod(e+0, b+6), e+0);  vec_triad(ob+6, ob+6, -dot_prod(e+3, b+6), e+3);  vec_copy(e+6, ob+6);  vec_normalize(e+6);}
开发者ID:gzoppetti,项目名称:ExscitechVmd,代码行数:13,


示例5: s

int MoleculeGraphics::add_line(const float *x1, const float *x2, int style, int width) {  ShapeClass s(LINE, 8, next_id);  float *data = s.data;  vec_copy(data+0, x1);  vec_copy(data+3, x2);  data[6] = float(style) + 0.1f;  data[7] = float(width) + 0.1f;  if (next_index < num_elements())    shapes[next_index] = s;  else    shapes.append(s);  return added();}
开发者ID:tmd-gpat,项目名称:MOLding,代码行数:13,


示例6: fprintf

// draw a line (cylinder) from a to bvoid TachyonDisplayDevice::line(float *a, float*b) {  int i, j, test;  float dirvec[3], unitdirvec[3];  float from[3], to[3], tmp1[3], tmp2[3];      if (lineStyle == ::SOLIDLINE) {    // transform the world coordinates    (transMat.top()).multpoint3d(a, from);    (transMat.top()).multpoint3d(b, to);        // draw the cylinder    fprintf(outfile, "FCylinder/n"); // flat-ended cylinder    fprintf(outfile, "  Base %g %g %g/n", from[0], from[1], -from[2]);     fprintf(outfile, "  Apex %g %g %g/n", to[0], to[1], -to[2]);    fprintf(outfile, "  Rad %g /n", float(lineWidth)*DEFAULT_RADIUS);    write_cindexmaterial(colorIndex, materialIndex);  } else if (lineStyle == ::DASHEDLINE) {     // transform the world coordinates    (transMat.top()).multpoint3d(a, tmp1);    (transMat.top()).multpoint3d(b, tmp2);    // how to create a dashed line    vec_sub(dirvec, tmp2, tmp1);  // vector from a to b    vec_copy(unitdirvec, dirvec);    vec_normalize(unitdirvec);    // unit vector from a to b    test = 1;    i = 0;    while (test == 1) {      for (j=0; j<3; j++) {        from[j] = (float) (tmp1[j] + (2*i    )*DASH_LENGTH*unitdirvec[j]);          to[j] = (float) (tmp1[j] + (2*i + 1)*DASH_LENGTH*unitdirvec[j]);      }      if (fabsf(tmp1[0] - to[0]) >= fabsf(dirvec[0])) {        vec_copy(to, tmp2);        test = 0;      }          // draw the cylinder      fprintf(outfile, "FCylinder/n"); // flat-ended cylinder      fprintf(outfile, "  Base %g %g %g/n", from[0], from[1], -from[2]);       fprintf(outfile, "  Apex %g %g %g/n", to[0], to[1], -to[2]);      fprintf(outfile, "  Rad %g /n", float(lineWidth)*DEFAULT_RADIUS);      write_cindexmaterial(colorIndex, materialIndex);      i++;    }  } else {    msgErr << "TachyonDisplayDevice: Unknown line style "            << lineStyle << sendmsg;  }}
开发者ID:tmd-gpat,项目名称:MOLding,代码行数:52,


示例7: fprintf

// draw a line from a to bvoid MayaDisplayDevice::line(float *a, float*b) {  int i, j, test;  float dirvec[3], unitdirvec[3];  float from[3], to[3], tmp1[3], tmp2[3];     if (lineStyle == ::SOLIDLINE) {    // transform the world coordinates    (transMat.top()).multpoint3d(a, from);    (transMat.top()).multpoint3d(b, to);    // draw the solid line    fprintf(outfile, "// XXX lines not supported yet/n");    fprintf(outfile, "// v %5f %5f %5f/n", from[0], from[1], -from[2]);    fprintf(outfile, "// v %5f %5f %5f/n", to[0], to[1], -to[2]);    fprintf(outfile, "// l -1 -2/n");  } else if (lineStyle == ::DASHEDLINE) {     // transform the world coordinates    (transMat.top()).multpoint3d(a, tmp1);    (transMat.top()).multpoint3d(b, tmp2);    // how to create a dashed line    vec_sub(dirvec, tmp2, tmp1);  // vector from a to b    vec_copy(unitdirvec, dirvec);    vec_normalize(unitdirvec);    // unit vector from a to b    test = 1;    i = 0;    while (test == 1) {      for (j=0; j<3; j++) {        from[j] = (float) (tmp1[j] + (2*i    )*DASH_LENGTH*unitdirvec[j]);          to[j] = (float) (tmp1[j] + (2*i + 1)*DASH_LENGTH*unitdirvec[j]);      }      if (fabsf(tmp1[0] - to[0]) >= fabsf(dirvec[0])) {        vec_copy(to, tmp2);        test = 0;      }      // draw the solid line dash      fprintf(outfile, "// XXX lines not supported yet/n");      fprintf(outfile, "// v %5f %5f %5f/n", from[0], from[1], -from[2]);      fprintf(outfile, "// v %5f %5f %5f/n", to[0], to[1], -to[2]);      fprintf(outfile, "// l -1 -2/n");      i++;    }  } else {    msgErr << "MayaDisplayDevice: Unknown line style "           << lineStyle << sendmsg;  }}
开发者ID:Eigenstate,项目名称:vmd-python,代码行数:49,


示例8: vec_copy

void SMat<CoeffRing>::vec_column_op(sparsevec *&v, const elem &a, sparsevec *w) const    // v := v + a*w{  sparsevec *w1 = vec_copy(w);  vec_scale(w1, a);  vec_add_to(v, w1);}
开发者ID:ChristineJost,项目名称:M2,代码行数:7,


示例9: vec_copy

void CDanBattleSys::AutoMoveDanMember(){	int				userIdx;	int				zoneIdx;	typedef std::list<int>		TEAM_LIST;	typedef TEAM_LIST::iterator	TEAM_ITOR;	TEAM_ITOR	iLoop;	for (int TeamCount = 0; TeamCount < 2; TeamCount ++)	{			for (iLoop=m_BattleTeam[TeamCount].begin();iLoop!=m_BattleTeam[TeamCount].end();iLoop++)		{			userIdx=(*iLoop);									vec_copy( g_logic.danbattlePortal[DANBATTLE_ATEAM_PORTAL +TeamCount].TargetPos, g_pc[userIdx].position );			zoneIdx = GTH_Zone_UpdateCurrentZone(ENTITY_PC, g_pc[userIdx].idx, g_pc[userIdx].worldIdx, g_pc[userIdx].zoneIdx, g_pc[userIdx].position);			g_pc[userIdx].zoneIdx = zoneIdx;						GTH_SendPCEventMessage_Respawn( &g_pc[userIdx] );			GTH_SendMessage_SyncItemObject( &g_pc[userIdx] );												}	}}
开发者ID:gthgame,项目名称:gth,代码行数:26,


示例10: CopyGraph

GRAPH *CopyGraph(GRAPH *graph){    GRAPH *ret;    struct _keyed *k;    struct dveclist *link, *newlink;    ret = NewGraph();    bcopy(graph, ret, sizeof(GRAPH)); /* va: compatible pointer types */    ret->graphid = RunningId - 1;   /* restore id */    /* copy keyed */    for (ret->keyed = NULL, k = graph->keyed; k; k = k->next)        SaveText(ret, k->text, k->x, k->y);    /* copy dvecs */    ret->plotdata = NULL;    for (link = graph->plotdata; link; link = link->next) {        newlink = TMALLOC(struct dveclist, 1);        newlink->next = ret->plotdata;        newlink->vector = vec_copy(link->vector);        /* vec_copy doesn't set v_color or v_linestyle */        newlink->vector->v_color = link->vector->v_color;        newlink->vector->v_linestyle = link->vector->v_linestyle;        newlink->vector->v_flags |= VF_PERMANENT;        ret->plotdata = newlink;    }    ret->commandline = copy(graph->commandline);    ret->plotname = copy(graph->plotname);    return (ret);}
开发者ID:Anastien,项目名称:ngspice,代码行数:34,


示例11: add_particle

/* add_particle() inserts a particle at a given position to the end of the  * frame, along with associated targets. *  * Arguments: * frame *frm - the frame to store the particle. * vec3d pos - position of inserted particle in the global coordinates. * int cand_inds[][MAX_CANDS] - indices of candidate targets for association *    with this particle. */void add_particle(frame *frm, vec3d pos, int cand_inds[][MAX_CANDS]) {    int num_parts, cam, _ix;    P *ref_path_inf;    corres *ref_corres;    target **ref_targets;        num_parts = frm->num_parts;    ref_path_inf = &(frm->path_info[num_parts]);    vec_copy(ref_path_inf->x, pos);    reset_links(ref_path_inf);        ref_corres = &(frm->correspond[num_parts]);    ref_targets = frm->targets;    for (cam = 0; cam < frm->num_cams; cam++) {        ref_corres->p[cam] = CORRES_NONE;                /* We always take the 1st candidate, apparently. Why did we fetch 4? */        if(cand_inds[cam][0] != PT_UNUSED) {            _ix = cand_inds[cam][0];            ref_targets[cam][_ix].tnr = num_parts;            ref_corres->p[cam] = _ix;            ref_corres->nr = num_parts;        }    }    frm->num_parts++;}
开发者ID:yosefm,项目名称:openptv,代码行数:35,


示例12: fprintf

// draw a pointvoid X3DDisplayDevice::point(float * xyz) {  float txyz[3];  // transform the coordinates  (transMat.top()).multpoint3d(xyz, txyz);  // ugly and wasteful, but it will work  fprintf(outfile, "<Shape>/n");  fprintf(outfile, "  ");  // Emit the point material properties  fprintf(outfile, "<Appearance><Material ");  fprintf(outfile, "ambientIntensity='%g' ", mat_ambient);  fprintf(outfile, "diffuseColor='0 0 0' ");  const float *rgb = matData[colorIndex];  fprintf(outfile, "emissiveColor='%g %g %g' ",          mat_diffuse * rgb[0], mat_diffuse * rgb[1], mat_diffuse * rgb[2]);  fprintf(outfile, "/>");  fprintf(outfile, "</Appearance>/n");  fprintf(outfile, "  <PointSet>/n");  fprintf(outfile, "    <Coordinate point='%g %g %g'/>/n",          txyz[0], txyz[1], txyz[2]);    float col[3];  vec_copy(col, matData[colorIndex]);  fprintf(outfile, "    <Color color='%g %g %g'/>/n",           col[0], col[1], col[2]);  fprintf(outfile, "  </PointSet>/n");  fprintf(outfile, "</Shape>/n");}
开发者ID:quolc,项目名称:VMDLeap,代码行数:33,


示例13: hotcold_gradient_lerp

void hotcold_gradient_lerp(float pucker_sum, float *rgb) {  vec_zero(rgb); // set default color to black  // hot to cold color map  // Red (1, 0, 0) -> Yellow (1, 1, 0) -> Green (0, 1, 0) -> Cyan (0, 1, 1) -> blue (0, 0, 1)  float     red[3] = {1.0f, 0.0f, 0.0f};  float  yellow[3] = {1.0f, 1.0f, 0.0f};  float yellow2[3] = {0.8f, 1.0f, 0.0f};  float   green[3] = {0.0f, 1.0f, 0.0f};  float  green2[3] = {0.6f, 1.0f, 0.0f};  float    cyan[3] = {0.0f, 1.0f, 1.0f};  float   cyan2[3] = {0.0f, 1.0f, 0.8f};  float    blue[3] = {0.0f, 0.0f, 1.0f};  if (pucker_sum < 0.25f) {    lerp_color_range(rgb, pucker_sum, 0.00f, 0.25f, red, yellow);  } else if (pucker_sum < 0.45f) {    vec_copy(rgb, yellow);  } else if (pucker_sum < 0.55f) {    lerp_color_range(rgb, pucker_sum, 0.45f, 0.55f, yellow, green2);  } else if (pucker_sum < 0.75f) {    lerp_color_range(rgb, pucker_sum, 0.55f, 0.75f, green, cyan2);  } else {    lerp_color_range(rgb, pucker_sum, 0.75f, 1.00f, cyan, blue);  }  clamp_color(rgb); // clamp color values to legal range}
开发者ID:VictorMion,项目名称:vmd-cvs-github,代码行数:28,


示例14: ribbon_spline

// Calculates the position at point t along the spline with co-efficients// A, B, C and D.// spline(t) = ((A * t + B) * t + C) * t + Dvoid ribbon_spline(float *pos, const float * const A, const float * const B,                   const float * const C, const float * const D, const float t) {  vec_copy(pos,D);  vec_scaled_add(pos,t,C);  vec_scaled_add(pos,t*t,B);  vec_scaled_add(pos,t*t*t,A);}
开发者ID:VictorMion,项目名称:vmd-cvs-github,代码行数:10,


示例15: transpose

VrArrayPtrCF32 BlasComplexSingle::transpose(VrArrayPtrCF32 A) {	 VrArrayPtrCF32 B;	 int dims[2];	 if(VR_GET_DIMS_CF32(A)[0]==1 || VR_GET_DIMS_CF32(A)[1]==1) {	 	      B=vec_copy(VR_GET_NDIMS_CF32(A),A);	      dim_type temp= VR_GET_DIMS_CF32(B)[0];	      VR_GET_DIMS_CF32(B)[0] =VR_GET_DIMS_CF32(B)[1];	      VR_GET_DIMS_CF32(B)[1] = temp;	      return B;	 }	 dims[1]=VR_GET_DIMS_CF32(A)[0];	 dims[0]=VR_GET_DIMS_CF32(A)[1];	 B= vrAllocArrayF32CM(2,0,dims);	 int row= VR_GET_DIMS_CF32(A)[0];	 int col= VR_GET_DIMS_CF32(A)[1];	 float complex *out =VR_GET_DATA_CF32(B);	 float complex *in =VR_GET_DATA_CF32(A);	 for(int i=0;i<row;i++){	   for(int j=0;j<col;j++) {	   	     out[i*col+j] = conj(in[j*row +i]);	  }	  	 }	return B;}
开发者ID:Sable,项目名称:VeloCty,代码行数:27,


示例16: folge_copy

folge_pfolge_copy( folge_p f) {	folge_p  back;	int  k, size;	vec_p  start, lang;	start = vec_copy( f->start );	lang = vec_copy( f->lang );	size = vec_size( lang );	back = folge_new( start, lang );	for(k=0;k<size;k++) {		back->glied[k] = f->glied[k];	}	return back;}
开发者ID:FEPC-Expert,项目名称:FEPC,代码行数:16,


示例17: strcpy

void CHelperManager_Encoder::PC_SetSummonsInfo(	playerCharacter_t *pHelper, char *name, int worldIdx, vec3_t position){	strcpy(pHelper->summonsInfo.summoner, name);	pHelper->summonsInfo.worldIdx = worldIdx;	vec_copy(position, pHelper->summonsInfo.position);	}
开发者ID:gthgame,项目名称:gth,代码行数:8,


示例18: gr_start_internal

static voidgr_start_internal(struct dvec *dv, bool copyvec){    struct dveclist *link;    /* Do something special with poles and zeros.  Poles are 'x's, and     * zeros are 'o's.  */    if (dv->v_type == SV_POLE) {        dv->v_linestyle = 'x';        return;    } else if (dv->v_type == SV_ZERO) {        dv->v_linestyle = 'o';        return;    }    /* Find a (hopefully) new line style and color. */    if (currentgraph->plottype == PLOT_POINT) {        if (pointchars[cur.linestyle - 1])            cur.linestyle++;        else            cur.linestyle = 2;    } else if ((cur.linestyle > 0) && (++cur.linestyle == dispdev->numlinestyles)) {        cur.linestyle = 2;    }    if ((cur.color > 0) && (++cur.color == dispdev->numcolors))        cur.color = (((currentgraph->grid.gridtype == GRID_SMITH ||                      currentgraph->grid.gridtype == GRID_SMITHGRID) &&                     (dispdev->numcolors > 3)) ? 4 : 2);    if (currentgraph->plottype == PLOT_POINT)        dv->v_linestyle = pointchars[cur.linestyle - 2];    else        dv->v_linestyle = cur.linestyle;    dv->v_color = cur.color;    /* save the data so we can refresh */    link = TMALLOC(struct dveclist, 1);    link->next = currentgraph->plotdata;    if (copyvec) {        link->vector = vec_copy(dv);        /* vec_copy doesn't set v_color or v_linestyle */        link->vector->v_color = dv->v_color;        link->vector->v_linestyle = dv->v_linestyle;        link->vector->v_flags |= VF_PERMANENT;    } else {        link->vector = dv;    }    currentgraph->plotdata = link;    /* Put the legend entry on the screen. */    drawlegend(currentgraph, cur.plotno, dv);    cur.plotno++;}
开发者ID:ambikeshwar1991,项目名称:ngspice-1,代码行数:58,


示例19: START_TEST

END_TESTSTART_TEST(test_vec_copy){    vec3d src = {1., 2., 3.}, dst;    vec_copy(dst, src);    fail_unless(vec_cmp(dst, src));}
开发者ID:OpenPTV,项目名称:openptv,代码行数:9,


示例20: vec_copy

VrArrayPtrCF64 BlasComplexDouble::mat_ldiv(int matrix_order ,VrArrayPtrCF64 A, VrArrayPtrCF64 B) {    VrArrayPtrCF64 C = vec_copy(VR_GET_NDIMS_CF64(B),B);   VrArrayPtrCF64 D = vec_copy(VR_GET_NDIMS_CF64(A),A);   double complex* data= VR_GET_DATA_CF64(D);   double complex * out_data=VR_GET_DATA_CF64(C);   long int lda=(long int)VR_GET_DIMS_CF64(D)[0];   long int ldb= (long int)VR_GET_DIMS_CF64(C)[0];   long int n=(long int )VR_GET_DIMS_CF64(D)[1];   long int nrhs= (long int )VR_GET_DIMS_CF64(C)[1];  int  *IPIV=(int*)VR_MALLOC(sizeof(int)*n);  long int info=0;   // dgesv_(&n,&nrhs,data,&lda,IPIV,out_data,&ldb,&info);    info= LAPACKE_zgesv(LAPACK_COL_MAJOR,n,nrhs,data,lda,IPIV,out_data,ldb);   return C; }
开发者ID:Sable,项目名称:VeloCty,代码行数:19,


示例21: folgen_vektor_projekt

folgen_vektor_pfolgen_vektor_projekt(folgen_vektor_p f,folgen_vektor_p g) {	folgen_vektor_p  back;	int  k, size_g, test, dim, d, i;	vec_p  grad, r, n_f, n_g, start, lang, vec_1;	ASSERT( f->grad->dim == g->grad->dim );	dim = f->grad->dim;	vec_1 = vec_one( dim );	n_g = vec_add( g->grad, vec_1 );	n_f = vec_add( f->grad, vec_1 );	size_g = vec_size( n_g );	grad = vec_copy( g->grad );	back = folgen_vektor_new( grad );	for(k=0;k<size_g;k++) {		r = entry_one2d( k, n_g );		test = 0;		for(d=0;d<dim;d++) {			if( r->array[d] > f->grad->array[d] ) {				test = test + 1;			}		}		if(test == 0) {			i = entry_d2one( r, n_f );			folge_del( back->vektor[k] );			back->vektor[k] = folge_projekt( f->vektor[i], g->vektor[k] );		}		else {			folge_del( back->vektor[k] );			start = vec_copy( g->vektor[k]->start );			lang = vec_copy( g->vektor[k]->lang );			back->vektor[k] = folge_new( start, lang );		}		vec_del( r );	}	vec_del( vec_1 );	vec_del( n_g );	vec_del( n_f );	return back;}
开发者ID:FEPC-Expert,项目名称:FEPC,代码行数:43,


示例22: exit

VrArrayPtrCF32 BlasComplexSingle::elem_mult(VrArrayPtrCF32 A, VrArrayPtrCF32 B) {  if ( !checkdims<VrArrayCF32>(A,B) ) {    std::cout<<"dimensions do not match. /n Exiting. "<<std::endl;    exit(0);  }  VrArrayPtrCF32 C = vec_copy(VR_GET_NDIMS_CF32(A),A);  for (int i = 0; i < getNumElem(VR_GET_DIMS_CF32(A),VR_GET_NDIMS_CF32(A)); i++) {    VR_GET_DATA_CF32(C)[i] *= VR_GET_DATA_CF32(B)[i];  }  return C;}
开发者ID:Sable,项目名称:VeloCty,代码行数:11,


示例23: scal_mult

VrArrayPtrCF32 BlasComplexSingle::scal_mult(int ndims,VrArrayPtrCF32 X,float complex alpha) {        int N=1;        for(int i=0;i<ndims;i++){                N*=VR_GET_DIMS_CF32(X)[i];        }	VrArrayPtrCF32 Y;//=(VrArrayPtrCF32)mxMalloc(sizeof(VrArrayPtrCF32));	Y=vec_copy(ndims,X);	//mxDuplicateArray(X);        cblas_cscal(N,reinterpret_cast<float*>(&alpha),(float*)VR_GET_DATA_CF32(Y),1);	return Y;}
开发者ID:Sable,项目名称:VeloCty,代码行数:11,


示例24: scal_mult

VrArrayPtrCF64 BlasComplexDouble::scal_mult(int ndims,VrArrayPtrCF64 X,double complex alpha){        int N=1;        for(int i=0;i<ndims;i++){                N*=VR_GET_DIMS_CF64(X)[i];        }	//mexPrintf("%d",N);	double alph[] = {1,0};	VrArrayPtrCF64 Y=vec_copy(ndims,X);    cblas_zscal(N,(alph),(double*)VR_GET_DATA_CF64(Y),1);	return Y;}
开发者ID:Sable,项目名称:VeloCty,代码行数:11,


示例25: vec_sub

VrArrayPtrCF32 BlasComplexSingle::vec_sub(int ndims, VrArrayPtrCF32 X, VrArrayPtrCF32 Y , const float complex alpha, const int incX, const int incY) {        VrArrayPtrCF32 X1 =vec_copy(VR_GET_NDIMS_CF32(X),X);        /*if(cimag(alpha)!=1){                VrArrayPtrCF32 X1=vrAllocArrayF32CM(ndims,0,(int*)VR_GET_DIMS_CF32(X));                X1=BlasComplexSingle::scal_mult(ndims,X,alpha);        }*/	//float arr[]={-1,0};  	float complex arr = -1 ;         return vec_add(ndims, Y,X1, arr);}
开发者ID:Sable,项目名称:VeloCty,代码行数:11,


示例26: vec_copy

VrArrayPtrCF32 BlasComplexSingle::mat_ldiv(int matrix_order, VrArrayPtrCF32 A, VrArrayPtrCF32 B) {VrArrayPtrCF32 C = vec_copy(VR_GET_NDIMS_CF32(B),B);   VrArrayPtrCF32 D = vec_copy(VR_GET_NDIMS_CF32(A),A);   float complex * data= VR_GET_DATA_CF32(D);   float complex * out_data=VR_GET_DATA_CF32(C);   long int lda=(long int)VR_GET_DIMS_CF32(D)[0];   long int ldb= (long int)VR_GET_DIMS_CF32(C)[0];   long int n=(long int )VR_GET_DIMS_CF32(D)[1];   long int nrhs= (long int )VR_GET_DIMS_CF32(C)[1];  int  *IPIV=(int*)VR_MALLOC(sizeof(int)*n);  long int info=0;      info= LAPACKE_cgesv(LAPACK_COL_MAJOR,n,nrhs,data,lda,IPIV,out_data,ldb);           return C;  }
开发者ID:Sable,项目名称:VeloCty,代码行数:20,


示例27: set_destination

void set_destination(double *v){	int i;	double dif[MAX_DIM];	vec_copy(origin, position);	vec_copy(destination, v);	tim = 0.0;	delta_t = feedrate_begin;	dist = vec_dist(position, v);	if(dist == 0.0) {		vec_clear(incvec);		for(i = 0; i < MAX_DIM; i++)			amp[i] = amplitude_dc;		return;	}	vec_diff(dif, v, origin);	for(i = 0; i < MAX_DIM; i++)		incvec[i] = dif[i] / dist;	calc_amplitude();}
开发者ID:yope,项目名称:kamaq,代码行数:20,



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


C++ vec_extract函数代码示例
C++ vec_add函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。