本文整理汇总了C++中SpProxy::is_alias方法的典型用法代码示例。如果您正苦于以下问题:C++ SpProxy::is_alias方法的具体用法?C++ SpProxy::is_alias怎么用?C++ SpProxy::is_alias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpProxy
的用法示例。
在下文中一共展示了SpProxy::is_alias方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_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);
}
}
示例3: 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(): parameter 'norm_type' must be 0 or 1" );
arma_debug_check( (dim > 1), "var(): parameter 'dim' must be 0 or 1" );
const 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);
}
}
示例4: P
inline
void
spdiagview<eT>::operator/=(const SpBase<eT,T1>& o)
{
arma_extra_debug_sigprint();
spdiagview<eT>& d = *this;
SpMat<eT>& d_m = const_cast< SpMat<eT>& >(d.m);
const uword d_n_elem = d.n_elem;
const uword d_row_offset = d.row_offset;
const uword d_col_offset = d.col_offset;
const SpProxy<T1> P( o.get_ref() );
arma_debug_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"spdiagview: given object has incompatible size"
);
if( SpProxy<T1>::must_use_iterator || P.is_alias(d_m) )
{
const SpMat<eT> tmp(P.Q);
if(tmp.n_cols == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= tmp.at(i,0); }
}
else
if(tmp.n_rows == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= tmp.at(0,i); }
}
}
else
{
if(P.get_n_cols() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= P.at(i,0); }
}
else
if(P.get_n_rows() == 1)
{
for(uword i=0; i < d_n_elem; ++i) { d_m.at(i + d_row_offset, i + d_col_offset) /= P.at(0,i); }
}
}
}
示例5: 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);
}
}