本文整理匯總了C++中AV函數的典型用法代碼示例。如果您正苦於以下問題:C++ AV函數的具體用法?C++ AV怎麽用?C++ AV使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AV函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: jtspsscell
static B jtspsscell(J jt,A w,I wf,I wcr,A*zc,A*zt){A c,t,y;B b;
I cn,*cv,j,k,m,n,p,*s,tn,*tv,*u,*u0,*v,*v0;P*wp;
wp=PAV(w); s=AS(w); p=3+s[wf];
y=SPA(wp,i); s=AS(y); m=s[0]; n=s[1];
u0=AV(y); u=u0+n;
v0=u0+wf; v=v0+n;
if(!m){*zt=*zc=mtv; R 1;}
GATV(t,INT,2+2*m,1,0); tv=AV(t); tv[0]=tv[1]=0; tn=2;
GATV(c,INT, 2*m,2,0); cv=AV(c); cv[0]=0; cn=0; *(1+AS(c))=2;
for(j=1;j<m;++j){
b=1;
for(k=0;k<wf;++k)
if(u0[k]!=u[k]){
tv[tn++]=j; tv[tn++]=j; cv[1+cn]=tn-cv[cn];
if(p==tn-cv[cn]){++cv[cn]; cv[1+cn]-=2;}
cn+=2;
cv[cn]=tn-2; u0=u; v0=v; b=0;
break;
}
if(b&&*v0!=*v){tv[tn++]=j; v0=v;}
u+=n; v+=n;
}
tv[tn++]=m; tv[tn++]=m; cv[1+cn]=tn-cv[cn];
if(p==tn-cv[cn]){++cv[cn]; cv[1+cn]-=2;}
cn+=2;
AN(t)= *AS(t)=tn; *zt=t; /* cell divisions (row indices in y) */
AN(c)=cn; *AS(c)=cn/2; *zc=c; /* item divisions (indices in t, # of elements) */
R 1;
} /* frame: all sparse; cell: 1 or more sparse, then dense */
示例2: REPF
static REPF(jtrepzsx) {
A q,x,y;
I c,d,j,k=-1,m,p=0,*qv,*xv,*yv;
P*ap;
RZ(a&&w);
ap=PAV(a);
x=SPA(ap,x);
m=AN(x);
if(!AN(SPA(ap,a)))R repzdx(ravel(x),w,wf,wcr);
y=SPA(ap,i);
yv=AV(y);
RZ(x=cvt(INT,vec(FL,2*m,AV(x))));
xv=AV(x);
if(equ(zero,SPA(ap,e))) {
k=c=*(wf+AS(w));
if(!wf&&SPARSE&AT(w)) {
A a,y;
I m,n,q,*v;
P*wp;
wp=PAV(w);
a=SPA(wp,a);
if(AN(a)&&!*AV(a)) {
y=SPA(wp,i);
v=AS(y);
m=v[0];
n=v[1];
v=AV(y);
k=m?v[(m-1)*n]+1:0;
q=0;
DO(m, if(q==*v)++q; else if(q<*v) {
k=q;
break;
}
v+=n;);
}
示例3: F2
static F2(jtpdtspmv){A ax,b,g,x,wx,y,yi,yj,z;B*bv;I m,n,s[2],*u,*v,*yv;P*ap,*wp,*zp;
RZ(a&&w);
ap=PAV(a); y=SPA(ap,i); yv=AV(y); s[0]=n=*AS(y); s[1]=1;
GATV(yj,INT,n,2,s);
if(DENSE&AT(w)){
GATV(yi,INT,n,2,s); u=AV(yi); AR(yj)=1; v=AV(yj);
DO(n, *u++=*yv++; *v++=*yv++;);
示例4: AFFDEF
AFFEND
AFFDEF(arc_tell)
{
AARG(fp);
AFBEGIN;
AFTCALL(VINDEX(IO(AV(fp))->io_ops, IO_tell), AV(fp));
AFEND;
}
示例5: jtixin
static B jtixin(J jt,A w,I s,I*i,I*n){A in,*wv;I j,k,m,*u,wd;
if(AT(w)&BOX){wv=AAV(w); wd=(I)w*ARELATIVE(w); RZ(in=vi(WVR(1))); k=AN(in); u=AV(in);}
else{in=w; k=AN(in)-1; u=1+AV(in);}
ASSERT(1>=AR(in),EVRANK);
ASSERT(k&&k<=(n?2:1),EVLENGTH);
j=u[0]; j=0>j?s+j:j; m=1==k?s-j:u[1];
ASSERT(0<=j&&(!n||j<s&&j+m<=s&&0<=m),EVINDEX);
*i=j; if(n)*n=m;
R 1;
} /* process index file arg for index and length */
示例6: F1
F1(bool){A b,h;I j,*v;
RZ(w);
if(VERB&AT(w))R ADERIV(CBOOL, basis1,0L, 0L,0L,0L);
RZ(w=vi(w));
v=AV(w);
DO(AN(w), j=*v++; ASSERT(-16<=j&&j<16,EVINDEX));
GA(b,BOOL,64,2,0); *AS(b)=16; *(1+AS(b))=4; MC(AV(b),booltab,64L);
RZ(h=cant2(apv(AR(w),0L,1L),from(w,b)));
R fdef(CBOOL,VERB, bool1,bool2, w,0L,h, 0L, RMAXL,0L,0L);
}
示例7: AFFDEF
static AFFDEF(clos_pprint)
{
AARG(sexpr, disp, fp);
AOARG(visithash);
AFBEGIN;
AFTCALL(arc_mkaff(c, __arc_disp_write, CNIL), CLOS_CODE(AV(sexpr)),
AV(disp), AV(fp), AV(visithash));
AFEND;
}
示例8: AFFDEF
static AFFDEF(symbol_pprint)
{
AARG(sexpr, disp, fp);
AOARG(visithash);
AFBEGIN;
(void)visithash;
(void)disp;
AFTCALL(arc_mkaff(c, arc_disp, CNIL), arc_sym2name(c, AV(sexpr)), AV(fp));
AFEND;
}
示例9: AFFDEF
AFFEND
static AFFDEF(fio_seek)
{
AARG(fio, offset, whence);
AFBEGIN;
if (!(FIX2INT(AV(whence)) == SEEK_SET || FIX2INT(AV(whence)) == SEEK_CUR ||
FIX2INT(AV(whence)) == SEEK_END)) {
arc_err_cstrfmt(c, "invalid seek whence argument");
ARETURN(CNIL);
}
#ifdef HAVE_FSEEKO
{
long long noff;
if (__arc_val2ll(c, AV(offset), &noff)) {
ARETURN(INT2FIX(fseeko(FIODATA(AV(fio))->fp, (off_t)noff, FIX2INT(AV(whence)))));
} else {
arc_err_cstrfmt(c, "invalid seek offset");
}
}
#else
{
long noff;
if (__arc_val2long(c, AV(offset), &noff)) {
ARETURN(INT2FIX(fseek(FIODATA(AV(fio))->fp, noff, FIX2INT(AV(whence)))));
} else {
arc_err_cstrfmt(c, "invalid seek offset");
}
}
#endif
AFEND;
}
示例10: jtsymext
B jtsymext(J jt,B b){A x,y;I j,m,n,s[2],*v,xn,yn;L*u;
if(b){y=jt->symp; j=((MS*)y-1)->j; n=*AS(y); yn=AN(y);}
else { j=12; n=1; yn=0; }
m=msize[1+j]; /* new size in bytes */
m-=sizeof(MS)+SZI*(AH+2); /* less array overhead */
m/=symcol*SZI; /* new # rows */
s[0]=m; s[1]=symcol; xn=m*symcol; /* new pool array shape */
GA(x,INT,xn,2,s); v=AV(x); /* new pool array */
if(b)ICPY(v,AV(y),yn); /* copy old data to new array */
memset(v+yn,C0,SZI*(xn-yn)); /* 0 unused area for safety */
u=n+(L*)v; j=1+n;
DO(m-n-1, u++->next=j++;); /* build free list extension */
示例11: AFFDEF
AFFEND
static AFFDEF(xhash_apply)
{
AARG(tbl, key, dflt);
AFBEGIN;
AFCALL(arc_mkaff(c, arc_xhash_lookup, CNIL), AV(tbl), AV(key));
if (BOUND_P(AFCRV))
ARETURN(AFCRV);
ARETURN(AV(dflt));
AFEND;
}
示例12: pjmedia_format_id_to_PixelFormat
pj_status_t pjmedia_format_id_to_PixelFormat(pjmedia_format_id fmt_id,
enum AVPixelFormat *pixel_format)
{
unsigned i;
for (i=0; i<PJ_ARRAY_SIZE(ffmpeg_fmt_table); ++i) {
const struct ffmpeg_fmt_table_t *t = &ffmpeg_fmt_table[i];
if (t->id==fmt_id && t->pf != AV(PIX_FMT_NONE)) {
*pixel_format = t->pf;
return PJ_SUCCESS;
}
}
*pixel_format = AV(PIX_FMT_NONE);
return PJ_ENOTFOUND;
}
示例13: pjmedia_format_id_to_CodecID
pj_status_t pjmedia_format_id_to_CodecID(pjmedia_format_id fmt_id,
unsigned *codec_id)
{
unsigned i;
for (i=0; i<PJ_ARRAY_SIZE(ffmpeg_codec_table); ++i) {
const struct ffmpeg_codec_table_t *t = &ffmpeg_codec_table[i];
if (t->id==fmt_id && t->codec_id != AV(PIX_FMT_NONE)) {
*codec_id = t->codec_id;
return PJ_SUCCESS;
}
}
*codec_id = (unsigned)AV(PIX_FMT_NONE);
return PJ_ENOTFOUND;
}
示例14: DF1
static DF1(case1){A u;V*sv;
PREF1(case1);
sv=VAV(self);
RZ(u=from(df1(w,sv->g),sv->h));
ASSERT(!AR(u),EVRANK);
R df1(w,*AV(u));
}
示例15: F1
static F1(jtvtokens){A t,*y,z;I n,*s;TA*x;
RZ(t=tokens(vs(w))); n=AN(t); y=AAV(t);
jt->tmonad=1;
GA(z,BOX,WTA*(5+n),2,0); s=AS(z); *s++=5+n; *s=WTA;
x=(TA*)AV(z);
x->a=mark; x->t=0; ++x;
DO(n, x->a=t=*y++; x->t=0; ++x; if(t==xnam||jt->dotnames&&t==xdot)jt->tmonad=0;);