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

C++ RR函数代码示例

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

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



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

示例1: type

/*
  Cria e envia uma trama do tipo type (Não funcional para tipo I)
*/
int buildFrame(int flag, char * type) {
    info->frameSend[0] = F;
    if (type == "set")
        info->frameSend[2] = C_SET;
    else if (type == "ua")
        info->frameSend[2] = C_UA;
    else if (type == "disc")
        info->frameSend[2] = C_DISC;
    else if (!strcmp(type, "rr1"))
        info->frameSend[2] = RR(1);
    else if (!strcmp(type,"rr0"))
        info->frameSend[2] = RR(0);
    else if (!strcmp(type,"rej0"))
        info->frameSend[2] = REJ(0);
    else if (!strcmp(type,"rej1"))
        info->frameSend[2] = REJ(0);
    else
        return 0;
    info->frameSend[1] = campo_endereco(info->flag, info->frameSend[2]);
    info->frameSend[3] = info->frameSend[1]^info->frameSend[2];
    info->frameSend[4] = F;
    info->frameSendLength = 5;

    //printf("Trama composta %s: 0x%x 0x%x 0x%x 0x%x 0x%x \n", type, info->frameSend[0], info->frameSend[1], info->frameSend[2], info->frameSend[3], info->frameSend[4]);

    return 1;
}
开发者ID:joaoDavidGB,项目名称:RCOM,代码行数:30,代码来源:link_layer.c


示例2: pg_wait

static int pg_wait( int unit, int go, int stop, int tmo, char * msg )

{       int j, r, e, s, p;

	PG.status = 0;

	j = 0;
	while ((((r=RR(1,6))&go)||(stop&&(!(r&stop))))&&(time_before(jiffies,tmo))) {
		if (j++ < PG_SPIN) udelay(PG_SPIN_DEL);
		else pg_sleep(1);
	}

	if ((r&(STAT_ERR&stop))||time_after_eq(jiffies, tmo)) {
	   s = RR(0,7);
	   e = RR(0,1);
	   p = RR(0,2);
	   if (verbose > 1)
	     printk("%s: %s: stat=0x%x err=0x%x phase=%d%s\n",
		   PG.name,msg,s,e,p,time_after_eq(jiffies, tmo)?" timeout":"");


	   if (time_after_eq(jiffies, tmo)) e |= 0x100;
	   PG.status = (e >> 4) & 0xff;
	   return -1;
	}
开发者ID:chinnyannieb,项目名称:empeg-hijack,代码行数:25,代码来源:pg.c


示例3: main

int main(void) {
    Job in[N];
    Job jobs[N];
    int cnt = 0;
    while (scanf("%s%d%d", in[cnt].name, &in[cnt].arrive_time, &in[cnt].serve_time) == 3) cnt++;

    copy(jobs, in, cnt);
    printf("FCFS\n");
    FCFS(jobs, cnt);
    display(jobs, cnt);

    copy(jobs, in, cnt);
    printf("RR-1\n");
    RR(jobs, cnt, 1);
    display(jobs, cnt);

    copy(jobs, in, cnt);
    printf("RR-4\n");
    RR(jobs, cnt, 4);
    display(jobs, cnt);

    copy(jobs, in, cnt);
    printf("SJF\n");
    SJF(jobs, cnt);
    display(jobs, cnt);

    copy(jobs, in, cnt);
    printf("HRN\n");
    HRN(jobs, cnt);
    display(jobs, cnt);

    return 0;
}
开发者ID:zhaoyu1995,项目名称:ClassicGameForPratice,代码行数:33,代码来源:processor.c


示例4: tmpl

tmpl(uint32_t)::get_absolute_dest_reg(ins_t ins) const
{
    switch(ins.call.op) {
    case 0 : {
        // Format2 instruction : sethi, branch, branch_fp, branch_cp, unimp or garbage...
        if (ins.branches.op2 == 4)
            // SETHI
            return RR(ins.sethi.rd);
        else
            return 0;
        break;
    }

    case 1 :
        // This is a format1 instruction : CALL
        return 0;
        break;

    case 2 : 
    case 3 :
        // This is one of the logical instructions (format3)
        return RR(ins.format3.rd);
        break;
    }
    return 0;
}
开发者ID:walafc0,项目名称:soclib,代码行数:26,代码来源:sparcv8_run.cpp


示例5: dss_restore_context

static void dss_restore_context(void)
{
	RR(SYSCONFIG);
	RR(CONTROL);
	RR(SDI_CONTROL);
	RR(PLL_CONTROL);
}
开发者ID:embest-tech,项目名称:rowboat-kernel,代码行数:7,代码来源:dss.c


示例6: ClearRenderRows

/**
 * Function ReFillRender
 * Rebuild Render for instance after the config is read
 */
void GERBER_LAYER_WIDGET::ReFillRender()
{
    ClearRenderRows();

    // Fixed "Rendering" tab rows within the LAYER_WIDGET, only the initial color
    // is changed before appending to the LAYER_WIDGET.  This is an automatic variable
    // not a static variable, change the color & state after copying from code to renderRows
    // on the stack.
    LAYER_WIDGET::ROW renderRows[3] = {

#define RR  LAYER_WIDGET::ROW   // Render Row abreviation to reduce source width

             // text                id                      color       tooltip                 checked
        RR( _( "Grid" ),            GERBER_GRID_VISIBLE,    WHITE,      _( "Show the (x,y) grid dots" ) ),
        RR( _( "DCodes" ),          DCODES_VISIBLE,         WHITE,      _( "Show DCodes identification" ) ),
        RR( _( "Neg. Obj." ),       NEGATIVE_OBJECTS_VISIBLE,  DARKGRAY,
                                    _( "Show negative objects in this color" ) ),
    };

    for( unsigned row=0;  row<DIM(renderRows);  ++row )
    {
        if( renderRows[row].color != -1 )       // does this row show a color?
        {
            renderRows[row].color = myframe->GetVisibleElementColor(
                                    (GERBER_VISIBLE_ID)renderRows[row].id );
        }
        renderRows[row].state = myframe->IsElementVisible(
                                (GERBER_VISIBLE_ID)renderRows[row].id );
    }

    AppendRenderRows( renderRows, DIM(renderRows) );
}
开发者ID:ephtable,项目名称:kicad-source-mirror,代码行数:36,代码来源:class_gerbview_layer_widget.cpp


示例7: verifyFrameType

/*
  retorna o tipo de frame verificando o campo de controlo
*/
char * verifyFrameType(char * frame) {
    switch(frame[2]) {
    case C_SET:
        return "set";
        break;
    case C_DISC:
        return "disc";
        break;
    case C_UA:
        return "ua";
        break;
    case RR(1):
        return "rr1";
        break;
    case RR(0):
        return "rr0";
        break;
    case REJ(0):
        return "rej0";
        break;
    case REJ(1):
        return "rej1";
        break;
    case C_I0:
        return "I0";
        break;
    case C_I1:
        return "I1";
        break;
    }
}
开发者ID:joaoDavidGB,项目名称:RCOM,代码行数:34,代码来源:link_layer.c


示例8: orderstats

RR orderstats(const vector<double>& binomCoeff, vector<double>& sigs){
	int numLayers = sigs.size();
	//First we sort them
	double tmp;
	bool changed = true;
	while(changed){
		changed = false;
		for(int i=0; i<numLayers-1; i++){
			if(sigs[i]<sigs[i+1]){
				tmp = sigs[i];
				sigs[i]  = sigs[i+1];
				sigs[i+1] = tmp;
				changed = true;
			}
		}
	}


	vector<RR> ordersigs;
	RR sqr2(2);
	sqr2 = sqrt(sqr2);

	ordersigs.resize(numLayers);
	try{
		for(int i=0; i<numLayers; i++){
			ordersigs[i] = sigs[i];
			ordersigs[i] = RR(0.5) * erfc(ordersigs[i] / sqr2);	//We find the cumulative distribution of each
		}
	}catch(const std::exception& e)
	{
		std::cout << "\n""Message from thrown exception was:\n   " << e.what() << std::endl;
	}
	
	for(int i=0; i<numLayers; i++){
		RR sum(0.0);
		for(int j= i+1; j<=numLayers; j++){
			sum += RR(binomCoeff[j]) * pow(ordersigs[i], j) * pow(1.0-ordersigs[i],numLayers-j);
		}
		ordersigs[i] = sum;
	}
	int min = 0;
	for(int i=1; i<numLayers; i++){
		if(ordersigs[i] < ordersigs[min]){
			min = i;
		}
	}
	return ordersigs[min];
}
开发者ID:VDalibard,项目名称:Project12,代码行数:48,代码来源:relation.cpp


示例9: insertion

/*  Insert sessid and socket pair in AVL Tree		*/
AVLTree_Node* insertion(AVLTree_Node *T,uint16_t x, struct node *head)
{
    if(T==NULL)
    {
        T=(AVLTree_Node*)malloc(sizeof(AVLTree_Node));
        T->data=x;
	T->head = head;
        T->left=NULL;
        T->right=NULL;	 
    }
    else
        if(x > T->data)                // insert in right subtree
        {
            T->right=insertion(T->right,x,head);
            if(BF(T)==-2)
                if(x>T->right->data)
                    T=RR(T);
                else
                    T=RL(T);
        }
        else
            if(x<T->data)
            {
                T->left=insertion(T->left,x,head);
                if(BF(T)==2)
                    if(x < T->left->data)
                        T=LL(T);
                    else
                        T=LR(T);
            }
            T->ht=height(T);
	    //root=T;
            return(T);
}
开发者ID:prabhakarniraula,项目名称:snort-openappid-machinelearning,代码行数:35,代码来源:appIdSessionstore.c


示例10: main

int main()
{
	int ch, size, burstTime[MAX], flag = 1,i; 
	printf("Enter the number of processes : \n");
	scanf("%d",&size);

	printf("Enter the burst time for each process P\n");
	for (i = 0; i < size; ++i)
		scanf("%d", &burstTime[i]);

	printf("Enter the choice of implementation of CPU Scheduling Algorithm :\n");
	menu();
	
	while(flag)
	{
		scanf("%d",&ch);

		switch(ch)
		{
			case 1 : FCFS(burstTime, size);
			break;

			// case 2 : SJF(burstTime, size);
			// break;

			case 3 : RR(burstTime, size);
			break;

			default : flag = 0;
			continue;
		}
	}
	printf("Thank You for using the program.\n");
}
开发者ID:madhuspot,项目名称:OperatingSystemsLab,代码行数:34,代码来源:cpuScheduling.c


示例11: insert

avltree insert(avltree root,Elemtype data)
{
    if(!root)
    {
        root=(pnode)malloc(sizeof(node));
        root->data=data;
        root->left=root->right=0;
        root->height=0;
    }
    else if(data < root->data)    //插到左边
    {
        root->left=insert(root->left,data);
        if(HEIGHT(root->left)-HEIGHT(root->right)==2)   //失去平衡
        {
            if(data < root->left->data)
                root=LL(root);
            else
               root=LR(root);
        }
    }
    else if(data >root->data)   //插到右边
    {
        root->right=insert(root->right,data);
        if(HEIGHT(root->right)-HEIGHT(root->left)==2)   //失去平衡
        {
            if(data > root->right->data)
                root=RR(root);
            else
                root=RL(root);
        }
    }
    //data在树中已存在时什么事也不做
    root->height=MAX(HEIGHT(root->left),HEIGHT(root->right))+1;
    return root;
}
开发者ID:tiancaiamao,项目名称:datastruct,代码行数:35,代码来源:avltree.c


示例12: epd_get_dep_prog

    Eximpl int			/* 0 | depth */
epd_get_dep_prog( EpdJob* ejp, int dftdep )
{
    /*
     * If |ce| > 32000 --> either normal with depth or prove lost with depth
     * If dm > 0 --> normal with depth
     * If pv ends in # --> normal or lost with depth
     * |ce| >> 0 --> normal or lost with default depth
     * else: Try normal and lost, default depth
     * FFS: jobtype other than normal?
     * We derive a depth, and a "jobprog", or fail.
     */
    int		ce;
    int		plies;
    int		dm;
    int		pv;

#define RR(dep, prog)	{ f_jobprog = (prog); return (dep); }

    ce = epd_op_numval(ejp, "ce");
    dm = epd_op_numval(ejp, "dm");
    pv = epd_pv_plies(ejp);
    if( ce > 32000 ) {
	/* ce = 32767 - plies; plies = 32767 - ce
	 * plies = 2D-1; plies+1 = 2D; D = (plies+1)/2
	 */
	plies = 32767 - ce;
	if( (plies > 0) && (plies % 2) ) {
	    RR( (plies+1)/2, JTP__normal )
	}
    }else if( ce < -32000 ) {
开发者ID:redo007,项目名称:chess_with_chest,代码行数:31,代码来源:epdio.c


示例13: epat_log_adapter

static void epat_log_adapter( PIA *pi, char * scratch, int verbose )

{	int	ver;
        char    *mode_string[6] = 
		   {"4-bit","5/3","8-bit","EPP-8","EPP-16","EPP-32"};

	epat_connect(pi);
	WR(0xa,0x38);		/* read the version code */
        ver = RR(0xb);
        epat_disconnect(pi);

#ifdef CONFIG_DEBUG_PRINTK
	printk("%s: epat %s, Shuttle EPAT chip %x at 0x%x, ",
		pi->device,EPAT_VERSION,ver,pi->port);
#else
	;
#endif
#ifdef CONFIG_DEBUG_PRINTK
	printk("mode %d (%s), delay %d\n",pi->mode,
		mode_string[pi->mode],pi->delay);
#else
	;
#endif

}
开发者ID:Epirex,项目名称:Chrono_Kernel-1,代码行数:25,代码来源:epat.c


示例14: RL

static Node RL(Node rootnode){

    printf("do a RL in node %d\n" , rootnode -> data);

    rootnode -> right = LL(rootnode -> right);
    return RR(rootnode);
}
开发者ID:helloqiu,项目名称:dataClass,代码行数:7,代码来源:AVL_TREE.c


示例15: RR

//right left situation
static TLDNode *RL(TLDNode *node){
	TLDNode *temp;
	temp=node->right;
	//perform rotation
	node->right=LL(temp);
	return RR(node);
}
开发者ID:fuhchang,项目名称:ap3_as1,代码行数:8,代码来源:tldlist4.c


示例16: LR

static Node LR(Node rootnode){

    printf("do a LR in node %d\n" , rootnode -> data);

    rootnode -> left = RR(rootnode -> left);
    return LL(rootnode);
}
开发者ID:helloqiu,项目名称:dataClass,代码行数:7,代码来源:AVL_TREE.c


示例17: createNode

node *insertNode(node *root, int cont){
    if(root==NULL){
        return createNode(cont);
    }
    else
    if(cont>root->data) {
        root->right=insertNode(root->right,cont);
        if(BF(root)==-2){
            if(cont>root->right->data)
                root=RR(root);
                else
                    root=RL(root);
        }
    }
    else
    if(cont<root->data) {
        root->left=insertNode(root->left,cont);
        if(BF(root)==2){
            if(cont < root->left->data)
                root=LL(root);
                else
                  root=LR(root);
        }
    }
    /*else{
        if(cont==root->data) printf("the node %d already exists in the tree",cont);
        return root;
    }*/
    root->ht=height(root);
    return(root);
}
开发者ID:Alecs94,项目名称:DSA-lab,代码行数:31,代码来源:main.c


示例18: insert

node * insert(node *T,int x)
{
               if(T==NULL)
               {
                              T=(node*)malloc(sizeof(node));
                              T->data=x;
                              T->left=NULL;
                              T->right=NULL;
               }
               else
                              if(x > T->data)                // insert in right subtree
                              {
                                             T->right=insert(T->right,x);
                                             if(BF(T)==-2)
                                                            if(x>T->right->data)
                                                                           T=RR(T);
                                                            else
                                                                           T=RL(T);
                              }
                              else
                                             if(x<T->data)
                                             {
                                                            T->left=insert(T->left,x);
                                                            if(BF(T)==2)
                                                                           if(x < T->left->data)
                                                                                          T=LL(T);
                                                                           else
                                                                                          T=LR(T);
                                             }
                                             T->ht=height(T);

                                             return(T);

}
开发者ID:kc-alva,项目名称:EDD_practica2,代码行数:34,代码来源:main.c


示例19: GEMENI_charsent

void 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,代码来源:gemenipr.c


示例20: LR

//left right situation
static TLDNode *LR(TLDNode *node){
	TLDNode *temp;
	temp=node->left;
	//perform rotation
	node->left=RR(temp);
	return LR(node);
}
开发者ID:fuhchang,项目名称:ap3_as1,代码行数:8,代码来源:tldlist4.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ RREG32函数代码示例发布时间:2022-05-30
下一篇:
C++ RQ_ROWQ函数代码示例发布时间: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