//------------------------------------------------------------- // envelope detector //------------------------------------------------------------- EnvelopeDetector::EnvelopeDetector( double ms, double sampleRate ) { assert( sampleRate > 0.0 ); assert( ms > 0.0 ); sampleRate_ = sampleRate; ms_ = ms; setCoef(); }
//------------------------------------------------------------- // envelope detector //------------------------------------------------------------- EnvelopeDetector::EnvelopeDetector( float ms, float sampleRate ) { assert( sampleRate > 0.0 ); assert( ms > 0.0 ); sampleRate_ = sampleRate; ms_ = ms; setCoef(); }
void ControllerFadeAlpha::setProperty(const std::string& _key, const std::string& _value) { if (_key == "Alpha") setAlpha(utility::parseValue<float>(_value)); else if (_key == "Coef") setCoef(utility::parseValue<float>(_value)); else if (_key == "Enabled") setEnabled(utility::parseValue<bool>(_value)); }
RallyInfo::RallyInfo(std::string startGame, std::string endGame, int time, int realTime, double startCredit, double playerBet, double playerWin, double coef) { setStartGame(startGame); setEndGame(endGame); setTime(time); setRealTime(realTime); setStartCredit(startCredit); setPlayerBet(playerBet); setPlayerWin(playerWin); setCoef(coef); }
// FONCTIONS void MatConvo::allouerMem(int tailleFiltre, int coefficient) { setTFiltre(tailleFiltre); setCoef(coefficient); this->mat1 = new int[this->tFiltre]; this->mat2 = new int*[this->tFiltre]; for (int i=0 ; i<this->tFiltre ; i++) { this->mat2[i] = new int[this->tFiltre]; } }
/* * *************************************************************************** * Routine: init_3DP1 * * Purpose: 3D linear master simplex information generator * * Author: Michael Holst * *************************************************************************** */ VPRIVATE void init_3DP1(int dimIS[], int *ndof, int dof[], double c[][VMAXP], double cx[][VMAXP], double cy[][VMAXP], double cz[][VMAXP]) { int i; /* dof number and locations */ dof[0] = 1; dof[1] = 0; dof[2] = 0; dof[3] = 0; *ndof = 0; for (i=0; i<4; i++) *ndof += dimIS[i] * dof[i]; VASSERT( *ndof == dim_3DP1 ); VASSERT( *ndof <= VMAXP ); /* coefficients of the polynomials */ setCoef( *ndof, c, cx, cy, cz, lgr_3DP1, lgr_3DP1x, lgr_3DP1y, lgr_3DP1z ); }
//------------------------------------------------------------- void EnvelopeDetector::setSampleRate( double sampleRate ) { assert( sampleRate > 0.0 ); sampleRate_ = sampleRate; setCoef(); }
//------------------------------------------------------------- void EnvelopeDetector::setTc( double ms ) { assert( ms > 0.0 ); ms_ = ms; setCoef(); }
void PressureCoefficientPoint::read(Reader &input) { setAzm(input.readNumber<std::string>()); setCoef(input.readNumber<std::string>()); }
PressureCoefficientPoint::PressureCoefficientPoint(std::string azm,std::string coef) { setDefaults(); setAzm(azm); setCoef(coef); }
PressureCoefficientPoint::PressureCoefficientPoint(double azm,double coef) { setDefaults(); setAzm(azm); setCoef(coef); }
bool isFeasible() { int nCons; int coef1[MAXNEDGES], coef2[MAXNEDGES]; int ind[MAXNEDGES+1]; double val[MAXNEDGES+1]; glp_prob * lp = glp_create_prob(); glp_set_obj_dir(lp, GLP_MAX); glp_add_cols(lp, nEdges+1); for (int i=0; i<nEdges+1; i++) glp_set_col_bnds(lp, i+1, GLP_LO, 0, 0); glp_set_obj_coef(lp, nEdges+1, 1); nCons = 0; for (int i=0; i<nEdges; i++) { nCons++; glp_add_rows(lp,1); glp_set_row_bnds(lp, nCons, GLP_UP, 0, 0); ind[1] = nEdges+1; val[1] = 1; //gamma <= l_e ind[2] = i+1; val[2] = -1; glp_set_mat_row(lp, nCons, 2, ind, val); } for (int m=0; m<k; m++) { int first = -1; for (int i=0; i<paths[m].n; i++) if (paths[m].isShort[i]) { first = i; break; } assert(first>=0); setCoef(coef1, m, first); for (int i=first+1; i<paths[m].n; i++) if (paths[m].isShort[i]) { setCoef(coef2, m, i); nCons++; glp_add_rows(lp,1); glp_set_row_bnds(lp, nCons, GLP_FX, 0, 0); int nEle = 0; for (int j=0; j<nEdges; j++) if (coef1[j] ^ coef2[j]) { nEle++; ind[nEle] = j+1; val[nEle] = (coef1[j])? 1:-1; } glp_set_mat_row(lp, nCons, nEle, ind, val); } for (int i=0; i<paths[m].n; i++) if (!paths[m].isShort[i]){ setCoef(coef2, m, i); nCons++; glp_add_rows(lp,1); glp_set_row_bnds(lp, nCons, GLP_UP, 0, 0); int nEle = 0; for (int j=0; j<nEdges; j++) if (coef1[j] ^ coef2[j]) { nEle++; ind[nEle] = j+1; val[nEle] = (coef1[j])? 1:-1; } glp_set_mat_row(lp, nCons, nEle, ind, val); } } nCons++; glp_add_rows(lp,1); glp_set_row_bnds(lp, nCons, GLP_UP, 0, 1); for (int j=0; j<nEdges; j++) { ind[j+1] = j+1; val[j+1] = 1; } glp_set_mat_row(lp, nCons, nEdges, ind, val); glp_term_out(GLP_OFF); glp_simplex(lp, NULL); double ret = glp_get_obj_val(lp); glp_delete_prob(lp); return (ret>0); }