本文整理汇总了C++中subview_cube类的典型用法代码示例。如果您正苦于以下问题:C++ subview_cube类的具体用法?C++ subview_cube怎么用?C++ subview_cube使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了subview_cube类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: arma_extra_debug_sigprint
inline
void
subview_cube<eT>::operator/= (const subview_cube<eT>& x)
{
arma_extra_debug_sigprint();
if(check_overlap(x))
{
const Cube<eT> tmp(x);
(*this).operator/=(tmp);
return;
}
subview_cube<eT>& t = *this;
arma_debug_assert_same_size(t, x, "element-wise division");
const uword t_n_rows = t.n_rows;
const uword t_n_cols = t.n_cols;
const uword t_n_slices = t.n_slices;
for(uword slice = 0; slice < t_n_slices; ++slice)
{
for(uword col = 0; col < t_n_cols; ++col)
{
arrayops::inplace_div( t.slice_colptr(slice,col), x.slice_colptr(slice,col), t_n_rows );
}
}
}
开发者ID:Gyebro,项目名称:clion-projects,代码行数:31,代码来源:subview_cube_meat.hpp
示例2:
inline
void
subview_cube<eT>::div_inplace(Cube<eT>& out, const subview_cube<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "element-wise cube division");
const u32 n_rows = out.n_rows;
const u32 n_cols = out.n_cols;
const u32 n_slices = out.n_slices;
for(u32 slice = 0; slice<n_slices; ++slice)
{
for(u32 col = 0; col<n_cols; ++col)
{
eT* out_coldata = out.slice_colptr(slice,col);
const eT* in_coldata = in.slice_colptr(slice,col);
for(u32 row = 0; row<n_rows; ++row)
{
out_coldata[row] /= in_coldata[row];
}
}
}
}
开发者ID:Caelita,项目名称:groupsac,代码行数:26,代码来源:subview_cube_meat.hpp
示例3:
inline
void
subview_cube<eT>::div_inplace(Mat<eT>& out, const subview_cube<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "matrix element-wise division");
const u32 in_n_rows = in.n_rows;
const u32 in_n_cols = in.n_cols;
const u32 in_aux_slice1 = in.aux_slice1;
for(u32 col = 0; col < in_n_cols; ++col)
{
arrayops::inplace_div( out.colptr(col), in.slice_colptr(in_aux_slice1, col), in_n_rows );
}
}
开发者ID:avinashsastry,项目名称:trimarkov_HMM,代码行数:17,代码来源:subview_cube_meat.hpp
示例4: arma_extra_debug_sigprint
inline
void
subview_cube<eT>::extract(Mat<eT>& out, const subview_cube<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_check( (in.n_slices != 1), "subview_cube::extract(): given subcube doesn't have exactly one slice" );
const u32 n_rows = in.n_rows;
const u32 n_cols = in.n_cols;
const u32 aux_slice1 = in.aux_slice1;
out.set_size(n_rows, n_cols);
for(u32 col = 0; col < n_cols; ++col)
{
syslib::copy_elem( out.colptr(col), in.slice_colptr(aux_slice1, col), n_rows );
}
}
开发者ID:avinashsastry,项目名称:trimarkov_HMM,代码行数:19,代码来源:subview_cube_meat.hpp
示例5:
inline
void
subview_cube<eT>::div_inplace(Cube<eT>& out, const subview_cube<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_assert_same_size(out, in, "element-wise division");
const uword n_rows = out.n_rows;
const uword n_cols = out.n_cols;
const uword n_slices = out.n_slices;
for(uword slice = 0; slice<n_slices; ++slice)
{
for(uword col = 0; col<n_cols; ++col)
{
arrayops::inplace_div( out.slice_colptr(slice,col), in.slice_colptr(slice,col), n_rows );
}
}
}
开发者ID:Gyebro,项目名称:clion-projects,代码行数:20,代码来源:subview_cube_meat.hpp
示例6: arma_extra_debug_sigprint
inline
void
subview_cube<eT>::extract(Mat<eT>& out, const subview_cube<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_check( (in.n_slices != 1), "subview_cube::extract(): given subcube doesn't have exactly one slice" );
out.set_size(in.n_rows, in.n_cols);
for(u32 col = 0; col < in.n_cols; ++col)
{
const eT* in_coldata = in.slice_colptr(in.aux_slice1, col);
eT* out_coldata = out.colptr(col);
for(u32 row = 0; row < in.n_rows; ++row)
{
out_coldata[row] = in_coldata[row];
}
}
}
开发者ID:Caelita,项目名称:groupsac,代码行数:21,代码来源:subview_cube_meat.hpp
示例7:
inline
void
op_vectorise_cube_col::apply_subview(Mat<eT>& out, const subview_cube<eT>& sv)
{
arma_extra_debug_sigprint();
const uword sv_n_rows = sv.n_rows;
const uword sv_n_cols = sv.n_cols;
const uword sv_n_slices = sv.n_slices;
out.set_size(sv.n_elem, 1);
eT* out_mem = out.memptr();
for(uword slice=0; slice < sv_n_slices; ++slice)
for(uword col=0; col < sv_n_cols; ++col )
{
arrayops::copy(out_mem, sv.slice_colptr(slice,col), sv_n_rows);
out_mem += sv_n_rows;
}
}
开发者ID:EmanueleCannizzaro,项目名称:armadillo,代码行数:22,代码来源:op_vectorise_meat.hpp
示例8:
inline
void
subview_cube<eT>::div_inplace(Mat<eT>& out, const subview_cube<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_assert_cube_as_mat(out, in, "element-wise division", true);
const u32 in_n_rows = in.n_rows;
const u32 in_n_cols = in.n_cols;
const u32 in_n_slices = in.n_slices;
const u32 out_n_rows = out.n_rows;
const u32 out_n_cols = out.n_cols;
const u32 out_vec_state = out.vec_state;
if(in_n_slices == 1)
{
for(u32 col=0; col < in_n_cols; ++col)
{
arrayops::inplace_div( out.colptr(col), in.slice_colptr(0, col), in_n_rows );
}
}
else
{
if(out_vec_state == 0)
{
if( (in_n_rows == out_n_rows) && (in_n_cols == 1) && (in_n_slices == out_n_cols) )
{
for(u32 i=0; i < in_n_slices; ++i)
{
arrayops::inplace_div( out.colptr(i), in.slice_colptr(i, 0), in_n_rows );
}
}
else
if( (in_n_rows == 1) && (in_n_cols == out_n_cols) && (in_n_slices == out_n_rows) )
{
const Cube<eT>& Q = in.m;
const u32 in_aux_row1 = in.aux_row1;
const u32 in_aux_col1 = in.aux_col1;
const u32 in_aux_slice1 = in.aux_slice1;
for(u32 col=0; col < in_n_cols; ++col)
{
eT* out_colptr = out.colptr(col);
for(u32 i=0; i < in_n_slices; ++i)
{
out_colptr[i] /= Q.at(in_aux_row1, in_aux_col1 + col, in_aux_slice1 + i);
}
}
}
}
else
{
eT* out_mem = out.memptr();
const Cube<eT>& Q = in.m;
const u32 in_aux_row1 = in.aux_row1;
const u32 in_aux_col1 = in.aux_col1;
const u32 in_aux_slice1 = in.aux_slice1;
for(u32 i=0; i<in_n_slices; ++i)
{
out_mem[i] /= Q.at(in_aux_row1, in_aux_col1, in_aux_slice1 + i);
}
}
}
}
开发者ID:davetcoleman,项目名称:SimplexSolver,代码行数:71,代码来源:subview_cube_meat.hpp
注:本文中的subview_cube类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论