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

C++ PR函数代码示例

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

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



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

示例1: dump_ahx

void dump_ahx(int nres,
	      t_bb bb[],rvec x[],matrix box,int teller)
{
  FILE *fp;
  char buf[256];
  int  i;
  
  sprintf(buf,"dump%d.gro",teller);
  fp=ffopen(buf,"w");
  fprintf(fp,"Dumping fitted helix frame %d\n",teller);
  fprintf(fp,"%5d\n",nres*5);
  for(i=0; (i<nres); i++) {
#define PR(AA) fprintf(fp,"%5d%5s%5s%5d%8.3f%8.3f%8.3f\n",i+1,"GLY",#AA,bb[i].AA,x[bb[i].AA][XX],x[bb[i].AA][YY],x[bb[i].AA][ZZ]); fflush(fp)
    if (bb[i].bHelix) {
      PR(N);
      PR(H);
      PR(CA);
      PR(C);
      PR(O);
    }
  }
  for(i=0; (i<DIM); i++)
    fprintf(fp,"%10.5f",box[i][i]);
  fprintf(fp,"\n");
  ffclose(fp);
}
开发者ID:andersx,项目名称:gmx-debug,代码行数:26,代码来源:gmx_helix.c


示例2: Function5

void Function5()
{
    int i = 0;
    int *p = (int *) malloc(sizeof(int) * ARRAY_SIZE);
    if (p == NULL)
    {
       fprintf(stderr, "Function5(): Error allocating p\n");
       exit(1);
    }

    printf("In Function5()...\n");

    for (i=0; i<ARRAY_SIZE; i++)
    {
        p[i]=i;
    }

    for (i=0; i<PARTIAL_SIZE; i++)
    {
        printf("Function5(): %s = %d,%s = %d ", PR(i),i,PR(p[i]), p[i]);
        printf("\n");
    }
    
    free(p);
}
开发者ID:joshu0991,项目名称:cs262,代码行数:25,代码来源:Function5.c


示例3: filters_brightness

void filters_brightness(unsigned char *image, int width, int height, int depth, int stride, int ibright) {
	register int i, j;
	register unsigned char *pBuf = NULL;
	double c;
	int tempC;

	if (ibright > 0) {
		ibright = ibright * 150 / 100;
		c = 0.000172 * ibright * ibright + 0.001093 * ibright + 0.2;
		for (i = 0; i < 256; i++) {
			tempC = (int)(255 - (255 - i) * pow(1 - i / 255.0, c) - 0.5);
			gTable[i] = CLAMP(tempC);
		}
	}
	else {
		ibright = ibright * 180 / 100;
		c = 0.00001077 * ibright * ibright + 0.00582 * ibright + 0.88;
		for (i = 0; i < 256; i++) {
			tempC = (int)(255 - 255 * pow(1 - i / 255.0, c) - 0.5);
			gTable[i] = CLAMP(tempC);
		}
	}

	for(j = 0; j < height; j++) {
		pBuf = image + j * stride;
		for(i = 0; i < width; i++, pBuf += depth) {
	    	PR(pBuf) = *(gTable + PR(pBuf));
	    	PG(pBuf) = *(gTable + PG(pBuf));
	    	PB(pBuf) = *(gTable + PB(pBuf));
		}
	}
}
开发者ID:wangli07115,项目名称:test,代码行数:32,代码来源:filters_brightness.cpp


示例4: intro

static void
intro(void)
{
    char *tmpname;

    srand((unsigned) (time(0L) + getpid()));	/* Kick the random number generator */

    CATCHALL(uninitgame);

    if ((tmpname = getlogin()) != 0) {
	(void) strcpy(name, tmpname);
	name[0] = (char) toupper(UChar(name[0]));
    } else
	(void) strcpy(name, dftname);

    (void) initscr();
    keypad(stdscr, TRUE);
    (void) def_prog_mode();
    (void) nonl();
    (void) cbreak();
    (void) noecho();

#ifdef PENGUIN
    (void) clear();
    (void) mvaddstr(4, 29, "Welcome to Battleship!");
    (void) move(8, 0);
    PR("                                                  \\\n");
    PR("                           \\                     \\ \\\n");
    PR("                          \\ \\                   \\ \\ \\_____________\n");
    PR("                         \\ \\ \\_____________      \\ \\/            |\n");
    PR("                          \\ \\/             \\      \\/             |\n");
    PR("                           \\/               \\_____/              |__\n");
    PR("           ________________/                                       |\n");
    PR("           \\  S.S. Penguin                                         |\n");
    PR("            \\                                                     /\n");
    PR("             \\___________________________________________________/\n");

    (void) mvaddstr(22, 27, "Hit any key to continue...");
    (void) refresh();
    (void) getch();
#endif /* PENGUIN */

#ifdef A_COLOR
    start_color();

    init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK);
    init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
    init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK);
    init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);
    init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
    init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK);
    init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
    init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
#endif /* A_COLOR */

#ifdef NCURSES_MOUSE_VERSION
    (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL);
#endif /* NCURSES_MOUSE_VERSION */
}
开发者ID:tizenorg,项目名称:external.ncurses,代码行数:59,代码来源:bs.c


示例5: main

int main()
{ int a,b,c,d;
  char string[]="CHINA";
  a=1;b=2;c=3;d=4;
  PR(D1,a);
  PR(D2,a,b);
  PR(D3,a,b,c);
  PR(D4,a,b,c,d);
  PR(S,string);
  return 0;
}
开发者ID:1040003585,项目名称:LearnedCandCPP,代码行数:11,代码来源:c11-5.c


示例6: main

int main(void)
{
    double x = 48;
    double y;
  
    y = sqrt(x);
    PR(1, "x = %g\n", x);
    PR(2, "x = %.2f, y = %.4f\n", x, y);
   
    return 0;
}
开发者ID:HelloCVitamin,项目名称:works,代码行数:11,代码来源:variadic.c


示例7: mexFunction

void mexFunction (int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[])
{
    char * fname;
    mxClassID inpt_class;
    struct arcfile af;
    struct reglist rl;
    mxArray * D;
    int r;

    if (nrhs != 1)
        mexErrMsgTxt ("list_arc takes one argument.");

    inpt_class = mxGetClassID (prhs[0]);
    if (inpt_class != mxCHAR_CLASS)
        mexErrMsgTxt ("list_arc takes a string argument.");
    fname = mxArrayToString (prhs[0]);
    if (fname == 0)
        mexErrMsgTxt ("could not get file name.");

    r = arcfile_open(fname, &af);
    if (r != 0)
    {
       PR ("Could not open arc file %s:\n", fname);
       mxFree (fname);
       mexErrMsgTxt ("list_arc failed.");
    }

    r = arcfile_read_regmap (&af, &rl);
    arcfile_close (&af);
    if (r != 0)
    {
      PR ("Error reading register map from arc file %s.\n", fname);
      mxFree (fname);
      mexErrMsgTxt ("list_arc failed.");
    }

    r = mat_fill_info (&rl, &D);
    if (r == 0)
    {
        plhs[0] = D;
    }
    else
    {
        PR ("Reading arc file %s:\n", fname);
        mxFree (fname);
        mexErrMsgTxt ("Error packaging register list for output.\n");
    }

    free_reglist (&rl);
    mxFree (fname);
    return;
}
开发者ID:cbischoff,项目名称:gcp-arcfile,代码行数:52,代码来源:mex_listarc.c


示例8: main

int main() {
	int* ip = new int;
	long* lp = new long;
	char* cp = new char[100];
	float* fp = new float[100];

	PR(ip, ip);
	PR(lp, lp);
	PR(cp, cp);
	PR(fp, fp);

	return 0;
} ///:~
开发者ID:yoryos,项目名称:Bloomberg-CMS,代码行数:13,代码来源:4_17.cpp


示例9: PR

void PR(){
  pair * p;
  tagged * t;
  obj y = TOS();

  if (AFIX(y))
    printf ("%ld", OBJ2FIX(y));
  else if (ACHAR(y)){
    char * utf8 = cpt2utf8(OBJ2CHAR(y));
    printf ("%s", utf8);
    free(utf8);
  }
  else if (ASYM(y))
    printf ("%s", ((symbol *)y)->value);
  else if (AFLOAT(y))
    printf ("%g", ((flonum*)y)->value);
  else if (ASTR(y))
    printf ("%s", str2utf8 ((string *) y));
  else if (AFN(y))
    printf ("#<procedure>");
  else if (ATBL(y))
    pr_tbl((table *) y);
  else if (ATAG(y)){
    t = (tagged *) y;
    printf ("#3(tagged ");
    PUSH(t->ctype); PR();
    printf (" ");
    TOS() = t->content; PR(); sp--; 
    printf (")");
  }
  else if (APAIR(y)){
    printf ("(");

    while (APAIR(y)){
        p = (pair *) y;
        PUSH(p->car); PR(); sp--;
        y = p->cdr;

        if (APAIR(y))
          printf (" ");
   }

   if (y != SYM2OBJ("nil")){
       PUSH(y);
       printf (" . ");
       PR(); sp--;
    }
    printf (")");
  }
}
开发者ID:sacado,项目名称:arc2c,代码行数:50,代码来源:a2c.c


示例10: pr_pullgrp

static void pr_pullgrp(FILE *fp,int indent,int g,t_pullgrp *pg)
{
  pr_indent(fp,indent);
  fprintf(fp,"pull-group %d:\n",g);
  indent += 2;
  pr_ivec_block(fp,indent,"atom",pg->ind,pg->nat,TRUE);
  pr_rvec(fp,indent,"weight",pg->weight,pg->nweight,TRUE);
  PI("pbcatom",pg->pbcatom);
  pr_rvec(fp,indent,"vec",pg->vec,DIM,TRUE);
  pr_rvec(fp,indent,"init",pg->init,DIM,TRUE);
  PR("rate",pg->rate);
  PR("k",pg->k);
  PR("kB",pg->kB);
}
开发者ID:alexholehouse,项目名称:gromacs,代码行数:14,代码来源:txtdump.c


示例11: exposure

void exposure(unsigned char *image, int width, int height, int depth, int stride, int scale) {
    register int i, j;
    register unsigned char *pBuf;
    int m =   (255 - scale);

    for (j = 0; j < height; j++) {
        pBuf = image + j * stride;
        for (i = 0; i < width; i++, pBuf += depth) {
            PR(pBuf) = CLAMP((int)(255 * PR(pBuf) / m));
            PG(pBuf) = CLAMP((int)(255 * PG(pBuf) / m));
            PB(pBuf) = CLAMP((int)(255 * PB(pBuf) / m));
        }
    }
}
开发者ID:wangli07115,项目名称:test,代码行数:14,代码来源:exposure.cpp


示例12: bcm_btlock_init

static int bcm_btlock_init(void)
{
	int ret;

	PR("init\n");

	ret = misc_register(&btlock_misc);
	if (ret != 0) {
		PR("Error: failed to register Misc driver,  ret = %d\n", ret);
		return ret;
	}
	sema_init(&btlock, 1);

	return ret;
}
开发者ID:Canuck-OG,项目名称:LGF180-Optimus-G-_Android_KK_v30a_Kernel,代码行数:15,代码来源:board-L05E-rfkill.c


示例13: main

//注:site统一表示在表中的顺序,从1开始计数 
///////////////////////////////////////////////
int main(void)
{
	ElementType X[6] = {{1},{2},{3},{4},{5},{6}};
	SeqList P;
	ElementType test = { 888 };
	P = IniList( X, 6);
	PR(P);
	Delete(4,P);
	PR(P); 
	Insert(test,P,4);
	PR(P);
	Insert(Get(5,P),P,2);
	PR(P);
	
}
开发者ID:kingsring,项目名称:KWC_Code,代码行数:17,代码来源:SeqList.cpp


示例14: pr_pull

static void pr_pull(FILE *fp,int indent,t_pull *pull)
{
  int g;

  PS("pull-geometry",EPULLGEOM(pull->eGeom));
  pr_ivec(fp,indent,"pull-dim",pull->dim,DIM,TRUE);
  PR("pull-r1",pull->cyl_r1);
  PR("pull-r0",pull->cyl_r0);
  PR("pull-constr-tol",pull->constr_tol);
  PI("pull-nstxout",pull->nstxout);
  PI("pull-nstfout",pull->nstfout);
  PI("pull-ngrp",pull->ngrp);
  for(g=0; g<pull->ngrp+1; g++)
    pr_pullgrp(fp,indent,g,&pull->grp[g]);
}
开发者ID:alexholehouse,项目名称:gromacs,代码行数:15,代码来源:txtdump.c


示例15: tegra_dc_sor_set_voltage_swing

int tegra_dc_sor_set_voltage_swing(struct udevice *dev,
				    const struct tegra_dp_link_config *link_cfg)
{
	struct tegra_dc_sor_data *sor = dev_get_priv(dev);
	u32 drive_current = 0;
	u32 pre_emphasis = 0;

	/* Set to a known-good pre-calibrated setting */
	switch (link_cfg->link_bw) {
	case SOR_LINK_SPEED_G1_62:
	case SOR_LINK_SPEED_G2_7:
		drive_current = 0x13131313;
		pre_emphasis = 0;
		break;
	case SOR_LINK_SPEED_G5_4:
		debug("T124 does not support 5.4G link clock.\n");
	default:
		debug("Invalid sor link bandwidth: %d\n", link_cfg->link_bw);
		return -ENOLINK;
	}

	tegra_sor_writel(sor, LANE_DRIVE_CURRENT(sor->portnum), drive_current);
	tegra_sor_writel(sor, PR(sor->portnum), pre_emphasis);

	return 0;
}
开发者ID:Noltari,项目名称:u-boot,代码行数:26,代码来源:sor.c


示例16: 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


示例17: tegra_dc_sor_set_lane_parm

void tegra_dc_sor_set_lane_parm(struct udevice *dev,
		const struct tegra_dp_link_config *link_cfg)
{
	struct tegra_dc_sor_data *sor = dev_get_priv(dev);

	tegra_sor_writel(sor, LANE_DRIVE_CURRENT(sor->portnum),
			 link_cfg->drive_current);
	tegra_sor_writel(sor, PR(sor->portnum),
			 link_cfg->preemphasis);
	tegra_sor_writel(sor, POSTCURSOR(sor->portnum),
			 link_cfg->postcursor);
	tegra_sor_writel(sor, LVDS, 0);

	tegra_dc_sor_set_link_bandwidth(dev, link_cfg->link_bw);
	tegra_dc_sor_set_lane_count(dev, link_cfg->lane_count);

	tegra_sor_write_field(sor, DP_PADCTL(sor->portnum),
			      DP_PADCTL_TX_PU_ENABLE |
			      DP_PADCTL_TX_PU_VALUE_DEFAULT_MASK,
			      DP_PADCTL_TX_PU_ENABLE |
			      2 << DP_PADCTL_TX_PU_VALUE_SHIFT);

	/* Precharge */
	tegra_sor_write_field(sor, DP_PADCTL(sor->portnum), 0xf0, 0xf0);
	udelay(20);

	tegra_sor_write_field(sor, DP_PADCTL(sor->portnum), 0xf0, 0x0);
}
开发者ID:Noltari,项目名称:u-boot,代码行数:28,代码来源:sor.c


示例18: point_table

//colorTable[stepr * stepg * stepb]
void point_table(unsigned char *image, unsigned char *colorTable, int width, int height, int depth, int stride, int stepr, int stepg, int stepb) {
    int i, j;
    static int STEP = 3;
    unsigned char  *pBuf;

    int r, g, b;
    int lut_r, lut_g, lut_b;
    float fr, fg, fb;
    float dr, dg, db;
    int p;
    int off[8] = {
            STEP * 0 ,                                     STEP * 1,
            STEP * (stepb) ,                            STEP * (stepb+ 1),
            STEP * (stepb * stepg) ,                STEP * (stepb * stepg + 1),
            STEP * (stepb * stepg + stepb),    STEP * (stepb * stepg + stepb +1)};

    float scaler = (stepr - 1) / 256.f;
    float scaleg = (stepg - 1) / 256.f;
    float scaleb = (stepb - 1) / 256.f;

    for(j = 0; j < height; j++) {
        pBuf = image + j * stride;
        for(i = 0; i < width; i++, pBuf += depth) {
            r = PR(pBuf);
            g = PG(pBuf);
            b = PB(pBuf);

            fb = b*scaler;
            fg = g*scaleg;
            fr = r*scaleb;
            lut_b = (int)fb;
            lut_g = (int)fg;
            lut_r = (int)fr;
            dr = fr-lut_r;
            dg = fg-lut_g;
            db = fb-lut_b;

            p = lut_b + lut_g * stepb + lut_r * stepg * stepb;
            p *= STEP;

            PR(pBuf) = interp(colorTable,p  ,off,dr,dg,db);
            PG(pBuf) = interp(colorTable,p+1,off,dr,dg,db);
            PB(pBuf) = interp(colorTable,p+2,off,dr,dg,db);
        }
    }
}
开发者ID:wangli07115,项目名称:test,代码行数:47,代码来源:point_table.cpp


示例19: main

int main()
{
  string line=(string)malloc(MAXSIZE);
  while (PROMPT,gets(line)&& line[0]) {
        char oper=NIL;
        double result=0;
        char *curr=line;
        int begincalc=0;
        while (*curr){
            double value=0;
            double power=1;
            //printf("%s=%c\n","curr",*curr);
            if (*curr=='+' || *curr=='-' || *curr=='*' || *curr=='/'){
               oper=*curr;
               curr++;
               continue;
               }
            else if (*curr && isdigit(*curr)) {
                    while(*curr && isdigit(*curr)){
                        value=10*value+*curr-'0';
                        curr++;
                    }
                    if(*curr=='.'){
                        curr++;           
                        while(*curr && isdigit(*curr)){
                           value=10*value+*curr-'0';
                           power=10*power;           
                           curr++;
                           }
                    value=value/power;   
                    }      
                if (begincalc)
                    switch (oper){
                    case '+':
                             result += value;
                             break;                             
                    case '-':
                             result -= value;
                             break;
                    case '*':
                             result *= value;
                             break;
                    case '/':
                             result /= value;
                             break;
                     }
                else {
                     begincalc=1;
                     result=value;
                     }                                
                 }
              else 
                   curr++;   
        }
        PR(result);
  }
  return 0;
}
开发者ID:badcodes,项目名称:c,代码行数:58,代码来源:main.c


示例20: main

int main()
{
  float x=5.0,x1=3.0,x2=8.0;
  char d='f';
  PR(d,x);
  PRINT1(d,x);
  PRINT2(d,x1,x2);
  return 0;
}
开发者ID:hclife,项目名称:linux-bash,代码行数:9,代码来源:xt11-5.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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