• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dyu

// Outputs derivatives (DRbar scheme) in the form of ds
StandardModel<Two_scale> StandardModel<Two_scale>::calc_beta() const
{
   static const double oneO16Pisq = 1.0 / (16.0 * PI * PI);
   DoubleMatrix dyu(3, 3), dyd(3, 3), dye(3, 3);
   DoubleVector dg(3);

   dyu(3, 3) = oneO16Pisq * yu.display(3, 3) * (
      -17.0 / 20.0 * sqr(displayGaugeCoupling(1))
      - 9.0 / 4.0 * sqr(displayGaugeCoupling(2))
      - 8.0 * sqr(displayGaugeCoupling(3))
      + 4.5 * sqr(yu.display(3, 3))
      + 1.5 * sqr(yd.display(3, 3))
      + sqr(ye.display(3, 3)));

   dyd(3, 3) = oneO16Pisq * yd.display(3, 3) * (
      -0.25 * sqr(displayGaugeCoupling(1))
      - 9.0 / 4.0 * sqr(displayGaugeCoupling(2))
      - 8.0 * sqr(displayGaugeCoupling(3))
      + 1.5 * sqr(yu.display(3, 3))
      + 4.5 * sqr(yd.display(3, 3))
      + sqr(ye.display(3, 3)));

   dye(3, 3) = oneO16Pisq * ye.display(3, 3) * (
      -9.0 / 4.0 * sqr(displayGaugeCoupling(1))
      -9.0 / 4.0 * sqr(displayGaugeCoupling(2))
      + 3.0 * sqr(yu.display(3, 3))
      + 3.0 * sqr(yd.display(3, 3))
      + 2.5 * sqr(ye.display(3, 3)));

   dg(1) = oneO16Pisq * std::pow(displayGaugeCoupling(1), 3) * (41.0 / 10.0);
   dg(2) = oneO16Pisq * std::pow(displayGaugeCoupling(2), 3) * (-19.0 / 6.0);
   dg(3) = oneO16Pisq * std::pow(displayGaugeCoupling(3), 3) * (-7.0);

   return StandardModel(dyu, dyd, dye, dg);
}
开发者ID:kerwinhui,项目名称:FlexibleSUSY,代码行数:36,代码来源:sm_two_scale.cpp


示例2: CHECK_NOTNULL

HTTPTransaction*
HTTPUpstreamSession::newTransaction(HTTPTransaction::Handler* handler,
                                    int8_t priority) {
  CHECK_NOTNULL(handler);

  if (!supportsMoreTransactions() || draining_) {
    // This session doesn't support any more parallel transactions
    return nullptr;
  }

  if (!started_) {
    startNow();
  }

  auto txn = createTransaction(codec_->createStream(),
                               0,
                               priority);

  if (txn) {
    DestructorGuard dg(this);
    auto txnID = txn->getID();
    txn->setHandler(handler);
    setNewTransactionPauseState(txnID);
  }
  return txn;
}
开发者ID:LeonYel,项目名称:proxygen,代码行数:26,代码来源:HTTPUpstreamSession.cpp


示例3: dg

 unsigned long File::read(void* buffer, unsigned long numBytes)
 {
   DelayedCallGuard dg(languageHook);
   if (!numBytes)
     numBytes = (unsigned long)file->GetLength();
   return (unsigned long)file->Read(buffer, numBytes);
 }
开发者ID:Ilia,项目名称:xbmc,代码行数:7,代码来源:File.cpp


示例4: dg

void HeaderServerChannel::sendCatchupRequests(
    std::unique_ptr<folly::IOBuf> next_req,
    MessageChannel::SendCallback* cb,
    std::vector<uint16_t> transforms) {

  DestructorGuard dg(this);

  while (true) {
    if (next_req) {
      try {
        header_->setSequenceNumber(lastWrittenSeqId_ + 1);
        header_->setTransforms(transforms);
        sendMessage(cb, std::move(next_req));
      } catch (const std::exception& e) {
        LOG(ERROR) << "Failed to send message: " << e.what();
      }
    } else if (nullptr != cb) {
      // There is no message (like a oneway req), but there is a callback
      cb->messageSent();
    }
    lastWrittenSeqId_++;

    // Check for the next req
    auto next = inOrderRequests_.find(
        lastWrittenSeqId_ + 1);
    if (next != inOrderRequests_.end()) {
      next_req = std::move(std::get<1>(next->second));
      cb = std::get<0>(next->second);
      transforms = std::get<2>(next->second);
      inOrderRequests_.erase(lastWrittenSeqId_ + 1);
    } else {
      break;
    }
  }
}
开发者ID:YellowMouse,项目名称:fbthrift,代码行数:35,代码来源:HeaderServerChannel.cpp


示例5: wcells_f

// Print the cells of the W-graph of the block.
void wcells_f()
{
  const wgraph::WGraph& wg = currentWGraph();
  wgraph::DecomposedWGraph dg(wg);

  ioutils::OutputFile file; wgraph_io::printWDecomposition(file,dg);
}
开发者ID:nailbiter,项目名称:atlasofliegroups,代码行数:8,代码来源:reprmode.cpp


示例6: dg

 void InternalConnection::unsubscribe_range(channel_t lo, channel_t hi)
 {
     Datagram dg(CONTROL_REMOVE_RANGE);
     dg.add_channel(lo);
     dg.add_channel(hi);
     send_datagram(dg);
 }
开发者ID:Astron,项目名称:astron.libcxx,代码行数:7,代码来源:InternalConnection.cpp


示例7: assert

void TZlibAsyncChannel::recvMessage(const VoidCallback& callback,
                                    const VoidCallback& errorCallback,
                                    TMemoryBuffer* message) {
  assert(message);
  DestructorGuard dg(this);

  if (!good()) {
    T_DEBUG_T("zlib channel: attempted to read on non-good channel");
    return errorCallback();
  }

  if (recvRequest_.isSet()) {
    T_ERROR("zlib async channel is already reading");
    return errorCallback();
  }

  try {
    recvRequest_.set(callback, errorCallback, message);
  } catch (const std::exception& ex) {
    T_ERROR("zlib async channel: error initializing receive: %s", ex.what());
    return errorCallback();
  }

  recvRequest_.recv(channel_.get());
}
开发者ID:191919,项目名称:fbthrift,代码行数:25,代码来源:TZlibAsyncChannel.cpp


示例8: dg

void McServerSession::readDataAvailable(size_t len) noexcept {
  DestructorGuard dg(this);

  if (!parser_.readDataAvailable(len)) {
    close();
  }
}
开发者ID:0xd3adsh3ll,项目名称:mcrouter,代码行数:7,代码来源:McServerSession.cpp


示例9: dg

void AsyncMcClientImpl::pushMessages() {
  DestructorGuard dg(this);

  assert(connectionState_ == ConnectionState::UP);
  size_t numToSend = queue_.getPendingRequestCount();
  if (maxInflight_ != 0) {
    if (maxInflight_ <= getInflightRequestCount()) {
      numToSend = 0;
    } else {
      numToSend = std::min(numToSend,
                           maxInflight_ - getInflightRequestCount());
    }
  }
  // Record current batch size.
  batchStatCurrent.first += numToSend;
  ++batchStatCurrent.second;
  if (batchStatCurrent.second == kBatchSizeStatWindow) {
    batchStatPrevious = batchStatCurrent;
    batchStatCurrent = {0, 0};
  }

  while (getPendingRequestCount() != 0 && numToSend > 0 &&
         /* we might be already not UP, because of failed writev */
         connectionState_ == ConnectionState::UP) {
    auto& req = queue_.markNextAsSending();

    socket_->writev(this, req.reqContext.getIovs(),
                    req.reqContext.getIovsCount(),
                    numToSend == 1 ? folly::WriteFlags::NONE
                    : folly::WriteFlags::CORK);
    --numToSend;
  }
  writeScheduled_ = false;
  scheduleNextWriterLoop();
}
开发者ID:prateek1404,项目名称:mcrouter,代码行数:35,代码来源:AsyncMcClientImpl.cpp


示例10: dg

 DiGraph DiGraph::reverse() const {
     DiGraph dg(V());
     for(int v=0;v<V();++v)
         for(int w : adjacent(v))
             dg.addEdge(w,v);
     return dg;
 }
开发者ID:BinaryBrain,项目名称:HEIG-ASD,代码行数:7,代码来源:DiGraph.cpp


示例11: assert

void AsyncMcClientImpl::connectErr(
    const folly::AsyncSocketException& ex) noexcept {
  assert(connectionState_ == ConnectionState::CONNECTING);
  DestructorGuard dg(this);

  mc_res_t error;

  if (ex.getType() == folly::AsyncSocketException::TIMED_OUT) {
    error = mc_res_connect_timeout;
  } else if (isAborting_) {
    error = mc_res_aborted;
  } else {
    error = mc_res_connect_error;
  }

  assert(getInflightRequestCount() == 0);
  queue_.failAllPending(error);
  connectionState_ = ConnectionState::DOWN;
  // We don't need it anymore, so let it perform complete cleanup.
  socket_.reset();

  if (statusCallbacks_.onDown) {
    statusCallbacks_.onDown(isAborting_);
  }
}
开发者ID:prateek1404,项目名称:mcrouter,代码行数:25,代码来源:AsyncMcClientImpl.cpp


示例12: x

void TestExprDiff::apply02() {
	Variable x("x");
	Function f(x,sqr(x),"f");
	Function g(x,3*f(x));
	Function dg(g,Function::DIFF);
	TEST_ASSERT(sameExpr(dg.expr(),"(df(x)*3)"));
}
开发者ID:nicolaje,项目名称:IBEX,代码行数:7,代码来源:TestExprDiff.cpp


示例13: dg

    XbmcCommons::Buffer File::readBytes(unsigned long numBytes)
    {
      DelayedCallGuard dg(languageHook);
      int64_t size = file->GetLength();
      if (!numBytes || (((int64_t)numBytes) > size))
        numBytes = (unsigned long) size;

      
      XbmcCommons::Buffer ret(numBytes);

      if (numBytes == 0)
        return ret;

      while(ret.remaining() > 0)
      {
        int bytesRead = file->Read(ret.curPosition(), ret.remaining());
        if (bytesRead == 0) // we consider this a failure or a EOF, can't tell which,
        {                   //  return whatever we have already.
          ret.flip();
          return ret;
        }
        ret.forward(bytesRead);
      }
      ret.flip();
      return ret;
    }
开发者ID:CaptainRewind,项目名称:xbmc,代码行数:26,代码来源:File.cpp


示例14: dg

// Client Interface
uint32_t HTTPClientChannel::sendOnewayRequest(
    RpcOptions& rpcOptions,
    std::unique_ptr<RequestCallback> cb,
    std::unique_ptr<apache::thrift::ContextStack> ctx,
    unique_ptr<IOBuf> buf,
    std::shared_ptr<THeader> header) {
  DestructorGuard dg(this);
  cb->context_ = RequestContext::saveContext();

  HTTPTransactionOnewayCallback* owcb = nullptr;

  if (cb) {
    owcb = new HTTPTransactionOnewayCallback(
        std::move(cb), std::move(ctx), isSecurityActive());
  }

  if (!httpSession_) {
    if (owcb) {
      TTransportException ex(TTransportException::NOT_OPEN,
                             "HTTPSession is not open");
      owcb->messageSendError(
          folly::make_exception_wrapper<TTransportException>(std::move(ex)));

      delete owcb;
    }

    return -1;
  }

  auto txn = httpSession_->newTransaction(owcb);

  if (!txn) {
    if (owcb) {
      TTransportException ex(TTransportException::NOT_OPEN,
                             "Too many active requests on connection");
      owcb->messageSendError(
          folly::make_exception_wrapper<TTransportException>(std::move(ex)));

      delete owcb;
    }

    return -1;
  }

  setRequestHeaderOptions(header.get());
  addRpcOptionHeaders(header.get(), rpcOptions);

  auto msg = buildHTTPMessage(header.get());

  txn->sendHeaders(msg);
  txn->sendBody(std::move(buf));
  txn->sendEOM();

  if (owcb) {
    owcb->sendQueued();
  }

  return ResponseChannel::ONEWAY_REQUEST_ID;
}
开发者ID:disigma,项目名称:fbthrift,代码行数:60,代码来源:HTTPClientChannel.cpp


示例15: dg

 void Window::removeControls(std::vector<Control*> pControls)
 {
   XBMC_TRACE;
   DelayedCallGuard dg(languageHook);
   int count = 1; int size = pControls.size();
   for (std::vector<Control*>::iterator iter = pControls.begin(); iter != pControls.end(); count++, ++iter)
     doRemoveControl(*iter,NULL, count == size);
 }
开发者ID:FLyrfors,项目名称:xbmc,代码行数:8,代码来源:Window.cpp


示例16: dg

void Cpp2Channel::readException(Context* ctx, folly::exception_wrapper e)  {
  DestructorGuard dg(this);
  VLOG(5) << "Got a read error: " << folly::exceptionStr(e);
  if (recvCallback_) {
    recvCallback_->messageReceiveErrorWrapped(std::move(e));
  }
  processReadEOF();
}
开发者ID:nemith,项目名称:fbthrift,代码行数:8,代码来源:Cpp2Channel.cpp


示例17: dg

void Cpp2Channel::readError(const TTransportException & ex) noexcept {
  DestructorGuard dg(this);
  VLOG(5) << "Got a read error: " << folly::exceptionStr(ex);
  if (recvCallback_) {
    recvCallback_->messageReceiveError(make_exception_ptr(ex));
  }
  processReadEOF();
}
开发者ID:343829084,项目名称:fbthrift,代码行数:8,代码来源:Cpp2Channel.cpp


示例18: dg

 void Keyboard::doModal(int autoclose)
 {
   DelayedCallGuard dg(languageHook);
   // using keyboardfactory method to get native keyboard if there is.
   strText = strDefault;
   CStdString text(strDefault);
   bConfirmed = CGUIKeyboardFactory::ShowAndGetInput(text, strHeading, true, bHidden, autoclose * 1000);
   strText = text;
 }
开发者ID:2BReality,项目名称:xbmc,代码行数:9,代码来源:Keyboard.cpp


示例19: assert

void Cpp2Channel::writeSuccess() noexcept {
  assert(sendCallbacks_.size() > 0);

  DestructorGuard dg(this);
  for (auto& cb : sendCallbacks_.front()) {
    cb->messageSent();
  }
  sendCallbacks_.pop_front();
}
开发者ID:Hsin,项目名称:fbthrift,代码行数:9,代码来源:Cpp2Channel.cpp


示例20: dg

 static void dg(ClassDeclaration *cd, Identifiers *idents)
 {
     for (size_t i = 0; i < cd->baseclasses->dim; i++)
     {   ClassDeclaration *cb = (*cd->baseclasses)[i]->base;
         ScopeDsymbol::foreach(NULL, cb->members, &PushIdentsDg::dg, idents);
         if (cb->baseclasses->dim)
             dg(cb, idents);
     }
 }
开发者ID:jacob-carlborg,项目名称:dmd,代码行数:9,代码来源:traits.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dgAbsf函数代码示例发布时间:2022-05-30
下一篇:
C++ dfs函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap