Filter::Filter(void)
{
  m_resonance = ONE_OVER_SQRT2;
  m_r2 = 1/m_resonance;
  m_h = 0.5f;
  m_c_low=m_c_band=m_c_high=0.0f;
#ifdef VSTI
  m_samplerate = SAMPLERATE;
#endif
  m_base_freq=0.0f;
  m_mod=0.0f;
  m_staticmod=0.0f;
  m_bandwidth=2.0f;
  setMode(0.0f);
  setCutoff(0.5f);
  setMod(0.0f,0.0f);
  setBandwidth(2.0f);
  setDrive(0.0f);
  m_staticmod = 0.0f;
  setOutputLevel(1.0f);
  m_cutoff = 0.0f;
  calculateCoefficients();
  m_calc_coefficients = false;
  m_calc_interval = STATE_CALC_INTERVAL;
  reset(); 
}
Ejemplo n.º 2
0
void BranchAcceptor::load(istream &is)
{
  double cutoff;
  Strand strand;
  SignalType signalType;
  BOOM::String p;
  int consensusOffset;
  is >> signalType;
  is >> p; 
  cutoff=p.asDouble();
  is >> strand;
  is >> consensusOffset;
  setSignalType(signalType);
  setStrand(strand);
  setCutoff(cutoff);

  BOOM::String dummy;
  is>>dummy; // will always be "WWAM"
  branchPoint=new WWAM(getGC(),is);
  is>>dummy; // will always be "WAM"
  acceptor=new WAM(getGC(),is);

  int contextWindowLength=branchPoint->getContextWindowLength()+
    acceptor->getContextWindowLength();
  setSizes(2,consensusOffset,contextWindowLength);
}
Ejemplo n.º 3
0
Light::Light(LIGHT_TYPE type)
{
    lights.push_back(this);

    if(availableLights.size() > 0)
    {
        lightNum = availableLights[0];
        availableLights.erase(availableLights.begin());
        Visible(true);
        setLightType(type);
        setPosition(0, 0, 0);
        setCutoff(45);
        setExponent(12);
        setSpotDirection(0, -1, 0);
        setAmbient(0, 0, 0, 1);
        setDiffuse(1, 1, 1, 1);
        setSpecular(1, 1, 1, 1);

        updateLight();
    }

    else
    {
        lightNum = 0;
        Visible(false);
    }
}
Ejemplo n.º 4
0
      FENE(real _K, real _r0, real _rMax, 
		   real _cutoff)
        : K(_K), r0(_r0), rMax(_rMax) {	
        autoShift = false;
        setCutoff(_cutoff);
        setAutoShift(); 
      }
Ejemplo n.º 5
0
      VSpherePair(real _epsilon, real _cutoff)
	: epsilon(_epsilon) {
        autoShift = false;
        setCutoff(_cutoff);
        preset();
        setAutoShift(); 
      }
      LennardJonesCapped(real _epsilon, real _sigma,
		   real _cutoff, real _caprad, real _shift)
	: epsilon(_epsilon), sigma(_sigma), caprad(_caprad) {
        setShift(_shift);
        setCutoff(_cutoff);
        preset();
      }
Ejemplo n.º 7
0
      FENECapped(real _K, real _r0, real _rMax,
		   real _cutoff, real _caprad)
        : K(_K), r0(_r0), rMax(_rMax), caprad(_caprad) {
        autoShift = false;
        setCutoff(_cutoff);
        setAutoShift(); 
      }
 ReactionFieldGeneralized()
 : prefactor(1), kappa(0.0),
  epsilon1(1.0), epsilon2(80.0),
  rc(1.0){
     setShift(0.0);
     setCutoff(infinity);
     initialize();
 }
Ejemplo n.º 9
0
Light::Light(int number, Vector pos, Vector dir, float cutoff, float exponent) {
	setNumber(number);
	this->pos = pos;
	this->dir = dir;
	setCutoff(cutoff);
	setExponent(exponent);
	initAttenuation();
}
      LennardJonesCapped(real _epsilon, real _sigma,
		   real _cutoff, real _caprad)
	: epsilon(_epsilon), sigma(_sigma), caprad(_caprad) {
        autoShift = false;
        setCutoff(_cutoff);
        preset();
        setAutoShift(); 
      }
 ReactionFieldGeneralizedTI()
 : prefactor(0.0), kappa(0.0),
  epsilon1(1.0), epsilon2(80.0),
  rc(1.0), lambdaTI(0.0), annihilate(1) {
     setShift(0.0);
     autoShift = false;
     setCutoff(infinity);
     initialize();
 }
Ejemplo n.º 12
0
void PBSynthFilter::reset() {
	
	int i;

	for (i = 0; i < 4; i++)
		xbuffer[i] = ybuffer[i] = 0;
		
	setCutoff(1.0f, -1.0f);
}
Ejemplo n.º 13
0
Light::Light(int number, Vector pos, Vector dir, float* attenuation, float cutoff, float exponent) {
	setNumber(number);
	this->pos = pos;
	this->dir = dir;
	setAttenuation(0, attenuation[0]);
	setAttenuation(1, attenuation[1]);
	setAttenuation(2, attenuation[2]);
	setCutoff(cutoff);
	setExponent(exponent);
}
                ReactionFieldGeneralized(   
                        real _prefactor,
                        real _kappa,
                        real _eps1,
                        real _eps2,
                        real _cutoff,
                        real _shift)
                : prefactor(_prefactor),kappa(_kappa),
                  epsilon1(_eps1), epsilon2(_eps2),
                  rc(_cutoff) {
                    setShift(_shift);//setShift(_shift);
                    setCutoff(_cutoff);

                    initialize();
                }
 ReactionFieldGeneralized(
         real _prefactor,
         real _kappa,
         real _eps1,
         real _eps2,
         real _cutoff)
 : prefactor(_prefactor), kappa(_kappa),
   epsilon1(_eps1), epsilon2(_eps2),
   rc(_cutoff) {
     autoShift = false;
     setCutoff(_cutoff);
     /*Note: AutoShift cannot be used here since the shift
      *  has to depend on the product of charges */
     //setAutoShift();                 
     initialize();
 }
Ejemplo n.º 16
0
// Drag/move curve.
void samplv1widget_filt::dragCurve ( const QPoint& pos )
{
	const int h  = height();
	const int w  = width();

	const int dx = (pos.x() - m_posDrag.x());
	const int dy = (pos.y() - m_posDrag.y());

	if (dx || dy) {
		const int h2 = (h >> 1);
		const int x = int(cutoff() * float(w));
		const int y = int(reso() * float(h2));
		setCutoff(float(x + dx) / float(w));
		setReso(float(y - dy) / float(h2));
		m_posDrag = pos;
	}
}
 ReactionFieldGeneralizedTI(   
         real _prefactor,
         real _kappa,
         real _eps1,
         real _eps2,
         real _cutoff,
         real _lambdaTI,
         bool _annihilate)
 : prefactor(_prefactor),kappa(_kappa),
   epsilon1(_eps1), epsilon2(_eps2),
   rc(_cutoff), lambdaTI(_lambdaTI), 
   annihilate(_annihilate) {
     setShift(0.0);
     autoShift = false;
     /*Note: AutoShift cannot be used here since the shift
      *  has to depend on the product of charges */
     setCutoff(_cutoff);
     initialize();
 }
Ejemplo n.º 18
0
bool
DcModel::setBestSolution(DC_Message how,
			  double & objectiveValue,
			  const double * solution,
			  bool fixVariables)
{
    double cutoff = getCutoff();
    // Double check the solution to catch pretenders.
    if (objectiveValue >= cutoff) {  // Bad news
	if (objectiveValue > 1.0e30)
	    handler_->message(DC_NOTFEAS1, messages_) << CoinMessageEol;
	else
	    handler_->message(DC_NOTFEAS2, messages_)
		<< objectiveValue << cutoff << CoinMessageEol;
	return false;
    }
    else {  // Better solution
	bestObjective_ = objectiveValue;
	int numberColumns = solver_->getNumCols();
	if (bestSolution_ == 0) {
	    bestSolution_ = new double[numberColumns];
	}

	memcpy(bestSolution_, solution, numberColumns*sizeof(double));
	cutoff = bestObjective_ - dblParam_[DcCutoffIncrement];
	setCutoff(cutoff);

	if (how == DC_ROUNDING)
	    numberHeuristicSolutions_++;
	numberSolutions_++;
//	std::cout << "cutoff = " << getCutoff()
//		  << "; objVal = " << bestObjective_
//		  << "; cutoffInc = " << dblParam_[DcCutoffIncrement]
//		  << std::endl;

	handler_->message(how, messages_)
	    << bestObjective_ << numberIterations_
	    << numberNodes_
	    << CoinMessageEol;

	return true;
    }
}
Ejemplo n.º 19
0
void Light::setLightType(LIGHT_TYPE type)
{
    lightType = type;

    if(lightType == LIGHT_SPOT)
    {
        position[3] = 1.0f;
    }
    else if (lightType == LIGHT_POINT)
    {
        position[3] = 1.0f;
        setCutoff(180.0f);
    }
    else if(lightType == LIGHT_DIRECTIONAL)
    {
        position[3] = 0.0f;
    }

    updateLight();
}
      LennardJonesCapped()
	: epsilon(0.0), sigma(0.0) {
        setShift(0.0);
        setCutoff(infinity);
        preset();
      }
Ejemplo n.º 21
0
 FENECapped()
   : K(0.0), r0(0.0), rMax(0.0), caprad(0.0) {
   setShift(0.0);
   setCutoff(infinity);
 }
Ejemplo n.º 22
0
 FENE()
   : K(0.0), r0(0.0), rMax(0.0) {
   setShift(0.0);
   setCutoff(infinity);
 }
Ejemplo n.º 23
0
void PBSynthFilter::setParameters(void *p) {
	
	memcpy(&parameters, p, sizeof(parameters));
	setCutoff(parameters.cutoff, parameters.resonance);
}
Ejemplo n.º 24
0
      VSpherePair()
	: epsilon(0.0) {
        setShift(0.0);
        setCutoff(infinity);
        preset();
      }
Ejemplo n.º 25
0
      FENE(real _K, real _r0, real _rMax, 
		   real _cutoff, real _shift) 
        : K(_K), r0(_r0), rMax(_rMax) {
        setShift(_shift);
        setCutoff(_cutoff);
      }
Ejemplo n.º 26
0
void Light::modifyCutoff(float cutoff) {
	setCutoff(this->cutoff + cutoff);
}
Ejemplo n.º 27
0
void AnalysisDialog::createResultsAnalysis() {
    QVBoxLayout* resultsAnalysisLayout = new QVBoxLayout();
    QGridLayout* resultsTopLayout = new QGridLayout();
    QGridLayout* resultsBottomLayout = new QGridLayout();

    thresholdEdit = new QLineEdit(this);
    thresholdEdit ->setText(QString::number( 0 ));
    thresholdEdit->setValidator( new QDoubleValidator(thresholdEdit) );
    connect(thresholdEdit, SIGNAL(textChanged(QString)), this, SLOT(updateResultsAnalysis()));

    QPushButton* defaultThresholdButton = new QPushButton("Default");
    connect(defaultThresholdButton, SIGNAL(clicked()), this, SLOT(reset_epi_threshold()));

    allNEdit      = new QLineEdit(this);
    allMinEdit    = new QLineEdit(this);
    allMaxEdit    = new QLineEdit(this);
    allMeanEdit   = new QLineEdit(this);
    allSDEdit     = new QLineEdit(this);

    outNEdit      = new QLineEdit(this);
    outMinEdit    = new QLineEdit(this);
    outMaxEdit    = new QLineEdit(this);
    outMeanEdit   = new QLineEdit(this);
    outSDEdit     = new QLineEdit(this);

    epiNEdit      = new QLineEdit(this);
    epiMinEdit    = new QLineEdit(this);
    epiMaxEdit    = new QLineEdit(this);
    epiMeanEdit   = new QLineEdit(this);
    epiSDEdit     = new QLineEdit(this);
     
    QLabel* thresholdLabel = new QLabel("Outbreak/epidemic threshold:", this);
    resultsTopLayout->addWidget(thresholdLabel, 1, 0, 1, 2); 
    resultsTopLayout->addWidget(thresholdEdit, 1, 2); 
    resultsTopLayout->addWidget(defaultThresholdButton, 1, 3); 

    QLabel* allLabel = new QLabel("All simulations", this);
    QLabel* outLabel = new QLabel("Outbreaks only", this);
    QLabel* epiLabel = new QLabel("Epidemics only", this);

    resultsTopLayout->addWidget(allLabel,   2, 1);
    resultsTopLayout->addWidget(outLabel,   2, 2);
    resultsTopLayout->addWidget(epiLabel,   2, 3);

    _addResultsAnalysisRow(resultsTopLayout, "N",     allNEdit,    outNEdit,    epiNEdit);
    _addResultsAnalysisRow(resultsTopLayout, "Min" ,  allMinEdit,  outMinEdit,  epiMinEdit);
    _addResultsAnalysisRow(resultsTopLayout, "Max" ,  allMaxEdit,  outMaxEdit,  epiMaxEdit);
    _addResultsAnalysisRow(resultsTopLayout, "Mean" , allMeanEdit, outMeanEdit, epiMeanEdit);
    _addResultsAnalysisRow(resultsTopLayout, "SD" ,   allSDEdit,   outSDEdit,   epiSDEdit);

    QGroupBox* resultsAnalysisTop = new QGroupBox();
    resultsAnalysisTop->setLayout(resultsTopLayout);

    QLabel* nbins = new QLabel("Number of bins", this);
    QLabel* minRange = new QLabel("Range minimum", this);
    QLabel* maxRange = new QLabel("Range maximum", this);

    resultsBottomLayout->addWidget(nbins,    1, 0);
    resultsBottomLayout->addWidget(minRange, 1, 1);
    resultsBottomLayout->addWidget(maxRange, 1, 2);

    QLineEdit* nbinsLineEdit = new QLineEdit(this);
    QLineEdit* minRangeLineEdit = new QLineEdit(this);
    QLineEdit* maxRangeLineEdit = new QLineEdit(this);

    resultsBottomLayout->addWidget(nbinsLineEdit,    2, 0);
    resultsBottomLayout->addWidget(minRangeLineEdit, 2, 1);
    resultsBottomLayout->addWidget(maxRangeLineEdit, 2, 2);

    QGroupBox* resultsAnalysisBottom = new QGroupBox();
    resultsAnalysisBottom->setLayout(resultsBottomLayout);
    
    resultsHistPlot = new PlotView(this, "Epidemic size distribution", "Epidemic size", "Frequency");
    resultsHistPlot->setPlotType(PlotView::RESULTS_HISTPLOT);
    
    connect(thresholdEdit, SIGNAL(textChanged(QString)), resultsHistPlot, SLOT(setCutoff(QString)));
    connect(thresholdEdit, SIGNAL(textEdited(QString)), this, SLOT(setThresholdEdited()));
    connect(nbinsLineEdit, SIGNAL(textChanged(QString)), resultsHistPlot, SLOT(setNBins(QString)));
    connect(minRangeLineEdit, SIGNAL(textChanged(QString)), resultsHistPlot, SLOT(setRangeMin(QString)));
    connect(maxRangeLineEdit, SIGNAL(textChanged(QString)), resultsHistPlot, SLOT(setRangeMax(QString)));
    
    // add a close window button
    QPushButton* closeButton = new QPushButton("Close analysis", this);
    connect(closeButton,  SIGNAL(clicked()), this, SLOT(close()));
    QHBoxLayout* buttonBoxLayout   = new QHBoxLayout();
    QWidget* buttonBox = new QWidget();
    buttonBoxLayout->addStretch(1);
    buttonBoxLayout->addWidget(closeButton);
    buttonBox->setLayout(buttonBoxLayout);

    resultsAnalysisLayout->addWidget(resultsAnalysisTop);
    resultsAnalysisLayout->addWidget(resultsHistPlot);
    resultsAnalysisLayout->addWidget(resultsAnalysisBottom);
    resultsAnalysisLayout->addWidget(buttonBox);
    
    this->setLayout(resultsAnalysisLayout);
}
Ejemplo n.º 28
0
      VSpherePair(real _epsilon, real _cutoff, real _shift)
	: epsilon(_epsilon) {
        setShift(_shift);
        setCutoff(_cutoff);
        preset();
      }
Ejemplo n.º 29
0
 Quartic(real _K, real _r0,  real _cutoff) : K(_K), r0(_r0) {
   autoShift = false;
   setCutoff(_cutoff);
   setAutoShift();
 }
Ejemplo n.º 30
0
      FENECapped(real _K, real _r0, real _rMax,
		   real _cutoff, real _caprad, real _shift)
        : K(_K), r0(_r0), rMax(_rMax), caprad(_caprad) {
        setShift(_shift);
        setCutoff(_cutoff);
      }