当前位置: 首页>>代码示例>>C++>>正文


C++ Domain::ImportanceWalk方法代码示例

本文整理汇总了C++中Domain::ImportanceWalk方法的典型用法代码示例。如果您正苦于以下问题:C++ Domain::ImportanceWalk方法的具体用法?C++ Domain::ImportanceWalk怎么用?C++ Domain::ImportanceWalk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Domain的用法示例。


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

示例1: while

WOSPotential::ValueType
WOSPotential::method5(ParticleSet& P)
{
  static const double V0 = 0;
  /// intialise the particles in WP;
  WP->setP(P);
  Domain domain;   /// create domain;
  double branch = 0.0;
  double tau = 0.01;
  double v0 = -8.709;
  double pe = 0.0;
  double dpe = 0.0;
  for(int irun = 0; irun < m_runs; irun++)
  {
    domain.runner = WP->R0;                /// initialise runner
    domain.in_device = true;               /// runner is inside device
    device->MaximumSphere(domain);         /// calc d_{0}
    //    domain.WalkOnSphere();
    double Gwt = domain.ImportanceWalk();
    double vD0 = device->OC_contrib0(domain.radius,domain.runner,WP);
    double vbare = device->OC_passage(V0,domain,WP);
    WP->calcwt();
    double vol = 0.0;
    while(domain.in_device)
    {
      device->MaximumSphere(domain);
      vol += device->contribk(domain,WP);
      domain.WalkOnSphere();
      vbare += device->OC_passage(V0,domain,WP);
    }
    vol *= WP->qwt;   /// the half has been included
    //    double vrun = vol + vbare + vD0;
    double vrun = 0.25*(vol + vbare)/Gwt + vD0;
    pe += vrun;
    dpe += vrun * vrun;
    //    cout << vrun << '\t' << v0 << '\t' << branch << endl;
  }
  pe *= m_norm;
  branch *= m_norm;
  dpe *= m_norm;
  dpe = sqrt(m_norm * fabs ( dpe - pe * pe ));
  double var = dpe - pe * pe;
  cout << "correlated: " << pe << '\t' << dpe << '\t' << var << '\t'
       << branch << '\t' << branch*exp(-0.5*var*tau*tau) << endl;
  exit(-1);
  return pe;
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:47,代码来源:WOSPotential.cpp


注:本文中的Domain::ImportanceWalk方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。