stcclr () { register unsigned *obj; register short i, j; register unsigned k; if ((v_regs[5] & 0x0180) NE 0x0100) vbank (1); /* select the correct bank */ stcrow = 0; /* leave score cursor row,col = 0,0 */ stccol = 0; obj = STCOBJ; /* intialize pointers */ for (i = 0; i < 9; i++) { /* clear each cursor row */ for (j = 0; j < 64; j++) { /* top cursor row */ k = exp_c (sctctab[i][j]); *obj++ = k; *obj++ = k; } for (j = 0; j < 64; j++) { /* bottom cursor row */ k = exp_c (sctctab[i EQ 5 ? 9 : i][j]); *obj++ = k; *obj++ = k; } } }
stcoff () { register unsigned ccv, *tcp; register short tcrow; tcrow = stcrow ? (stcrow - 16) : 0; /* get old object row */ if ((v_regs[5] & 0x0180) NE 0x0100) vbank (1); tcp = STCOBJ + (tcrow << 8) + (stccol << 1); /* object pointer */ /* background color */ ccv = exp_c (sctctab[tcrow][stccol]); *tcp++ = ccv; /* turn off the text cursor */ *tcp = ccv; }
c_complex coherent_state(double x_in, double h, double x_c, double p_c) { c_complex res; double x; c_complex z, zz; c_complex tmp; x = x_in/sqrt(h/(2*M_PI)); z.re = x_c/sqrt(h/M_PI); z.im = p_c/sqrt(h/M_PI); zz = mul_c(z,z); tmp.re = -abs_c(z)*abs_c(z)/2.0 - (x*x + zz.re)/2.0 + sqrt(2.0)*x*z.re; tmp.im = - zz.im /2.0 + sqrt(2.0)*x*z.im; res = exp_c(tmp); res.re *= sqrt(sqrt(2.0/h)); res.im *= sqrt(sqrt(2.0/h)); return res; }