product
(matrix-vector)#
Header: <pressio/ops.hpp>
API#
namespace pressio { namespace ops{
// op(A) = A
template <
class A_type, class x_type, class y_type,
class alpha_t, class beta_t
>
void product(::pressio::nontranspose /*unused*/,
const alpha_t & alpha,
const A_type & A,
const x_type & x,
const beta_t & beta,
y_type & y);
// op(A) = A , construct result
template <
class y_type, class A_type, class x_type, class alpha_t
>
y_type product(::pressio::nontranspose mode,
const alpha_t & alpha,
const A_type & A,
const x_type & x);
// op(A) = A^T
template <
class y_type, class A_type, class x_type, class alpha_t
>
void product(::pressio::transpose /*unused*/,
const alpha_t & alpha,
const A_type & A,
const x_type & x,
const beta_t & beta,
y_type & y);
// op(A) = A^T , construct result
template <class y_type, class A_type, class x_type, class alpha_t>
y_type product(::pressio::transpose mode,
const alpha_t & alpha,
const A_type & A,
const x_type & x);
}} // end namespace pressio::ops
Description#
Performs matrix-vector multiplication according to
y = beta * y + alpha * op(A) * x
*op(A)
indicates eitherA
orA^T
alpha_t
andbeta_t
are scalar typesx_type
andy_type
are rank-1 containersA_type
is a rank-2 containerThe following combinations of container types are supported for each
A_type
:Eigen
All container types are either Eigen containers or Pressio expressions of Eigen containers,
Kokkos
All container types are either Kokkos views or Pressio expressions of Eigen views
Teuchos (does not support constructed results)
A_type
is a rank-2 Teuchos containerx_type
andy_type
are rank-1 Eigen containers
Tpetra
A_type
is a rank-2 Tpetra containerx_type
is a rank-1 Eigen, Kokkos, Teuchos, or Tpetra containery_type
is a rank-1 container. Ifx_type
is Tpetra, it may be either a Kokkos or Eigen container (or a Pressio expression of a Kokkos or Eigen container) Otherwise,y_type
is a Tpetra container or a Pressio column expression
Tpetra Block
A_type
is a rank-2 Tpetra Block containerx_type
is a rank-1 Eigen, Kokkos, Teuchos, or Tpetra Block containery_type
is a rank-1 container. Ifx_type
is a Tpetra Block vector,y_type
may be either an Eigen vector or a rank-1 Kokkos view Otherwise,y_type
is a Tpetra Block vector or column expression
Notes#
See the ops homepage for a table of booleans to use when checking that
A_type
,x_type
, andy_type`
have the correct types.