Page MenuHomeHEPForge

ScannerSTools.h
No OneTemporary

ScannerSTools.h

#ifndef SCANNERSTOOLS_H
#define SCANNERSTOOLS_H
#include <istream>
#include <ostream>
#include <iostream>
#include <vector>
#include <fstream>
#include <gsl/gsl_rng.h>
class RandGen {
friend class Potential;
public:
friend std::ostream & operator<<(std::ostream &,RandGen &); //Output operator
RandGen(): seed(0),T(gsl_rng_ranlxs0) {r=gsl_rng_alloc(T);gsl_rng_set(r,seed);} //Default constructor using 0 seed
RandGen(unsigned int seedin): seed(seedin),T(gsl_rng_ranlxs0) {r=gsl_rng_alloc(T);gsl_rng_set(r,seed);} //Constructor with seed specification
double operator()(){return gsl_rng_uniform(r);} //Generate uniformly in [0:1]
double operator()(double a , double b){return a+gsl_rng_uniform(r)*(b-a);} // Generate uniformly in [a:b]
private:
const gsl_rng_type * T; //Variable to hold type of random number generator from gsl
const unsigned seed; //seed of the random number generator
gsl_rng * r; //pointer to random number generator
};
class VecTriplet {
public:
typedef std::vector<double>::size_type size_type;
typedef std::vector<double>::iterator iterator;
typedef std::vector<double>::const_iterator const_iterator;
friend std::istream & operator>>(std::istream & in, VecTriplet &); //Overloaded input operator to initialise
friend std::ostream & operator<<(std::ostream & os, const VecTriplet &); //Overloaded input operator to initialise
const std::vector<double> & vget()const{return Vec;}
const std::vector<double> & vgetmin()const{return Vecmin;}
const std::vector<double> & vgetmax()const{return Vecmax;}
double & operator[](size_type i){return Vec[i];}
double operator[](size_type i)const {return Vec[i];}
//double vget(size_type i)const{return Vec[i];}
double vgetmin(size_type i)const{return Vecmin[i];}
double vgetmax(size_type i)const{return Vecmax[i];}
double & vmin(size_type i){return Vecmin[i];}
double & vmax(size_type i){return Vecmax[i];}
size_type size() const{return Vec.size();}
protected:
std::vector<double> Vec; //vector to hold the point in field/vev space
std::vector<double> Vecmin; //vector to hold lower limit for the scan
std::vector<double> Vecmax; //vector to hold upper limit for the scan
};
class Monomial{
public:
typedef std::vector<int>::size_type size_type;
typedef std::vector<int>::iterator iterator;
typedef std::vector<int>::const_iterator const_iterator;
Monomial(size_type dim):pows(dim,0){}
friend std::istream & operator>>(std::istream & in, Monomial & M); //Overloaded input operator to initialise
friend std::ostream & operator<<(std::ostream & os, const Monomial & M); //Overloaded input operator to initialise
double coeff_get()const{return coeff;}
int operator[](size_type i)const {return pows[i];}
size_type size()const{pows.size();}
private:
double coeff;
std::vector<int> pows;
};
#endif

File Metadata

Mime Type
text/x-c++
Expires
Sat, Dec 21, 12:37 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3844420
Default Alt Text
ScannerSTools.h (2 KB)

Event Timeline