Exemplo n.º 1
0
Arquivo: ct.c Projeto: EdKeith/core
static A jttayamp(J jt,A w,B nf,A x,A h){A y;B ng=!nf;I j,n;V*v=VAV(h);
 ASSERT(AR(x)<=(nf?v->lr:v->rr),EVRANK);
 switch(v->id){
  case CPLUS:  R tpoly(over(x,one));
  case CMINUS: R tpoly(nf?over(x,num[-1]):over(negate(x),one));
  case CSTAR:  R tpoly(over(zero,x));
  case CDIV:   ASSERT(ng,EVDOMAIN); R tpoly(over(zero,recip(x)));
  case CJDOT:  R tpoly(nf?over(x,a0j1):over(jdot1(x),one));
  case CPOLY:  ASSERT(nf,EVDOMAIN); R tpoly(BOX&AT(x)?poly1(x):x);
  case CHGEOM: ASSERT(nf,EVDOMAIN); RE(j=i0(x)); ASSERT(0<=j,EVDOMAIN);
               y=IX(j);
               R tpoly(divide(hgcoeff(y,h),fact(y)));
  case CBANG:  ASSERT(nf,EVDOMAIN); RE(j=i0(x)); ASSERT(0<=j,EVDOMAIN); 
               R tpoly(divide(poly1(box(iota(x))),fact(x)));
  case CEXP:   if(nf)R eva(x,"(^.x)&^ % !");
               RE(n=i0(x));   
               R 0<=n?tpoly(over(reshape(x,zero),one)):atop(ds(CDIV),amp(h,sc(-n))); 
  case CFIT:   ASSERT(nf&&CPOLY==ID(v->f),EVDOMAIN);
               y=over(x,IX(IC(x)));
               R tpoly(mdiv(df2(x,y,h),atab(CEXP,y,IX(IC(x)))));
  case CCIRCLE:
   switch(i0(x)){
    case 1:    R eval("{&0 1 0 _1@(4&|) % !");
    case -3:   R eval("{&0 1 0 _1@(4&|) % ]");
    case 2:    R eval("{&1 0 _1 0@(4&|) % !");
    case 5:    R eval("2&|    % !");
    case -7:   R eval("2&|    % ]");
    case 6:    R eval("2&|@>: % !");
    case -1:   R eval("(2&|              % ]) * ([: */ (1&+ % 2&+)@(i.@<.&.-:))\"0");
    case -5:   R eval("({&0 1 0 _1@(4&|) % ]) * ([: */ (1&+ % 2&+)@(i.@<.&.-:))\"0");
 }}
 ASSERT(0,EVDOMAIN);
}
Exemplo n.º 2
0
ivocab() {
    static int direct, kword, mm, mark;

    if( (F3=fopen("advvocab","r")) == NULL )  fatal();
    printf("vocabulary words   :");
    while(getlin()) {
	mark=line(1);
	if( mark=='m' ) {                /* message */
	    rtext(mm)=putmes();
	} else {
	    if( mark=='d' ) {            /* directional words */
		direct=direct+1; kword=direct;
	    } else if( mark=='s' ) {       /* special words */
		mm=ranm-mesimp;
		kword=mm+(specwr*1000);
		mesimp=mesimp+1;
	    } else {
		printf("\n%s%.10s\n","неверный маркер: ",_line); fatal();
	    }
	    p=4                                /* read list of words */;
	    while(getwrd()) {
		if( vocab(_word) >= 0 ) {
		    printf("\n%s%.4s\n","дважды определено: ",_word);
		    fatal();
		}
		nvoc=nvoc+1;
		ktab(nvoc)=kword;  atab(nvoc) = *rword;
		screen(nvoc);
	    }
	}
    }
    printf("%8d  %s %6d  %s\n",nvoc,"of",vocw,"used");
    fclose(F3);
}
Exemplo n.º 3
0
Table* Database::addTable(string tabname)
{
    Table *tab = getTable(tabname);
    if (tab == NULL)
    {
        string path = DBFPATH + name + "\\" + tabname + ".tbl";
        if (g_file_dir(path, 0))
        {
            if (remove(path.c_str()) == 0)
            {
                return NULL;
            }
        }
        /// just new a table
        Table atab(tabname, name);
        this->m_tables.push_back(atab);
        return &this->m_tables.back();
    }
    return NULL;
}