本文整理汇总了C++中PR函数的典型用法代码示例。如果您正苦于以下问题:C++ PR函数的具体用法?C++ PR怎么用?C++ PR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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));
}
}
}
示例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 */
}
示例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;
}
示例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;
}
示例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;
}
示例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;
} ///:~
示例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 (")");
}
}
示例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);
}
示例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));
}
}
}
示例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;
}
示例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);
}
示例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]);
}
示例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;
}