您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ theta函数代码示例

51自学网 2021-06-03 08:48:01
  C++
这篇教程C++ theta函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中theta函数的典型用法代码示例。如果您正苦于以下问题:C++ theta函数的具体用法?C++ theta怎么用?C++ theta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了theta函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: noekeon_dec

void noekeon_dec(void *buffer, const void *key){	uint8_t rc;	int8_t i;	uint8_t nullv[16];	uint8_t dkey[16];		changendian(buffer);		memset(nullv, 0, 16);	memcpy(dkey, key, 16);	changendian(dkey);		theta((uint32_t*)nullv, (uint32_t*)dkey);//	cli_putstr_P(PSTR("/r/nTheta: "));//	cli_hexdump(dkey, 16);		for(i=ROUND_NR-1; i>=0; --i){#ifdef __AVR__		rc = pgm_read_byte(rc_tab+i);#else		rc = rc_tab[i];#endif		noekeon_round((uint32_t*)dkey, (uint32_t*)buffer, 0, rc);	}	theta((uint32_t*)dkey, (uint32_t*)buffer);	((uint8_t*)buffer)[RC_POS] ^= 0x80;	changendian(buffer);}
开发者ID:nerilex,项目名称:avr-crypto-lib,代码行数:30,


示例2: computeG_analytic

voidSpacetime::makeInitialGuess_analytic(void){    /// compute G, C, M, and MInv state matrices    matrix<double> G, C, M, MInv;    G = computeG_analytic();    M = computeM_analytic();    C = computeC_analytic();    MInv = !M;    // compute torque with PD controller    double Kp = 1.5, Kv = 1.5;    matrix<double> state = getState();    matrix<double> theta(2,1);    double theta1 = state(0,0);    double theta2 = state(1,0);    theta(0,0) = theta1;    theta(1,0) = theta2;    matrix<double> thetad(state_d);    thetad.SetSize(DOF*joints.size(), 1);    matrix<double> thetaDot(2,1);    thetaDot(0,0) = state(2,0);    thetaDot(1,0) = state(3,0);    matrix<double> u = C + G + M*(Kp*(thetad - theta) - Kv*thetaDot);    uSequence.push_back(u);    // apply torque and advance system    stepPhysics_analytic(u);}
开发者ID:flair2005,项目名称:Spacetime-Optimization-of-Articulated-Character-Motion,代码行数:33,


示例3: theta

/** Noekeon Encryption*/void Noekeon::encrypt_n(const byte in[], byte out[], size_t blocks) const   {   for(size_t i = 0; i != blocks; ++i)      {      u32bit A0 = load_be<u32bit>(in, 0);      u32bit A1 = load_be<u32bit>(in, 1);      u32bit A2 = load_be<u32bit>(in, 2);      u32bit A3 = load_be<u32bit>(in, 3);      for(size_t j = 0; j != 16; ++j)         {         A0 ^= RC[j];         theta(A0, A1, A2, A3, EK.data());         A1 = rotate_left(A1, 1);         A2 = rotate_left(A2, 5);         A3 = rotate_left(A3, 2);         gamma(A0, A1, A2, A3);         A1 = rotate_right(A1, 1);         A2 = rotate_right(A2, 5);         A3 = rotate_right(A3, 2);         }      A0 ^= RC[16];      theta(A0, A1, A2, A3, EK.data());      store_be(out, A0, A1, A2, A3);      in += BLOCK_SIZE;      out += BLOCK_SIZE;      }   }
开发者ID:Kampbell,项目名称:botan,代码行数:37,


示例4: group_velocity

static void group_velocity (int ik, int ith, FttVector * u, guint ntheta, gdouble g){  double cg = g/(4.*M_PI*frequency (ik));  u->x = cg*cos (theta (ith, ntheta));  u->y = cg*sin (theta (ith, ntheta));  u->z = 0.;}
开发者ID:Exteris,项目名称:Gerris,代码行数:7,


示例5: StrangerException

    TrifBank::TrifBank(float alpha, SizeType filterCount, SizeType fftSize, float sampleFreq, float minFreq, float maxFreq) {        float startFreq, endFreq;        int i;        float f, d, z;        endFreq = maxFreq;                if (filterCount == 0 || fftSize == 0 || sampleFreq <= 0 || minFreq < 0 || maxFreq < 0 ) {            throw StrangerException("Arguments have not valid size values");        }                mSize = filterCount;        mFftSize = fftSize;        mFilterBank.resize(mSize+2, 0);                if (endFreq <= 0) {            endFreq = 0.5;        }                mFilterBank[0] = (SizeType)Round(2 * minFreq * ((float)(fftSize / 2 - 1)));        mFilterBank[filterCount+1] = (SizeType)Round(2 * endFreq * (float)(fftSize / 2 - 1));                startFreq = (minFreq) ? theta(2.0 * M_PI * minFreq, alpha) : 0.0; /* pulses in transform domain */        endFreq = (endFreq < 0.5) ? theta(2.0 * M_PI * endFreq, alpha) : M_PI;        d = (endFreq - startFreq) / (float)(filterCount + 1);        z = (float)(fftSize / 2 - 1) / M_PI;        f = startFreq;        for(i = 1; i <= filterCount; i++) {            f += d;            mFilterBank[i] = (SizeType)Round(thetaInv(f, alpha) * z); /* index in the original domain */        }    }
开发者ID:rainlabs,项目名称:stranger,代码行数:33,


示例6: ConstructTheta

vector ConstructTheta(double cr, vector& c) {	vector theta(c.GetLength(),.0);	for(int i = 0; i < c.GetLength(); i++)		if(c(i) >= cr)			theta(i) = 1.0;	return theta;}
开发者ID:Andrew-AbiMansour,项目名称:Finite-Volume,代码行数:9,


示例7: main

int main(){  const int sz=7;    CArray A(sz);    A(0) = complex<float>(1,2);    A(1) = complex<float>(3,4);    Array<float,1> Ar = real(A);    BZTEST(int(Ar(0)) == 1 && int(Ar(1)) == 3);    Array<float,1> Ai = imag(A);    BZTEST(int(Ai(0)) == 2 && int(Ai(1)) == 4);    CArray Ac(sz);    Ac = conj(A);    BZTEST(Ac(0) == complex<float>(1,-2));    BZTEST(Ac(1) == complex<float>(3,-4));    Array<float,1> Ab(sz);    Ab = abs(A);    BZTEST(fabs(Ab(0) - 2.236068) < eps);    BZTEST(fabs(Ab(1) - 5.0) < eps);    Ab = arg(A);    BZTEST(fabs(Ab(0) - atan(2.0)) < eps);    BZTEST(fabs(Ab(1) - atan(4.0/3.0)) < eps);    Array<float,1> r(sz), theta(sz);    r(0) = 4.0f;    r(1) = 15.0f;    theta(0) = float(3.141592/3.0);    theta(1) = float(3.0*3.141592/2.0);    Ac = blitz::polar(r,theta);    BZTEST(fabs(real(Ac(0)) - 2) < eps);    BZTEST(fabs(imag(Ac(0)) - 3.4641012) < eps);    BZTEST(fabs(real(Ac(1)) - 0.0) < eps);    BZTEST(fabs(imag(Ac(1)) + 15.0) < eps);    Array<complex<long double>,1> A11(5),B11(5),C11(5);    A11=1,2,3,4,5;    B11=1,2,3,4,5;    C11=A11+B11;    BZTEST(fabs(real(C11(0)) - 2.) < eps);    C11=A11/B11;    BZTEST(fabs(real(C11(1)) - 1.) < eps);    C11=1.0l/A11;    BZTEST(fabs(real(C11(2)) - 1/3.) < eps);    C11=A11/1.0l;    BZTEST(fabs(real(C11(3)) - 4.) < eps);    C11=complex<long double>(0,1)/A11;    BZTEST(fabs(imag(C11(4)) - 1/5.) < eps);    C11=A11/complex<long double>(0,1);    BZTEST(fabs(imag(C11(0)) - -1.) < eps);    return 0;}
开发者ID:Albex,项目名称:Advanced_Architecture,代码行数:57,


示例8: accu

double SPF::update_theta(int user) {    double change = accu(abs(theta(user) - (a_theta(user) / b_theta(user))));    double total = accu(theta(user));    theta(user) = a_theta(user) / b_theta(user);    for (int k = 0; k < settings->k; k++)        logtheta(k, user) = gsl_sf_psi(a_theta(k, user));    logtheta(user) = logtheta(user) - log(b_theta(user));    return change / total;}
开发者ID:njuhugn,项目名称:spf,代码行数:11,


示例9: tau

void SPF::initialize_parameters() {    int user, neighbor, n, item, i, k;    if (!settings->factor_only) {        for (user = 0; user < data->user_count(); user++) {            // user influence            for (n = 0; n < data->neighbor_count(user); n++) {                neighbor = data->get_neighbor(user, n);                tau(neighbor, user) = 1.0;                logtau(neighbor, user) = log(1.0 + 1e-5);                double all = settings->b_tau;                for (i = 0; i < data->item_count(neighbor); i++) {                    item = data->get_item(neighbor, i);                    all += data->ratings(neighbor, item);                } //TODO: this doeesn't need to be done as much... only one time per user (U), not UxU times                b_tau(neighbor, user) = all;            }        }    }    if (!settings->social_only) {        // user preferences        for (user = 0; user < data->user_count(); user++) {            for (k = 0; k < settings->k; k++) {                theta(k, user) = (settings->a_theta +                                  gsl_rng_uniform_pos(rand_gen))                                 / (settings->b_theta);                logtheta(k, user) = log(theta(k, user));            }            theta.col(user) /= accu(theta.col(user));        }        // item attributes        for (item = 0; item < data->item_count(); item++) {            for (k = 0; k < settings->k; k++) {                beta(k, item) = (settings->a_beta +                                 gsl_rng_uniform_pos(rand_gen))                                / (settings->b_beta);                logbeta(k, item) = log(beta(k, item));            }            beta.col(item) /= accu(beta.col(item));        }    }    if (settings->item_bias) {        for (item = 0; item < data->item_count(); item++) {            delta(item) = data->popularity(item);        }    }}
开发者ID:njuhugn,项目名称:spf,代码行数:50,


示例10: verify_key_set

/** Noekeon Encryption*/void Noekeon::decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const   {   verify_key_set(m_DK.empty() == false);#if defined(BOTAN_HAS_NOEKEON_SIMD)   if(CPUID::has_simd_32())      {      while(blocks >= 4)         {         simd_decrypt_4(in, out);         in += 4 * BLOCK_SIZE;         out += 4 * BLOCK_SIZE;         blocks -= 4;         }      }#endif   for(size_t i = 0; i != blocks; ++i)      {      uint32_t A0 = load_be<uint32_t>(in, 0);      uint32_t A1 = load_be<uint32_t>(in, 1);      uint32_t A2 = load_be<uint32_t>(in, 2);      uint32_t A3 = load_be<uint32_t>(in, 3);      for(size_t j = 16; j != 0; --j)         {         theta(A0, A1, A2, A3, m_DK.data());         A0 ^= RC[j];         A1 = rotl<1>(A1);         A2 = rotl<5>(A2);         A3 = rotl<2>(A3);         gamma(A0, A1, A2, A3);         A1 = rotr<1>(A1);         A2 = rotr<5>(A2);         A3 = rotr<2>(A3);         }      theta(A0, A1, A2, A3, m_DK.data());      A0 ^= RC[0];      store_be(out, A0, A1, A2, A3);      in += BLOCK_SIZE;      out += BLOCK_SIZE;      }   }
开发者ID:mgierlings,项目名称:botan,代码行数:52,


示例11: main

int main(int argc, char ** argv){  if (argc < 3) {    std::cout << "Usage: " << argv[0] << " <no. of cones> <input filename> [<direction-x> <direction-y>]" << std::endl;    return 1;  }  unsigned int k = atoi(argv[1]);  if (k<2) {    std::cout << "The number of cones should be larger than 1!" << std::endl;    return 1;  }  // open the file containing the vertex list  std::ifstream inf(argv[2]);  if (!inf) {    std::cout << "Cannot open file " << argv[2] << "!" << std::endl;    return 1;  }  Direction_2 initial_direction;  if (argc == 3)    initial_direction = Direction_2(1, 0);  // default initial_direction  else if (argc == 5)    initial_direction = Direction_2(atof(argv[3]), atof(argv[4]));  else {    std::cout << "Usage: " << argv[0] << " <no. of cones> <input filename> [<direction-x> <direction-y>]" << std::endl;    return 1;  }  // iterators for reading the vertex list file  std::istream_iterator<Point_2> input_begin( inf );  std::istream_iterator<Point_2> input_end;  // initialize the functor  CGAL::Construct_theta_graph_2<Kernel, Graph> theta(k, initial_direction);  // create an adjacency_list object  Graph g;  // construct the theta graph on the vertex list  theta(input_begin, input_end, g);  // obtain the number of vertices in the constructed graph  boost::graph_traits<Graph>::vertices_size_type n = boost::num_vertices(g);  // generate gnuplot files for plotting this graph  std::string file_prefix = "t" + boost::lexical_cast<std::string>(k) + "n" + boost::lexical_cast<std::string>(n);  CGAL::gnuplot_output_2(g, file_prefix);  return 0;}
开发者ID:lrineau,项目名称:cgal,代码行数:49,


示例12: theta

MatrixXd LDA::getTheta(void) {    if(SAMPLE_LAG>0) {        return thetasum*(1.0/numstats);    }    else {        MatrixXd theta(documentsSize(),K);        for(int m=0; m<documentsSize(); m++) {            // theta.row(m)=((nd.row(m).cast<double>().array()+alpha)/(ndsum.cast<double>().array()+K*alpha)).matrix();            for(int k=0; k<K; k++) {                theta(m,k)=(nd(m,k)+alpha)/(ndsum(m)+K*alpha);            }        }        return theta;    }}
开发者ID:luxox20,项目名称:GPregression,代码行数:16,


示例13: BasisAngle

double BasisAngle( const Epetra_MultiVector& S, const Epetra_MultiVector& T ){    //    //  Computes the largest acute angle between the two orthogonal basis    //    if (S.NumVectors() != T.NumVectors()) {        return acos( 0.0 );    } else {        int lwork, info = 0;        int m = S.NumVectors(), n = T.NumVectors();        int num_vecs = ( m < n ? m : n );        double U[ 1 ], Vt[ 1 ];        lwork = 3*m*n;        std::vector<double> work( lwork );        std::vector<double> theta( num_vecs );        Epetra_LAPACK lapack;        Epetra_LocalMap localMap( S.NumVectors(), 0, S.Map().Comm() );        Epetra_MultiVector Pvec( localMap, T.NumVectors() );        info = Pvec.Multiply( 'T', 'N', 1.0, S, T, 0.0 );        //        // Perform SVD on S^T*T        //        lapack.GESVD( 'N', 'N', num_vecs, num_vecs, Pvec.Values(), Pvec.Stride(),                      &theta[0], U, 1, Vt, 1, &work[0], &lwork, &info );        assert( info == 0 );        return (acos( theta[num_vecs-1] ) );    }    //    // Default return statement, should never be executed.    //    return acos( 0.0 );}
开发者ID:uppatispr,项目名称:trilinos-official,代码行数:32,


示例14: KeccakPermutationOnWords

void KeccakPermutationOnWords(UINT64 *state){    unsigned int i;    //displayStateAsWords(3, "Same, as words", state);    for(i=0; i<nrRounds; i++) {        //displayRoundNumber(3, i);        theta(state);        //displayStateAsWords(3, "After theta", state);        rho(state);        //displayStateAsWords(3, "After rho", state);        pi(state);        //displayStateAsWords(3, "After pi", state);        chi(state);        //displayStateAsWords(3, "After chi", state);        iota(state, i);        //displayStateAsWords(3, "After iota", state);    }}
开发者ID:anzolaa1,项目名称:cuda-keccak,代码行数:25,


示例15: J

/*! Given an array of desired joint values, this computed an infinitesimal motion	of each link as motion *from the current values* towards the desired values is 	started. Used mainly to	see if any contacts prevent this motion.*/voidKinematicChain::infinitesimalMotion(const double *jointVals, std::vector<transf> &newLinkTranVec) const{	//start with the link jacobian in local link coordinates	//but keep just the actuated part	Matrix J(actuatedJacobian(linkJacobian(false)));	//joint values matrix	Matrix theta(numJoints, 1);	//a very small motion	//either 0.1 radians or 0.1 mm, should be small enough	double inf = 0.1;	//a very small threshold	double eps = 1.0e-6;	for(int j=0; j<numJoints; j++) {		int sign;		if ( jointVals[firstJointNum + j] + eps < jointVec[j]->getVal() ) {			sign = -1;		} else if ( jointVals[firstJointNum + j] > jointVec[j]->getVal() + eps ) {			sign = 1;		} else {			sign = 0;		}		theta.elem(j,0) = sign * inf;	}	//compute infinitesimal motion	Matrix dm(6*numLinks, 1);	matrixMultiply(J, theta, dm);	//and convert it to transforms	for (int l=0; l<numLinks; l++) {		transf tr = rotXYZ( dm.elem(6*l+3, 0), dm.elem(6*l+4, 0), dm.elem(6*l+5, 0) ) * 					translate_transf( vec3( dm.elem(6*l+0, 0), dm.elem(6*l+1, 0), dm.elem(6*l+2, 0) ) );		newLinkTranVec[l] = tr;	}}
开发者ID:BerkeleyAutomation,项目名称:google_goggles_project,代码行数:38,


示例16: x

std::stringPose::toString() const{    stringstream ss;    ss << "[" << x() << ", " << y() << ", " << theta()*180.0/M_PI << "deg]";    return ss.str();}
开发者ID:mjs513,项目名称:orca-robotics,代码行数:7,


示例17: detID

    /**    * Update the detector information from a raw file    * @param filename :: The input filename    */    void UpdateInstrumentFromFile::updateFromRaw(const std::string & filename)    {      ISISRAW2 iraw;      if (iraw.readFromFile(filename.c_str(),false) != 0)      {        g_log.error("Unable to open file " + filename);        throw Exception::FileError("Unable to open File:" , filename);      }      const int32_t numDetector = iraw.i_det;      std::vector<int32_t> detID(iraw.udet, iraw.udet + numDetector);      std::vector<float> l2(iraw.len2, iraw.len2 + numDetector);      std::vector<float> theta(iraw.tthe, iraw.tthe + numDetector);      // Is ut01 (=phi) present? Sometimes an array is present but has wrong values e.g.all 1.0 or all 2.0      bool phiPresent = iraw.i_use>0 && iraw.ut[0]!= 1.0 && iraw.ut[0] !=2.0;       std::vector<float> phi(0);      if( phiPresent )      {        phi = std::vector<float>(iraw.ut, iraw.ut + numDetector);      }      else      {        phi = std::vector<float>(numDetector, 0.0);      }      g_log.information() << "Setting detector postions from RAW file./n";      setDetectorPositions(detID, l2, theta, phi);    }
开发者ID:AlistairMills,项目名称:mantid,代码行数:31,


示例18: europeanOptionArraysEngine

// [[Rcpp::export]]Rcpp::List europeanOptionArraysEngine(std::string type, Rcpp::NumericMatrix par) {    QuantLib::Option::Type optionType = getOptionType(type);    int n = par.nrow();    Rcpp::NumericVector value(n), delta(n), gamma(n), vega(n), theta(n), rho(n), divrho(n);    QuantLib::Date today = QuantLib::Date::todaysDate();    QuantLib::Settings::instance().evaluationDate() = today;    QuantLib::DayCounter dc = QuantLib::Actual360();    for (int i=0; i<n; i++) {        double underlying    = par(i, 0);    // first column        double strike        = par(i, 1);    // second column        QuantLib::Spread dividendYield = par(i, 2);    // third column        QuantLib::Rate riskFreeRate    = par(i, 3);    // fourth column        QuantLib::Time maturity        = par(i, 4);    // fifth column#ifdef QL_HIGH_RESOLUTION_DATE            // in minutes        boost::posix_time::time_duration length = boost::posix_time::minutes(boost::uint64_t(maturity * 360 * 24 * 60)); #else        int length           = int(maturity*360 + 0.5); // FIXME: this could be better#endif        double volatility    = par(i, 5);    // sixth column            boost::shared_ptr<QuantLib::SimpleQuote> spot(new QuantLib::SimpleQuote( underlying ));        boost::shared_ptr<QuantLib::SimpleQuote> vol(new QuantLib::SimpleQuote( volatility ));        boost::shared_ptr<QuantLib::BlackVolTermStructure> volTS = flatVol(today, vol, dc);        boost::shared_ptr<QuantLib::SimpleQuote> qRate(new QuantLib::SimpleQuote( dividendYield ));        boost::shared_ptr<QuantLib::YieldTermStructure> qTS = flatRate(today, qRate, dc);        boost::shared_ptr<QuantLib::SimpleQuote> rRate(new QuantLib::SimpleQuote( riskFreeRate ));        boost::shared_ptr<QuantLib::YieldTermStructure> rTS = flatRate(today, rRate, dc);        #ifdef QL_HIGH_RESOLUTION_DATE    QuantLib::Date exDate(today.dateTime() + length);#else    QuantLib::Date exDate = today + length;#endif            boost::shared_ptr<QuantLib::Exercise> exercise(new QuantLib::EuropeanExercise(exDate));                boost::shared_ptr<QuantLib::StrikedTypePayoff> payoff(new QuantLib::PlainVanillaPayoff(optionType, strike));        boost::shared_ptr<QuantLib::VanillaOption> option = makeOption(payoff, exercise, spot, qTS, rTS, volTS);                value[i]  = option->NPV();        delta[i]  = option->delta();        gamma[i]  = option->gamma();        vega[i]   = option->vega();        theta[i]  = option->theta();        rho[i]    = option->rho();        divrho[i] = option->dividendRho();    }    return Rcpp::List::create(Rcpp::Named("value")  = value,                              Rcpp::Named("delta")  = delta,                              Rcpp::Named("gamma")  = gamma,                              Rcpp::Named("vega")   = vega,                              Rcpp::Named("theta")  = theta,                              Rcpp::Named("rho")    = rho,                              Rcpp::Named("divRho") = divrho);}
开发者ID:thrasibule,项目名称:rquantlib,代码行数:61,


示例19: check_theta

void check_theta(void){    double S = 430, X = 405, T = 1.0/12, r = 0.07, v = 0.20, b = 0.02; /* Interest rate - dividend yield (0.05) */    assert_equal(theta(0, S, X, T, r, b, v), -31.1924);    assert_equal(theta_put(S, X, T, r, b, v), -31.1924);}
开发者ID:saurya,项目名称:optionmatrix,代码行数:7,


示例20: BatesProcess

 void BatesModel::generateArguments() {     process_.reset(new BatesProcess(          process_->riskFreeRate(), process_->dividendYield(),          process_->s0(), v0(),           kappa(), theta(), sigma(), rho(),          lambda(), nu(), delta())); }
开发者ID:21hub,项目名称:QuantLib,代码行数:7,


示例21: wave_read

static void wave_read (GtsObject ** o, GtsFile * fp){  (* GTS_OBJECT_CLASS (gfs_wave_class ())->parent_class->read) (o, fp);  if (fp->type == GTS_ERROR)    return;  GfsWave * wave = GFS_WAVE (*o);  if (fp->type == '{') {    GtsFileVariable var[] = {      {GTS_UINT,   "nk",      TRUE, &wave->nk},      {GTS_UINT,   "ntheta",  TRUE, &wave->ntheta},      {GTS_DOUBLE, "alpha_s", TRUE, &wave->alpha_s},      {GTS_NONE}    };    gts_file_assign_variables (fp, var);    if (fp->type == GTS_ERROR)      return;  }  GfsDomain * domain = GFS_DOMAIN (wave);  guint ik, ith;  wave->F = gfs_matrix_new (wave->nk, wave->ntheta, sizeof (GfsVariable *));  for (ik = 0; ik < wave->nk; ik++)    for (ith = 0; ith < wave->ntheta; ith++) {      gchar * name = g_strdup_printf ("F%d_%d", ik, ith);      gchar * description = g_strdup_printf ("Action density for f = %g Hz and theta = %g degrees",					     frequency (ik), theta (ith, wave->ntheta)*180./M_PI);      wave->F[ik][ith] = gfs_domain_get_or_add_variable (domain, name, description);      g_assert (wave->F[ik][ith]);      g_free (name);      g_free (description);    }}
开发者ID:Exteris,项目名称:Gerris,代码行数:33,


示例22: TEST

TEST(generateExpression, integrate_ode) {  static const bool user_facing = true;  std::stringstream msgs;  stan::lang::integrate_ode so; // null ctor should work and not raise error  std::string integration_function_name = "bar";  std::string system_function_name = "foo";  stan::lang::variable y0("y0_var_name");  y0.set_type(stan::lang::bare_array_type(stan::lang::double_type()));  stan::lang::variable t0("t0_var_name");  t0.set_type(stan::lang::double_type());  stan::lang::variable ts("ts_var_name");  ts.set_type(stan::lang::bare_array_type(stan::lang::double_type()));  stan::lang::variable theta("theta_var_name");  theta.set_type(stan::lang::bare_array_type(stan::lang::double_type()));  stan::lang::variable x("x_var_name");  x.set_type(stan::lang::bare_array_type(stan::lang::double_type()));  stan::lang::variable x_int("x_int_var_name");  x.set_type(stan::lang::bare_array_type(stan::lang::int_type()));  stan::lang::integrate_ode so2(integration_function_name, system_function_name,                    y0, t0, ts, theta, x, x_int);  stan::lang::expression e1(so2);  generate_expression(e1, user_facing, msgs);  EXPECT_EQ(msgs.str(),            "bar(foo_functor__(), y0_var_name, t0_var_name, ts_var_name, "            "theta_var_name, x_var_name, x_int_var_name, pstream__)");}
开发者ID:stan-dev,项目名称:stan,代码行数:30,


示例23: DOF

/*  A vertex is connected to beams. The question  is how many bars are rotuled  We define 2 dofs per node */void frameSolver2d::createDofs(){  //  printf("coucou %d fixations/n",_fixations.size());  for(std::size_t i = 0; i < _fixations.size(); ++i) {    const gmshFixation &f = _fixations[i];    //    printf("f._vertex(%d) = %p %d    //    %g/n",i,f._vertex,f._direction,f._value);    MVertex *v = f._vertex->mesh_vertices[0];    Dof DOF(v->getNum(), f._direction);    pAssembler->fixDof(DOF, f._value);  }  //  printf("coucou2/n");  computeRotationTags();  //  printf("coucou3/n");  for(std::size_t i = 0; i < _beams.size(); i++) {    //    printf("beam[%d]
C++ thing_is_invalid函数代码示例
C++ thermo函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。