Exemple #1
0
void	init_all_combo(t_gui *gui)
{
  init_resol(gui);
  init_antia(gui);
  init_clients_g(gui);
  init_mode(gui);
}
Exemple #2
0
void ir_init(void)
{
	firm_init_flags();
	init_ident();
	init_edges();
	init_tarval_1();
	/* Builds a basic program representation, so modes can be added. */
	init_irprog_1();
	init_mode();
	init_tarval_2();
	firm_init_op();
	firm_init_reassociation();
	firm_init_funccalls();
	firm_init_inline();
	firm_init_scalar_replace();
	/* Builds a construct allowing to access all information to be constructed
	   later. */
	init_irprog_2();
	firm_init_memory_disambiguator();
	firm_init_loop_opt();

	arch_dep_set_opts(arch_dep_none);

	init_execfreq();
	firm_be_init();

#ifdef DEBUG_libfirm
	firm_init_debugger();
#endif
}
Exemple #3
0
void
StompBox::changepar (int npar, int value)
{
    switch (npar) {
    case 0:
        setvolume (value);
        break;
    case 1:
        Phigh = value;
        if( value < 0) highb = ((float) value)/64.0f;
        if( value > 0) highb = ((float) value)/32.0f;
        break;
    case 2:
        Pmid = value;
        if( value < 0) midb = ((float) value)/64.0f;
        if( value > 0) midb = ((float) value)/32.0f;
        break;
    case 3:
        Plow = value;
        if( value < 0) lowb = ((float) value)/64.0f;
        if( value > 0) lowb = ((float) value)/32.0f;
        break;
    case 4:
        Pgain = value;
        gain = dB2rap(50.0f * ((float)value)/127.0f  - 50.0f);
        break;
    case 5:
        Pmode = value;
        init_mode (Pmode);
        break;

    };
    init_tone ();
};
Exemple #4
0
void ir_init(void)
{
	/* for historical reasons be_init must be run first */
	firm_be_init();

	/* initialize firm flags */
	firm_init_flags();
	/* initialize all ident stuff */
	init_ident();
	/* Edges need hooks. */
	init_edges();
	/* create the type kinds. */
	init_tpop();
	/* create an obstack and put all tarvals in a pdeq */
	init_tarval_1(0l, /* support_quad_precision */0);
	/* Builds a basic program representation, so modes can be added. */
	init_irprog_1();
	/* initialize all modes an ir node can consist of */
	init_mode();
	/* initialize tarvals, and floating point arithmetic */
	init_tarval_2();
	/* initialize node opcodes */
	firm_init_op();
	/* init graph construction */
	firm_init_irgraph();
	/* kind of obstack initialization */
	firm_init_mangle();
	/* initialize reassociation */
	firm_init_reassociation();
	/* initialize function call optimization */
	firm_init_funccalls();
	/* initialize function inlining */
	firm_init_inline();
	/* initialize scalar replacement */
	firm_init_scalar_replace();
	/* Builds a construct allowing to access all information to be constructed
	   later. */
	init_irprog_2();
	/* memory disambiguation */
	firm_init_memory_disambiguator();
	firm_init_loop_opt();

	/* Init architecture dependent optimizations. */
	arch_dep_set_opts(arch_dep_none);

	init_execfreq();

	init_stat();

#ifdef DEBUG_libfirm
	/* integrated debugger extension */
	firm_init_debugger();
#endif
}
Exemple #5
0
int revolveMode::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: on_log_in_out_button_clicked(); break;
        case 1: on_return_button_clicked(); break;
        case 2: revolve_pic_start(); break;
        case 3: init_mode(); break;
        case 4: return_serial_mode(); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}
Exemple #6
0
int main(void)
{
	init_ident();
	init_tarval_1();
	init_irprog_1();
	init_mode();
	init_tarval_2();

	double d_nan = 0.0/0.0;
	assert (d_nan != d_nan);

	d_nan = new_nan(1234);
	assert (d_nan != d_nan);
	assert (nan_payload(d_nan) == 1234);

	d_nan *= 2;
	assert (d_nan != d_nan);

	ir_tarval* tv_nan = new_tarval_from_double(d_nan, mode_D);
	assert (tarval_is_nan(tv_nan));
	d_nan = get_tarval_double(tv_nan);
	assert (d_nan != d_nan);
	assert (nan_payload(d_nan) == 1234);

	tv_nan = new_tarval_nan(mode_D, false, NULL);
	assert (tarval_is_nan(tv_nan));
	d_nan = get_tarval_double(tv_nan);
	assert (d_nan != d_nan);

	d_nan = new_nan(0);
	assert (nan_payload(d_nan) == 0);
	assert (d_nan != d_nan);
	tv_nan = new_tarval_from_double(d_nan, mode_D);
	assert (tarval_is_nan(tv_nan));
	d_nan = get_tarval_double(tv_nan);
	assert (d_nan != d_nan);
	assert (nan_payload(d_nan) == 0);

	finish_tarval();
	finish_mode();
	finish_ident();
	return 0;
}
Exemple #7
0
static void * celt_create_decoder(const struct PluginCodec_Definition * codec)
{
  CELTContext * celt = malloc(sizeof(CELTContext));
  if (celt == NULL)
    return NULL;

  if (init_mode(celt, codec) == FALSE) {
    free(celt);
    return NULL;
  }

  celt->decoder_state = celt_decoder_create(celt->mode);
  if (celt->decoder_state == NULL ) {
    celt_mode_destroy(celt->mode);
    free(celt);
    return NULL;
  }

  return celt;
}
Exemple #8
0
static int video_init()
{
    /* If we are running under X, get a connection to the X server and create
       an empty window of size (1, 1). It makes a couple of init functions a
       lot easier. */
	if(vstat.scaling<1)
		vstat.scaling=1;
    if(init_window())
		return(-1);

	bitmap_init(x11_drawrect, x11_flush);

    /* Initialize mode 3 (text, 80x25, 16 colors) */
    if(init_mode(3)) {
		return(-1);
	}

	sem_wait(&mode_set);

    return(0);
}
Exemple #9
0
void TWinManager::CloseScreen()
{
   init_mode( 3 );
   clrscr();
}
Exemple #10
0
void TWinManager::InitScreen()
{
   init_mode( 0x13 );
}
Exemple #11
0
void init_vga(const char *paletname) {
    init_mode(VGA_MODE, paletname);
}
Exemple #12
0
int init_vesa(const char *paletname) {
    return init_mode(SVGA_MODE, paletname);
}
Exemple #13
0
void x11_event_thread(void *args)
{
	int x;
	int high_fd;
	fd_set fdset;
	XEvent ev;
	static struct timeval tv;

	SetThreadName("X11 Events");
	if(video_init()) {
		sem_post(&init_complete);
		return;
	}
	x11_initialized=1;
	sem_post(&init_complete);

	if(local_pipe[0] > xfd)
		high_fd=local_pipe[0];
	else
		high_fd=xfd;

	for (;;) {
		tv.tv_sec=0;
		tv.tv_usec=54925; /* was 54925 (was also 10) */ 

		/*
		 * Handle any events just sitting around...
		 */
		while (QLength(dpy) > 0) {
			x11.XNextEvent(dpy, &ev);
			x11_event(&ev);
		}

		FD_ZERO(&fdset);
		FD_SET(xfd, &fdset);
		FD_SET(local_pipe[0], &fdset);

		x = select(high_fd+1, &fdset, 0, 0, &tv);

		switch (x) {
			case -1:
				/*
				* Errno might be wrong, so we just select again.
				* This could cause a problem is something really
				* was wrong with select....
				*/

				/* perror("select"); */
				break;
			case 0:
				/* Timeout */
				break;
			default:
				if (FD_ISSET(xfd, &fdset)) {
					x11.XNextEvent(dpy, &ev);
					x11_event(&ev);
				}
				while(FD_ISSET(local_pipe[0], &fdset)) {
					struct x11_local_event lev;

					read(local_pipe[0], &lev, sizeof(lev));
					switch(lev.type) {
						case X11_LOCAL_SETMODE:
							init_mode(lev.data.mode);
							break;
						case X11_LOCAL_SETNAME:
							x11.XSetIconName(dpy, win, lev.data.name);
							x11.XFlush(dpy);
							break;
						case X11_LOCAL_SETTITLE:
							x11.XStoreName(dpy, win, lev.data.title);
							x11.XFlush(dpy);
							break;
						case X11_LOCAL_COPY:
							x11.XSetSelectionOwner(dpy, CONSOLE_CLIPBOARD, win, CurrentTime);
							break;
						case X11_LOCAL_PASTE: 
							{
								Window sowner=None;

								sowner=x11.XGetSelectionOwner(dpy, CONSOLE_CLIPBOARD);
								if(sowner==win) {
									/* Get your own primary selection */
									if(copybuf==NULL)
										pastebuf=NULL;
									else
										pastebuf=strdup(copybuf);
									/* Set paste buffer */
									sem_post(&pastebuf_set);
									sem_wait(&pastebuf_used);
									FREE_AND_NULL(pastebuf);
								}
								else if(sowner!=None) {
									x11.XConvertSelection(dpy, CONSOLE_CLIPBOARD, XA_STRING, XA_STRING, win, CurrentTime);
								}
								else {
									/* Set paste buffer */
									pastebuf=NULL;
									sem_post(&pastebuf_set);
									sem_wait(&pastebuf_used);
								}
							}
							break;
						case X11_LOCAL_DRAWRECT:
							local_draw_rect(&lev.data.rect);
							break;
						case X11_LOCAL_FLUSH:
							x11.XFlush(dpy);
							break;
						case X11_LOCAL_BEEP:
							x11.XBell(dpy, 100);
							break;
					}
					tv.tv_sec=0;
					tv.tv_usec=0;

					FD_ZERO(&fdset);
					FD_SET(local_pipe[0], &fdset);

					if(select(local_pipe[0]+1, &fdset, 0, 0, &tv)!=1)
						FD_ZERO(&fdset);
				}
		}
	}
}
Exemple #14
0
bool BsplineJastrowBuilder::put(xmlNodePtr cur)
{
    ReportEngine PRE(ClassName,"put(xmlNodePtr)");
    bool PrintTables=false;
    typedef BsplineFunctor<RealType> RadFuncType;
    // Create a one-body Jastrow
    if (sourcePtcl)
    {
        string j1spin("no");
        OhmmsAttributeSet jAttrib;
        jAttrib.add(j1spin,"spin");
        jAttrib.put(cur);
#ifdef QMC_CUDA
        return createOneBodyJastrow<OneBodyJastrowOrbitalBspline,DiffOneBodySpinJastrowOrbital<RadFuncType> >(cur);
#else
        //if(sourcePtcl->IsGrouped)
        //{
        //  app_log() << "Creating OneBodySpinJastrowOrbital<T> " << endl;
        //  return createOneBodyJastrow<OneBodySpinJastrowOrbital<RadFuncType>,DiffOneBodySpinJastrowOrbital<RadFuncType> >(cur);
        //}
        //else
        //{
        //  app_log() << "Creating OneBodyJastrowOrbital<T> " << endl;
        //  return createOneBodyJastrow<OneBodyJastrowOrbital<RadFuncType>,DiffOneBodyJastrowOrbital<RadFuncType> >(cur);
        //}
        if(j1spin=="yes")
            return createOneBodyJastrow<OneBodySpinJastrowOrbital<RadFuncType>,DiffOneBodySpinJastrowOrbital<RadFuncType> >(cur);
        else
            return createOneBodyJastrow<OneBodyJastrowOrbital<RadFuncType>,DiffOneBodyJastrowOrbital<RadFuncType> >(cur);
#endif
    }
    else // Create a two-body Jastrow
    {
        string init_mode("0");
        {
            OhmmsAttributeSet hAttrib;
            hAttrib.add(init_mode,"init");
            hAttrib.put(cur);
        }
        BsplineInitializer<RealType> j2Initializer;
        xmlNodePtr kids = cur->xmlChildrenNode;
#ifdef QMC_CUDA
        typedef TwoBodyJastrowOrbitalBspline J2Type;
#else
        typedef TwoBodyJastrowOrbital<BsplineFunctor<RealType> > J2Type;
#endif
        typedef DiffTwoBodyJastrowOrbital<BsplineFunctor<RealType> > dJ2Type;
        int taskid=(targetPsi.is_manager())?targetPsi.getGroupID():-1;
        J2Type *J2 = new J2Type(targetPtcl,taskid);
        dJ2Type *dJ2 = new dJ2Type(targetPtcl);
        SpeciesSet& species(targetPtcl.getSpeciesSet());
        int chargeInd=species.addAttribute("charge");
        //std::map<std::string,RadFuncType*> functorMap;
        bool Opt(false);
        while (kids != NULL)
        {
            std::string kidsname((const char*)kids->name);
            if (kidsname == "correlation")
            {
                OhmmsAttributeSet rAttrib;
                RealType cusp=-1e10;
                string pairType("0");
                string spA(species.speciesName[0]);
                string spB(species.speciesName[0]);
                rAttrib.add(spA,"speciesA");
                rAttrib.add(spB,"speciesB");
                rAttrib.add(pairType,"pairType");
                rAttrib.add(cusp,"cusp");
                rAttrib.put(kids);
                if(pairType[0]=='0')
                {
                    pairType=spA+spB;
                }
                else
                {
                    PRE.warning("pairType is deprecated. Use speciesA/speciesB");
                    //overwrite the species
                    spA=pairType[0];
                    spB=pairType[1];
                }
                int ia = species.findSpecies(spA);
                int ib = species.findSpecies(spB);
                if(ia==species.size() || ib == species.size())
                {
                    PRE.error("Failed. Species are incorrect.",true);
                }
                if(cusp<-1e6)
                {
                    RealType qq=species(chargeInd,ia)*species(chargeInd,ib);
                    cusp = (ia==ib)? -0.25*qq:-0.5*qq;
                }
                app_log() << "  BsplineJastrowBuilder adds a functor with cusp = " << cusp << endl;
                RadFuncType *functor = new RadFuncType(cusp);
                functor->cutoff_radius = targetPtcl.Lattice.WignerSeitzRadius;
                bool initialized_p=functor->put(kids);
                functor->elementType=pairType;
                if (functor->cutoff_radius < 1.0e-6)
                {
                    app_log()  << "  BsplineFunction rcut is currently zero.\n"
                               << "  Setting to Wigner-Seitz radius = "
                               << targetPtcl.Lattice.WignerSeitzRadius << endl;
                    functor->cutoff_radius = targetPtcl.Lattice.WignerSeitzRadius;
                    functor->reset();
                }
                //RPA INIT
                if(!initialized_p && init_mode =="rpa")
                {
                    app_log() << "  Initializing Two-Body with RPA Jastrow " << endl;
                    j2Initializer.initWithRPA(targetPtcl,*functor,-cusp/0.5);
                }
                J2->addFunc(ia,ib,functor);
                dJ2->addFunc(ia,ib,functor);
                Opt=(!functor->notOpt or Opt);
                if(qmc_common.io_node)
                {
                    char fname[32];
                    if(qmc_common.mpi_groups>1)
                        sprintf(fname,"J2.%s.g%03d.dat",pairType.c_str(),taskid);
                    else
                        sprintf(fname,"J2.%s.dat",pairType.c_str());
                    functor->setReportLevel(ReportLevel,fname);
                    functor->print();
                }
            }
            kids = kids->next;
        }
        //dJ2->initialize();
        //J2->setDiffOrbital(dJ2);
        J2->dPsi=dJ2;
        targetPsi.addOrbital(J2,"J2_bspline");
        J2->setOptimizable(Opt);
    }
    return true;
}