本文整理汇总了C++中SpMat::steal_mem方法的典型用法代码示例。如果您正苦于以下问题:C++ SpMat::steal_mem方法的具体用法?C++ SpMat::steal_mem怎么用?C++ SpMat::steal_mem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpMat
的用法示例。
在下文中一共展示了SpMat::steal_mem方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pa
arma_hot
inline
void
spglue_plus::apply(SpMat<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_plus>& X)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
const SpProxy<T1> pa(X.A);
const SpProxy<T2> pb(X.B);
const bool is_alias = pa.is_alias(out) || pb.is_alias(out);
if(is_alias == false)
{
spglue_plus::apply_noalias(out, pa, pb);
}
else
{
SpMat<eT> tmp;
spglue_plus::apply_noalias(tmp, pa, pb);
out.steal_mem(tmp);
}
}
示例2: p
inline
void
spop_var::apply(SpMat<typename T1::pod_type>& out, const mtSpOp<typename T1::pod_type, T1, spop_var>& in)
{
arma_extra_debug_sigprint();
//typedef typename T1::elem_type in_eT;
typedef typename T1::pod_type out_eT;
const uword norm_type = in.aux_uword_a;
const uword dim = in.aux_uword_b;
arma_debug_check((norm_type > 1), "var(): incorrect usage. norm_type must be 0 or 1");
arma_debug_check((dim > 1), "var(): incorrect usage. dim must be 0 or 1");
SpProxy<T1> p(in.m);
if(p.is_alias(out) == false)
{
spop_var::apply_noalias(out, p, norm_type, dim);
}
else
{
SpMat<out_eT> tmp;
spop_var::apply_noalias(tmp, p, norm_type, dim);
out.steal_mem(tmp);
}
}
示例3: p
inline
void
spop_mean::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_mean>& in)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
const uword dim = in.aux_uword_a;
arma_debug_check( (dim > 1), "mean(): parameter 'dim' must be 0 or 1" );
const SpProxy<T1> p(in.m);
if(p.is_alias(out) == false)
{
spop_mean::apply_noalias_fast(out, p, dim);
}
else
{
SpMat<eT> tmp;
spop_mean::apply_noalias_fast(tmp, p, dim);
out.steal_mem(tmp);
}
}
示例4: locs
arma_hot
inline
void
spop_htrans::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_htrans>& in, const typename arma_cx_only<typename T1::elem_type>::result* junk)
{
arma_extra_debug_sigprint();
arma_ignore(junk);
typedef typename T1::elem_type eT;
typedef typename umat::elem_type ueT;
const SpProxy<T1> p(in.m);
const uword N = p.get_n_nonzero();
if(N == uword(0))
{
out.set_size(p.get_n_cols(), p.get_n_rows());
return;
}
umat locs(2, N);
Col<eT> vals(N);
eT* vals_ptr = vals.memptr();
typename SpProxy<T1>::const_iterator_type it = p.begin();
for(uword count = 0; count < N; ++count)
{
ueT* locs_ptr = locs.colptr(count);
locs_ptr[0] = it.col();
locs_ptr[1] = it.row();
vals_ptr[count] = std::conj(*it);
++it;
}
SpMat<eT> tmp(locs, vals, p.get_n_cols(), p.get_n_rows());
out.steal_mem(tmp);
}
示例5: locs
arma_hot
inline
void
spop_strans::apply_proxy(SpMat<typename T1::elem_type>& out, const T1& X)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
typedef typename umat::elem_type ueT;
const SpProxy<T1> p(X);
const uword N = p.get_n_nonzero();
if(N == uword(0))
{
out.zeros(p.get_n_cols(), p.get_n_rows());
return;
}
umat locs(2, N);
Col<eT> vals(N);
eT* vals_ptr = vals.memptr();
typename SpProxy<T1>::const_iterator_type it = p.begin();
for(uword count = 0; count < N; ++count)
{
ueT* locs_ptr = locs.colptr(count);
locs_ptr[0] = it.col();
locs_ptr[1] = it.row();
vals_ptr[count] = (*it);
++it;
}
SpMat<eT> tmp(locs, vals, p.get_n_cols(), p.get_n_rows());
out.steal_mem(tmp);
}
示例6: p
inline
void
spop_diagmat::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1, spop_diagmat>& in)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
const SpProxy<T1> p(in.m);
if(p.is_alias(out) == false)
{
spop_diagmat::apply_noalias(out, p);
}
else
{
SpMat<eT> tmp;
spop_diagmat::apply_noalias(tmp, p);
out.steal_mem(tmp);
}
}
示例7: UA
inline
void
spglue_kron::apply(SpMat<typename T1::elem_type>& out, const SpGlue<T1,T2,spglue_kron>& X)
{
arma_extra_debug_sigprint();
typedef typename T1::elem_type eT;
const unwrap_spmat<T1> UA(X.A);
const unwrap_spmat<T2> UB(X.B);
if(UA.is_alias(out) || UB.is_alias(out))
{
SpMat<eT> tmp;
spglue_kron::apply_noalias(tmp, UA.M, UB.M);
out.steal_mem(tmp);
}
else
{
spglue_kron::apply_noalias(out, UA.M, UB.M);
}
}