// static func void SmolReac::zombify( Element* solver, Element* orig ) { static const Finfo* toSub = orig->cinfo()->findFinfo( "toSub" ); static const Finfo* toPrd = orig->cinfo()->findFinfo( "toPrd" ); assert( toSub ); assert( toPrd ); Element temp( orig->id(), smolReacCinfo, solver->dataHandler() ); Eref zer( &temp, 0 ); Eref oer( orig, 0 ); SmolReac* z = reinterpret_cast< SmolReac* >( zer.data() ); Reac* r = reinterpret_cast< Reac* >( oer.data() ); vector< Id > subs; vector< Id > prds; orig->getNeighbours( subs, dynamic_cast< const SrcFinfo* >( toSub ) ); orig->getNeighbours( prds, dynamic_cast< const SrcFinfo* >( toPrd ) ); string halfName = orig->getName() + "_f"; buildHalfReac( z->sim_, halfName.c_str(), subs, prds, r->getKf() ); halfName = orig->getName() + "_b"; buildHalfReac( z->sim_, halfName.c_str(), prds, subs, r->getKb() ); DataHandler* dh = new DataHandlerWrapper( solver->dataHandler(), orig->dataHandler() ); orig->zombieSwap( smolReacCinfo, dh ); }
int main() { long n,b; while(scanf("%ld%ld",&n,&b)!=EOF) { printf("%ld %ld\n",zer(n,b),digits(n,b)); } return 0; }
GV0(C,k1){ I tzer=(Et==t&&n-u&&QS(((I*)w)[0]))?Et+1:t; !u?tmv(t,(I *)r,(I *)(w+Tt(t,v)),n): u<0?tmv(t,(I *)zer(tzer,(I *)r,-u),(I *)w,n+u): zer(tzer,(I *)tmv(t,(I *)r,(I *)(w+Tt(t,v)),n-u),u); }
GV0(C,m0){!u?zer(t,(I *)r,n):(w=tmv(t,(I *)r,(I *)w,n>u?u:n),n>u)?tmv(t,(I *)w,(I *)r,n-u):0;}
GV0(C,x3){I tzer=(Et==t&&u&&QS(((I*)w)[0]))?Et+1:t;C *p=r+Tt(t,n);for(;r<p;)if(*a++)r=tmv(t,(I *)r,(I *)w,v),w+=(aw!=2)?Tt(t,v):0;else r=zer(tzer,(I *)r,v);}
Z I gC(I t,I r,I n,I *d,I *p) { A z=ga(t,r,n,d); p?tmv(t,z->p,p,n):zer(t,z->p,n); R(I)z; }