本文整理汇总了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 );
}