本文整理汇总了C++中SmartPtr::MakeNewCopy方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtr::MakeNewCopy方法的具体用法?C++ SmartPtr::MakeNewCopy怎么用?C++ SmartPtr::MakeNewCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartPtr
的用法示例。
在下文中一共展示了SmartPtr::MakeNewCopy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MatrixSpace
ScaledMatrixSpace::ScaledMatrixSpace(
const SmartPtr<const Vector>& row_scaling,
bool row_scaling_reciprocal,
const SmartPtr<const MatrixSpace>& unscaled_matrix_space,
const SmartPtr<const Vector>& column_scaling,
bool column_scaling_reciprocal)
:
MatrixSpace(unscaled_matrix_space->NRows(),
unscaled_matrix_space->NCols()),
unscaled_matrix_space_(unscaled_matrix_space)
{
if (IsValid(row_scaling)) {
row_scaling_ = row_scaling->MakeNewCopy();
if (row_scaling_reciprocal) {
row_scaling_->ElementWiseReciprocal();
}
}
else {
row_scaling_ = NULL;
}
if (IsValid(column_scaling)) {
column_scaling_ = column_scaling->MakeNewCopy();
if (column_scaling_reciprocal) {
column_scaling_->ElementWiseReciprocal();
}
}
else {
column_scaling_ = NULL;
}
}
示例2: SymScaledMatrixSpace
/** Constructor, given the number of row and columns blocks, as
* well as the totel number of rows and columns.
*/
SymScaledMatrixSpace(const SmartPtr<const Vector>& row_col_scaling,
bool row_col_scaling_reciprocal,
const SmartPtr<const SymMatrixSpace>& unscaled_matrix_space)
:
SymMatrixSpace(unscaled_matrix_space->Dim()),
unscaled_matrix_space_(unscaled_matrix_space)
{
scaling_ = row_col_scaling->MakeNewCopy();
if (row_col_scaling_reciprocal) {
scaling_->ElementWiseReciprocal();
}
}
示例3:
SmartPtr<Vector> StandardScalingBase::unapply_vector_scaling_x_NonConst(
const SmartPtr<const Vector>& v)
{
DBG_START_METH("StandardScalingBase::unapply_vector_scaling_x_NonConst",
dbg_verbosity);
SmartPtr<Vector> unscaled_x = v->MakeNewCopy();
if (IsValid(dx_)) {
unscaled_x->ElementWiseDivide(*dx_);
}
else {
DBG_PRINT((1, "Creating copy in unapply_vector_scaling_x_NonConst!"));
}
return unscaled_x;
}
示例4: IsValid
SmartPtr<Vector> StandardScalingBase::unapply_vector_scaling_d_NonConst(
const SmartPtr<const Vector>& v)
{
DBG_START_METH("StandardScalingBase::unapply_vector_scaling_d_NonConst",
dbg_verbosity);
SmartPtr<Vector> scaled_d = v->MakeNewCopy();
if (IsValid(scaled_jac_d_space_) &&
IsValid(scaled_jac_d_space_->RowScaling())) {
scaled_d->ElementWiseDivide(*scaled_jac_d_space_->RowScaling());
}
else {
DBG_PRINT((1,"Creating copy in unapply_vector_scaling_d_NonConst!"));
}
return scaled_d;
}