这篇教程C++ FR函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FR函数的典型用法代码示例。如果您正苦于以下问题:C++ FR函数的具体用法?C++ FR怎么用?C++ FR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FR函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: func_args_rm_add_pow1func_t *func_expand_mul1_add1(func_t *f){ int i,j,k; func_t *h=NULL,*g=NULL; if(func_is_mul(f) && func_power(f)==1 && func_a_has_op_pow1(f,func_is_add)){ // get terms without (add)^1 g=func_clone(FR(f)); func_args_rm_add_pow1(g); func_a_rm_null(g); g=func_mul_eval(g); // loop for(i=0; i<func_asize(f); i++){ if(func_is_add(f->a[i]) && func_power(f->a[i])==1){ if(func_is_add(g) && func_power(g)==1){ h=func_zero(); for(k=0; k<func_asize(g); k++){ for(j=0; j<func_asize(f->a[i]); j++){ h=func_add(h,func_expand(func_mul(FR(g->a[k]),FR(f->a[i]->a[j])))); } } }else{ h=func_zero(); for(j=0; j<func_asize(f->a[i]); j++){ h=func_add(h,func_expand(func_mul(FR(g),FR(f->a[i]->a[j])))); } } g=func_del(g); g=h; h=NULL; } } }else{ FUNC_ERROR_ARG1("func_expand_mul1_add1",f); } f=func_del(f); return g;}
开发者ID:wenxuegege,项目名称:libis,代码行数:33,
示例2: func_t *func_diff_tanh_pow1(func_t *f, int var){ func_t *fx=NULL,*g=NULL,*gx=NULL; if(!func_is(f,"tanh") || func_power(f)!=1){ FUNC_ERROR_ARG1("func_diff_tanh",f); } g=f->a[0]; gx=func_diff(FR(g),func_var1(var,1)); fx=func_mul(func_pow_n(func_cosh(FR(g)),-2),gx); f=func_del(f); return fx;}
开发者ID:wenxuegege,项目名称:libis,代码行数:10,
示例3: //h={q,r}func_t *func_poly_div_r_and_q(func_t *f, func_t *g){ func_t *h=NULL; h=func_list(2); h->a[0]=func_poly_div_q(FR(f),FR(g)); h->a[1]=func_poly_div_r(FR(f),FR(g)); f=func_del(f); g=func_del(g); return h;}
开发者ID:wenxuegege,项目名称:libis,代码行数:11,
示例4: func_add_args_collectvoid func_add_args_collect(func_t *f, func_is_t *fis){ int i,j; func_t *g=NULL; if(!func_is_add(f)){ FUNC_ERROR_ARG1("func_add_args_collect",f); } // convert args to split list for(i=0; i<func_asize(f); i++){ g=func_mul_split_list(FR(func_aget(f,i)),fis); func_aset(f,i,FR(g)); g=func_del(g); } // add a arg to same arg for(i=0; i<func_asize(f); i++){ for(j=i+1; func_aget(f,i)!=NULL && !func_is_one(func_aget(func_aget(f,i),1)) && j<func_asize(f); j++){ if(func_aget(f,j)!=NULL && func_cmp(func_aget(func_aget(f,i),1),func_aget(func_aget(f,j),1))==0){ g=func_list(2); func_aset(g,0,func_add(FR(func_aget(func_aget(f,i),0)),FR(func_aget(func_aget(f,j),0)))); func_aset(g,1,FR(func_aget(func_aget(f,i),1))); func_aset(f,i,FR(g)); func_adel(f,j); g=func_del(g); } } } // convert list to mul for(i=0; i<func_asize(f); i++){ if(func_aget(f,i)!=NULL){ g=func_mul(FR(func_aget(func_aget(f,i),0)),FR(func_aget(func_aget(f,i),1))); func_aset(f,i,FR(g)); g=func_del(g); } } func_a_rm_null(f);}
开发者ID:wenxuegege,项目名称:libis,代码行数:34,
示例5: func_clonefunc_t *func_poly_clone_coeff_ntarm(func_t *f,int n){ func_t *a; if(!func_is_poly(f)){ return NULL; } a=func_poly_get_mono_ntarm(f,n); if(a==NULL){ return func_zero(); } if(func_is_number(a)){ return func_clone(FR(a)); } a=func_mono_get_coeff(a); if(a==NULL){ return func_one(); } return func_clone(FR(a));}
开发者ID:wenxuegege,项目名称:libis,代码行数:11,
示例6: func_a_insertvoid func_a_insert(func_t *f, int n, func_t *g){ int i,k; func_t **a; if(f==NULL){ FUNC_ERROR_ARG1("func_a_insert",f); } a=(func_t**)malloc(sizeof(func_t*)*(func_asize(f)+1)); for(k=0,i=0; k<func_asize(f)+1; ){ if(i==n){ a[k++]=g; a[k++]=FR(f->a[i++]); } else { a[k++]=FR(f->a[i++]); } } func_a_replace(f,func_asize(f)+1,a);}
开发者ID:wenxuegege,项目名称:libis,代码行数:12,
示例7: func_asetfunc_t *func_poly_list_monic(func_t *f){ int i; func_t *g=NULL; if(!(func_is_poly_list(f))){ FUNC_ERROR_ARG1("func_poly_list_monic",f); } g=func_clone(FR(f)); for(i=0; i<func_asize(g); i++){ func_aset(g,i,func_poly_monic(FR(g->a[i]))); } f=func_del(f); return g;}
开发者ID:wenxuegege,项目名称:libis,代码行数:12,
示例8: func_add_argsvoid func_add_args(func_t *f, func_is_t *fis, func_is_t *fin){ int i,j; if(!func_is_add(f)){ FUNC_ERROR_ARG1("func_add_args",f); } for(i=0; i<func_asize(f); i++){ for(j=0; fis(func_aget(f,i)) && j<func_asize(f); j++){ if(i!=j && fin(func_aget(f,j))){ func_aset(f,i,func_add(FR(func_aget(f,i)),FR(func_aget(f,j)))); func_adel(f,j); } } } func_a_rm_null(f);}
开发者ID:wenxuegege,项目名称:libis,代码行数:14,
示例9: FollowerEnemy::Enemy(LPCWSTR _meshName, LPCWSTR _textureName, LPCWSTR _normalTexName, char* _attackSound, char* _deathSound, char* _getHitSound, D3DXVECTOR3 _startPosition, float _healthMax, float _radius, D3DXVECTOR3 _meshScale) : Follower(_meshName, _textureName, _normalTexName, _startPosition, _healthMax, _radius, _meshScale), mLoseSightPlayer(10.0f), mLoseSightFollower(10.0f){ mState = PSTATE_WANDER; // TODO BUG: As far as I know, this is causing a memory every time an enemy is created FR(gSound->getSystem()->createSound(_attackSound, FMOD_DEFAULT, 0, &enemyAttack)); FR(gSound->getSystem()->createSound(_deathSound, FMOD_DEFAULT, 0, &enemyDeath)); FR(gSound->getSystem()->createSound(_getHitSound, FMOD_DEFAULT, 0, &enemyGetHit)); // TODO: this needs to be moved to a point where the enemy begins to move or is still bIsMoving = true;}
开发者ID:brentspector,项目名称:Dart,代码行数:14,
示例10: func_set_powerfunc_t *func_diff_pow_n(func_t *f, int var){ func_t *fx=NULL,*g=NULL; if(!func_has_power(f) || func_power(f)==1){ FUNC_ERROR_ARG1("func_diff_pow_n",f); } g=func_clone(FR(f)); func_set_power(g,1); g=func_diff(g,func_var1(var,1)); fx=func_clone(FR(f)); func_set_power(fx,func_power(fx)-1); fx=func_mul(func_bigint_int(func_power(f),1),fx); fx=func_mul(fx,g); f=func_del(f); return fx;}
开发者ID:wenxuegege,项目名称:libis,代码行数:14,
示例11: lapackglue_geevvoid lapackglue_geev(char jobvl, char jobvr, int n, scalar *A, int fdA, scalar_complex *w, scalar *VL, int fdVL, scalar *VR, int fdVR, scalar *work, int lwork, real *rwork){ int info;#ifdef SCALAR_COMPLEX F(geev,GEEV) (&jobvl, &jobvr, &n, A, &fdA, w, VL, &fdVL, VR, &fdVR, work, &lwork, rwork, &info);#else int i; real *wr, *wi; CHK_MALLOC(wr, real, 2*n); wi = wr + n; (void) rwork; /* unused */ FR(geev,GEEV) (&jobvl, &jobvr, &n, A, &fdA, wr, wi, VL, &fdVL, VR, &fdVR, work, &lwork, &info); for (i = 0; i < n; ++i) CASSIGN_SCALAR(w[i], wr[i], wi[i]); free(wr);#endif CHECK(info >= 0, "invalid argument in geev"); CHECK(info <= 0, "failure to converge in geev");}
开发者ID:HomerReid,项目名称:mpb,代码行数:25,
示例12: PawnPlayer::Player(LPCWSTR _meshName, LPCWSTR _textureName, LPCWSTR _normalTexName, D3DXVECTOR3 _startPosition, float _healthMax, float _radius, D3DXVECTOR3 _meshScale) : Pawn(_meshName, _textureName, _normalTexName, _startPosition, _healthMax, _radius, _meshScale), //starting with full ammo here, but that won't be the case in the actual game mAmmoSeeds(0), mAmmoSeedsMax(100), mAmmoFire(0), mAmmoFireMax(100), mScore(0), mLeftAttack(A_MELEE), mRightAttack(A_SEED){ mSpeed = 400.0f; mAttackDelay = 0.9f; FR(gSound->getSystem()->createSound("Content/Audio/sndPlayerAttackFire.wav", FMOD_DEFAULT, 0, &playerAttackFire)); FR(gSound->getSystem()->createSound("Content/Audio/sndPlayerAttackMelee.wav", FMOD_DEFAULT, 0, &playerAttackMelee)); FR(gSound->getSystem()->createSound("Content/Audio/sndPlayerAttackSeed.wav", FMOD_DEFAULT, 0, &playerAttackSeed)); FR(gSound->getSystem()->createSound("Content/Audio/sndPlayerDeath.wav", FMOD_DEFAULT, 0, &playerDeath)); //(for later use)}
开发者ID:brentspector,项目名称:Dart,代码行数:16,
示例13: GEMENI_charsentvoid GEMENI_charsent() { unsigned long r = s->log[s->lc]; if (UCA0IFG & UCTXIFG) { s->nch++; switch (s->nch) { case 1: UCA0TXBUF = SL(r) << 5 |TL(r)<<4|KL(r)<<3|PL(r)<<2|WL(r)<<1|HL(r); break; case 2: UCA0TXBUF = RL(r)<<6 | AL(r)<<5 | OL(r)<<4 | STAR(r)<<3; break; case 3: UCA0TXBUF = ER(r)<<3 | UR(r)<<2 | FR(r)<<1 | RR(r); break; case 4: UCA0TXBUF = PR(r)<<6 | BR(r)<<5 | LR(r)<<4 | GR(r)<<3 | TR(r)<<2 | SR(r)<<1 | DRS(r); break; case 5: UCA0TXBUF = POUND(r)<<1 | ZRS(r); break; default: s->lc++; if (s->lc != s->nc-1) { s->nch = 0; UCA0TXBUF = 1 << 7; // first packet, no fn or '#' } else { s->flags &= ~CSEND; } } }}
开发者ID:lostnet,项目名称:6teno,代码行数:33,
示例14: func_expandfunc_t *func_poly_monic(func_t *f){ func_t *a=NULL; if(!(func_is_poly(f))){ FUNC_ERROR_ARG1("func_poly_monic",f); } a=func_poly_get_lc(f); if(a==NULL || func_is_one(a)){ return f; } return func_expand(func_mul(func_inv(FR(a)),f));}
开发者ID:wenxuegege,项目名称:libis,代码行数:8,
示例15: func_initfunc_t *func_set_eval(func_t *f){ func_init(); if(f==NULL || !func_is(f,"set") || func_asize(f)!=1){ FUNC_ERROR_ARG1("func_set_eval",f); } func_scope_set(0,FR(func_aget(f,0))); f=func_del(f); return f;}
开发者ID:wenxuegege,项目名称:libis,代码行数:8,
示例16: iffunc_t *func_poly_lm_lcm(func_t *f, func_t *g){ func_t *lcm=NULL,*f_lm=NULL,*g_lm=NULL; if(func_is_poly(f) && func_is_poly(g)){ f_lm=func_poly_get_lm(f); g_lm=func_poly_get_lm(g); if (f_lm!=NULL && g_lm!=NULL) { lcm=func_var_lcm(FR(f_lm),FR(g_lm)); } else if(f_lm==NULL && g_lm!=NULL) { lcm=FR(g_lm); } else if(f_lm!=NULL && g_lm==NULL) { lcm=FR(f_lm); } else { lcm=func_one(); } } f_lm=NULL; g_lm=NULL; f=func_del(f); g=func_del(g); return lcm;}
开发者ID:wenxuegege,项目名称:libis,代码行数:17,
示例17: func_t *func_def_any_eval(func_t *f){ int i; func_t *g=NULL,*x=NULL; g=func_scope_find(0,func_op(f)); if(func_is_def(g) && func_aget(g,0)!=NULL){ g=FR(func_aget(g,0)); if(func_asize(f)>0){ x=func_list(func_asize(f)); for(i=0; i<func_asize(f); i++){ func_aset(x,i,FR(func_aget(f,i))); } g=func_maps(g,0,FR(x)); } f=func_del(f); }else{ g=f; } x=func_del(x); return g;}
开发者ID:wenxuegege,项目名称:libis,代码行数:17,
示例18: FRvoid Instruction::output_arglist(ofstream &fout){ fout<<arglist.size()<<endl; FR(i,arglist) fout<<i->first<<' '<<i->second<<endl; // for(int i=0;i<arglist.size();++i) // fout<<arglist[i].first<<' '<<arglist[i].second<<endl;}
开发者ID:lonway,项目名称:autotool,代码行数:8,
示例19: func_args_arrangevoid func_args_arrange(func_t *f, int *I){ int i,n; func_t **arg=NULL; n=func_asize(f); arg=(func_t**)malloc(sizeof(func_t*)*n); for(i=0; i<n; i++){ arg[i]=FR(f->a[I[i]]); } func_a_replace(f,n,arg);}
开发者ID:wenxuegege,项目名称:libis,代码行数:9,
示例20: func_cvec_setvoid func_cvec_set(func_t *f, int i, func_t *g){ func_t *a=NULL; if(f==NULL || func_ptype(f)!=FUNC_P_CVEC || f->p.rvec==NULL || i<0 || i>=f->p.rvec->n){ FUNC_ERROR_ARG2("func_cvec_set",f,g); } a=func_evalf(FR(g)); if(func_is_real(a)) { ccopy_r(func_cvec_at(f,i),func_real_p(a)); } else if(func_is_complex(a)){ ccopy (func_cvec_at(f,i),func_complex_p(a)); } else { FUNC_ERROR_ARG2("func_cvec_set",f,g); } a=func_del(a);}
开发者ID:wenxuegege,项目名称:libis,代码行数:10,
示例21: func_set_powerfunc_t *func_expand_add_pow_n(func_t *f){ int i,j,k; func_t *g=NULL,*h=NULL; if(func_is_add(f) && func_power(f)>=2){ g=func_clone(FR(f)); func_set_power(g,1); for(k=1; k<func_power(f); k++){ h=func_zero(); for(i=0; i<func_asize(g); i++){ for(j=0; j<func_asize(f); j++){ h=func_add(h,func_expand(func_mul(FR(g->a[i]),FR(f->a[j])))); } } g=func_del(g); g=h; h=NULL; } }else{ FUNC_ERROR_ARG1("func_expand_add_pow_n",f); } f=func_del(f); return g;}
开发者ID:wenxuegege,项目名称:libis,代码行数:19,
示例22: while// r=mod(f,g), where f=g*q+rfunc_t *func_poly_div_r(func_t *f, func_t *g){ func_t *r=NULL,*neg=NULL,*a; if(func_is_poly(f) && func_is_poly(g)){ neg=func_bigint_int(-1,1); r=FR(f); // r=f while(func_is_poly(r) && func_poly_can_div(r,g)) { a=func_div(FR(func_poly_get_lt(r)), FR(func_poly_get_lt(g))); // a=LT(r)/LT(g) a=func_mul(FR(neg),a); // a=(-1)*LT(r)/LT(g) a=func_expand(func_mul(a,FR(g))); // a=((-1)*LT(r)/LT(g))*g r=func_add(r,a); // r-=(LT(r)/LT(g))*g } } f=func_del(f); g=func_del(g); neg=func_del(neg); return r;}
开发者ID:wenxuegege,项目名称:libis,代码行数:20,
注:本文中的FR函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ FRACTION函数代码示例 C++ FPoint函数代码示例 |