コード例 #1
0
ファイル: unipoly.C プロジェクト: SALAM2016/orbiter
void unipoly::singer_candidate(INT p, INT f, INT b, INT a)
{
	m_l(f + 1);
	s_i(f).one();
	s_i(f - 1).one();
	s_i(1).m_i_i(b);
	s_i(0).m_i_i(a);
}
コード例 #2
0
ファイル: number_partition.C プロジェクト: SALAM2016/orbiter
void number_partition::first(INT n)
{
	// cout << "number_partition::first()\n";
	allocate_number_partition();
	s_type() = PARTITION_TYPE_EXPONENT;
	m_l(n);
	s_i(n - 1) = 1;
}
コード例 #3
0
ファイル: LEP2sigmaMu.cpp プロジェクト: shehu0/HEPfit
double LEP2sigmaMu::computeThValue() 
{ 
    Mw = SM.Mw(); 
    GammaZ = SM.Gamma_Z();

    if (!checkSMparams(s, Mw, GammaZ)) {
        ml_cache = m_l(SM.MU);
        
        if (!flag[ISR])
            SMresult_cache = sigma_NoISR_l();
        else {
            ROOT::Math::Functor1D wf(this, &LEP2sigmaMu::Integrand_sigmaWithISR_l);
            ROOT::Math::Integrator ig(wf, ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR);
            ig.SetAbsTolerance(1.E-14); // desired absolute error
            ig.SetRelTolerance(1.E-4); // desired relative error
            SMresult_cache = ig.Integral(0.0, 1.0-0.85*0.85); // interval
            /* check
             MathMore library is required to use kADAPTIVESINGULAR. */
            //std::cout << ig.Options().Integrator() << std::endl;
            //std::cout << ig.Options().AbsTolerance() << std::endl;
            //std::cout << ig.Options().RelTolerance() << std::endl;
            //std::cout << SMresult_cache << " +- " << ig.Error() << std::endl;
            // results: 6.8e-9 -- 2.2e-8
        }
        
        if (flag[WeakBox]) {
            ROOT::Math::Functor1D wf_box(this, &LEP2sigmaMu::Integrand_dsigmaBox_l);
            ROOT::Math::Integrator ig_box(wf_box, ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR);
            ig_box.SetAbsTolerance(1.E-17); // desired absolute error
            ig_box.SetRelTolerance(1.E-4); // desired relative error
            double sigma_box = ig_box.Integral(-1.0, 1.0); // interval
            SMresult_cache += sigma_box;
            //std::cout << sigma_box << " +- " << ig_box.Error() << std::endl;
            // results: 3.5e-12 -- +2.9e-10
        }
    }
    double sigma_mu = SMresult_cache;
    
    #ifdef LEP2TEST
    sigma_mu = myTEST.sigmaMuTEST(sqrt_s)/SM.GeVminus2_to_nb/1000.0;
    #endif 
    
    if ( checkLEP2NP() && !bSigmaForAFB ) {
        double obliqueShat = (dynamic_cast<const NPSTUVWXY*> (&SM))->obliqueShat();
        double obliqueThat = (dynamic_cast<const NPSTUVWXY*> (&SM))->obliqueThat();
        double obliqueUhat = (dynamic_cast<const NPSTUVWXY*> (&SM))->obliqueUhat();
        double obliqueV = (dynamic_cast<const NPSTUVWXY*> (&SM))->obliqueV();
        double obliqueW = (dynamic_cast<const NPSTUVWXY*> (&SM))->obliqueW();
        double obliqueX = (dynamic_cast<const NPSTUVWXY*> (&SM))->obliqueX();
        double obliqueY = (dynamic_cast<const NPSTUVWXY*> (&SM))->obliqueY();
        double ObParam[7] = {obliqueShat, obliqueThat, obliqueUhat,
                             obliqueV, obliqueW, obliqueX, obliqueY};
        sigma_mu += myLEP2oblique.sigma_l_LEP2_NP(StandardModel::MU, s, ml_cache, ObParam);
    }

    return ( sigma_mu*SM.GeVminus2_to_nb*1000.0 );
}
コード例 #4
0
ファイル: main.c プロジェクト: RT-CUSTOMZ/ucrobot
int main(void)
{
	//Hier wird alles initialisiert, dh Grundeinstellungen festgelegt
	
	init_Motor();				//Motor einstellen
	init_system_tick();			//System Tick einstellen
	init_drehzahlsensor();		//Drehzahlsensor einstellen
	init_leds();				//LEDs einstellen
	init_hupe();				//Hupe einstellen
	sei();						//Alle Interrupts einschalten
    
	
	while(1)		//Alles innerhalb der while Schleife wird immer wieder wiederholt
    {	
		
		if (~PINB & 0x01)			//Wenn der invertierte Wert des ersten Bits in PINB 1 ist, dann (also wenn der Button gedrückt wird)
		{
			led1(AN);				//Mach die LEDs 1 und 3 an
			led3(AN);
			m_r(255,0);				//Und die Motoren mit Vollgas (255) in 2 Richtungen
			m_l(255,1);
			_delay_ms(500);			//Warte 500 ms
			led1(AUS);				//LEDs 1 und 3 aus, LEDs 2 und 4 an
			led3(AUS);
			led2(AN);
			led4(AN);
			m_r(255,1);				//Richtungen ändern
			m_l(255,0);
			_delay_ms(500);			//und wieder 500ms in die andere Richtung
			m_r(0,0);				//Motoren aus
			m_l(0,0);
			led2(AUS);				//Leds aus
			led4(AUS);
			hupe(AN);				//Hupe an
			_delay_ms(1000);		//1 s warten
			hupe(AUS);				//Hupe aus
			_delay_ms(300);			//300ms warten
			hupe(AN);				//Hupe an
			_delay_ms(500);			//warte 500 ms
			hupe(AUS);				//Hupe aus
		}							//wieder nach oben
	}
}
コード例 #5
0
ファイル: unipoly.C プロジェクト: SALAM2016/orbiter
void unipoly::x_to_the_i(INT i)
{
	INT j;
	
	m_l(i + 1);
	for (j = 0; j < i; j++) {
		s_i(j).zero();
		}
	s_i(i).one();
}
コード例 #6
0
ファイル: unipoly.C プロジェクト: SALAM2016/orbiter
void unipoly::numeric_polynomial(INT n, INT q)
{
	Vector v;
	INT i, l;
	
	v.q_adic(n, q);
	l = v.s_l();
	m_l(l);
	for (i = 0; i < l; i++) {
		m_ii(i, v.s_ii(i));
		}
}
コード例 #7
0
ファイル: cubic_spline.hpp プロジェクト: Ivanlh20/MULTEM
		void set_points(const TVector &x, const TVector &y)
		{
			assert(x.size() == y.size());
			assert(x.size()>2);
			int	n =static_cast<int>(x.size());

			m_x.assign(x.begin(), x.end());
			m_c0.assign(y.begin(), y.end());
			m_c1.resize(n);
			m_c2.resize(n);
			m_c3.resize(n);

			Vector<T, e_host> m_h(n);
			Vector<T, e_host> m_l(n);
			Vector<T, e_host> m_mu(n);
			Vector<T, e_host> m_z(n);

			n--;

			for(auto i = 0; i < n; i++)
			{
				m_h[i] = m_x[i+1]-m_x[i];
			}

			m_l[0] = 1;
			m_mu[0] = 0;
			m_z[0] = 0;

			for(auto i = 1; i < n; i++)
			{
				m_l[i] = 2*(m_x[i+1]-m_x[i-1])-m_h[i-1]*m_mu[i-1];
				m_mu[i] = m_h[i]/m_l[i];
				auto alpha = 3*(m_c0[i+1]-m_c0[i])/m_h[i]-3*(m_c0[i]-m_c0[i-1])/m_h[i-1];
				m_z[i] = (alpha-m_h[i-1]*m_z[i-1])/m_l[i];
			}

			m_l[n] = 1;
			m_z[n] = 0;
			m_c2[n] = 0;

			for(auto i =n-1; i >= 0; i--)
			{
				m_c2[i] = m_z[i] - m_mu[i]*m_c2[i+1];
				m_c1[i] = (m_c0[i+1]-m_c0[i])/m_h[i]-m_h[i]*(m_c2[i+1]+2*m_c2[i])/3;
				m_c3[i] = (m_c2[i+1]-m_c2[i])/(3*m_h[i]);
			}
		}
コード例 #8
0
ファイル: unipoly.C プロジェクト: SALAM2016/orbiter
void unipoly::x()
{
	m_l(2);
	s_i(0).zero();
	s_i(1).one();
}
コード例 #9
0
ファイル: unipoly.C プロジェクト: SALAM2016/orbiter
void unipoly::zero()
{
	m_l(1);
	s_i(0).zero();
}
コード例 #10
0
ファイル: unipoly.C プロジェクト: SALAM2016/orbiter
void unipoly::one()
{
	m_l(1);
	s_i(0).one();
}