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


C++ DoubleMatrix::toValarray方法代码示例

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


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

示例1: ppedOpt


//.........这里部分代码省略.........
  else
  {
    pdmatLTilde_x_xOut = 0;
  }
  

  //------------------------------------------------------------
  // Set arguments related to using ppkaOpt for optimal design.
  //------------------------------------------------------------

  // ppkaOpt solves a two-level optimization problem, where the second
  // level is made up of multiple optimization problems that are all 
  // solved for each iteration of the first level.  The length of the 
  // vector N specifies the number of optimation problems that must be 
  // solved at the second level.  In this use of ppkaOpt, the first 
  // level optimization is over the design parameter vector x, while the 
  // second level is over the fixed population vector alp.  Since there 
  // is only a single fixed population vector alp, N has length one.  Its
  // only value is one because lTilde requires that there be at least
  // one data value, but this criterion itself does not depend on the data.
  int nIndPped = 1;
  int nY_iPped = 1;
  DoubleMatrix dvecN( nIndPped, 1 );
  DoubleMatrix dvecY( nY_iPped, 1 );
  dvecN.fill( (double) nY_iPped );
  dvecY.fill( 0.0 );

  // Choose the modified Laplace approximation.
  enum Objective objective = MODIFIED_LAPLACE;

  // Construct a model that evaluates first order approximations for
  // the mean and covariance of the data, maps individual to population
  // parameters, and maps population to design parameters.
  FoMapsParSpkModel ppedOptModel( &model, dvecAlpStep.toValarray() );


  //------------------------------------------------------------
  // Optimize the modified Laplace approximation for the negative log of phi(x).
  //------------------------------------------------------------

  // The criterion phi(x) is optimized by replacing the definition of 
  // lambda(alp, b) and mapObj(b) by the negative natural logarithm 
  // of the integral with respect to alp and then calls the function 
  // ppkaOpt to optimize the Laplace approximation for the integral.
  try
  {
    ppkaOpt( ppedOptModel,
             objective,
             dvecN,
             dvecY,
             xOptInfo,
             dvecXLow,
             dvecXUp,
             dvecXIn,
             &dvecXOutTemp,
             dvecXStep,
             alpOptInfo,
             dvecAlpLow,
             dvecAlpUp,
             dvecAlpIn,
             &dvecAlpOutTemp,
             dvecAlpStep,
             &dLTildeOut,
             &drowLTilde_xOut,
             &dmatLTilde_x_xOut );
  }
开发者ID:ernstae,项目名称:sysforpopkinetics,代码行数:67,代码来源:ppedOpt.cpp


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