本文整理汇总了C++中vector_expression::rhs方法的典型用法代码示例。如果您正苦于以下问题:C++ vector_expression::rhs方法的具体用法?C++ vector_expression::rhs怎么用?C++ vector_expression::rhs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vector_expression
的用法示例。
在下文中一共展示了vector_expression::rhs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: element_op
void element_op(vector_base<T> & vec1,
vector_expression<const vector_base<T>, const vector_base<T>, op_element_binary<OP> > const & proxy)
{
typedef T value_type;
typedef viennacl::linalg::detail::op_applier<op_element_binary<OP> > OpFunctor;
value_type * data_vec1 = detail::extract_raw_pointer<value_type>(vec1);
value_type const * data_vec2 = detail::extract_raw_pointer<value_type>(proxy.lhs());
value_type const * data_vec3 = detail::extract_raw_pointer<value_type>(proxy.rhs());
std::size_t start1 = viennacl::traits::start(vec1);
std::size_t inc1 = viennacl::traits::stride(vec1);
std::size_t size1 = viennacl::traits::size(vec1);
std::size_t start2 = viennacl::traits::start(proxy.lhs());
std::size_t inc2 = viennacl::traits::stride(proxy.lhs());
std::size_t start3 = viennacl::traits::start(proxy.rhs());
std::size_t inc3 = viennacl::traits::stride(proxy.rhs());
#ifdef VIENNACL_WITH_OPENMP
#pragma omp parallel for if (size1 > VIENNACL_OPENMP_VECTOR_MIN_SIZE)
#endif
for (std::size_t i = 0; i < size1; ++i)
OpFunctor::apply(data_vec1[i*inc1+start1], data_vec2[i*inc2+start2], data_vec3[i*inc3+start3]);
}
示例2: apply
static void apply(vector_base<T> & lhs, vector_expression<const vandermonde_matrix<T, A>, const vector_base<T>, op_prod> const & rhs)
{
// check for the special case x = A * x
if (viennacl::traits::handle(lhs) == viennacl::traits::handle(rhs.rhs()))
{
viennacl::vector<T> temp(lhs);
viennacl::linalg::prod_impl(rhs.lhs(), rhs.rhs(), temp);
lhs = temp;
}
else
viennacl::linalg::prod_impl(rhs.lhs(), rhs.rhs(), lhs);
}
示例3: assert
viennacl::vector<SCALARTYPE, ALIGNMENT>
viennacl::vector<SCALARTYPE, ALIGNMENT>::operator-(const vector_expression< const hankel_matrix<SCALARTYPE, MAT_ALIGNMENT>,
const vector<SCALARTYPE, ALIGNMENT>,
op_prod> & proxy)
{
assert(proxy.get_lhs().size1() == size());
vector<SCALARTYPE, ALIGNMENT> result(size());
viennacl::linalg::prod_impl(proxy.lhs(), proxy.rhs(), result);
result = *this - result;
return result;
}
示例4: size
vcl_size_t size(vector_expression<LHS, const int, op_matrix_diag> const & proxy)
{
int k = proxy.rhs();
int A_size1 = static_cast<int>(size1(proxy.lhs()));
int A_size2 = static_cast<int>(size2(proxy.lhs()));
int row_depth = std::min(A_size1, A_size1 + k);
int col_depth = std::min(A_size2, A_size2 - k);
return std::min(row_depth, col_depth);
}
示例5: op_aliasing
bool op_aliasing(vector_base<NumericT> const & lhs, vector_expression<const LhsT, const RhsT, OpT> const & rhs)
{
return op_aliasing(lhs, rhs.lhs()) || op_aliasing(lhs, rhs.rhs());
}