本文整理汇总了C++中viennacl::matrix_expression::lhs方法的典型用法代码示例。如果您正苦于以下问题:C++ matrix_expression::lhs方法的具体用法?C++ matrix_expression::lhs怎么用?C++ matrix_expression::lhs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类viennacl::matrix_expression
的用法示例。
在下文中一共展示了matrix_expression::lhs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prod_impl
void prod_impl(const viennacl::matrix_expression< const matrix_base<NumericT>, const matrix_base<NumericT>, op_trans> & A,
const viennacl::matrix_expression< const matrix_base<NumericT>, const matrix_base<NumericT>, op_trans> & B,
matrix_base<NumericT> & C,
ScalarType alpha,
ScalarType beta)
{
assert(viennacl::traits::size2(A.lhs()) == viennacl::traits::size1(C) && bool("Size check failed at C = prod(trans(A), trans(B)): size2(A) != size1(C)"));
assert(viennacl::traits::size1(A.lhs()) == viennacl::traits::size2(B.lhs()) && bool("Size check failed at C = prod(trans(A), trans(B)): size1(A) != size2(B)"));
assert(viennacl::traits::size1(B.lhs()) == viennacl::traits::size2(C) && bool("Size check failed at C = prod(trans(A), trans(B)): size1(B) != size2(C)"));
switch (viennacl::traits::handle(A.lhs()).get_active_handle_id())
{
case viennacl::MAIN_MEMORY:
viennacl::linalg::host_based::prod_impl(A.lhs(), true, B.lhs(), true, C, alpha, beta);
break;
#ifdef VIENNACL_WITH_OPENCL
case viennacl::OPENCL_MEMORY:
viennacl::linalg::opencl::prod_impl(A.lhs(), true, B.lhs(), true, C, alpha, beta);
break;
#endif
#ifdef VIENNACL_WITH_CUDA
case viennacl::CUDA_MEMORY:
viennacl::linalg::cuda::prod_impl(A.lhs(), true, B.lhs(), true, C, alpha, beta);
break;
#endif
case viennacl::MEMORY_NOT_INITIALIZED:
throw memory_exception("not initialised!");
default:
throw memory_exception("not implemented");
}
}
示例2: size
static size_t size(const viennacl::matrix_expression< const viennacl::matrix<ScalarType, F, Amat>,
const viennacl::matrix<ScalarType, F, Amat>,
op_trans> & lhs,
const viennacl::vector<ScalarType, A> & rhs) { return lhs.lhs().size2(); }
示例3:
static vcl_size_t size2(viennacl::matrix_expression<const LHS, const RHS, OP> const & lhs,
ScalarType const & /*rhs*/) { return MATRIX_SIZE_DEDUCER<const LHS, const RHS, OP>::size2(lhs.lhs(), lhs.rhs()); }
示例4: active_handle_id
viennacl::memory_types active_handle_id(viennacl::matrix_expression<LHS, RHS, OP> const & obj)
{
return active_handle_id(obj.lhs());
}
示例5:
static vcl_size_t size2(viennacl::matrix_expression<const LHS1, const RHS1, OP1> const & lhs,
viennacl::matrix_expression<const LHS2, const RHS2, OP2> const & /*rhs*/) { return MATRIX_SIZE_DEDUCER<const LHS1, const RHS1, OP1>::size2(lhs.lhs(), lhs.rhs()); }
示例6:
static size_t size2(viennacl::matrix<ScalarType, F1, A1> const & lhs,
viennacl::matrix_expression<const viennacl::matrix<ScalarType, F2, A2>,
const viennacl::matrix<ScalarType, F2, A2>,
op_trans> const & rhs) { return rhs.lhs().size1(); }