22#include <Kokkos_Core.hpp>
28template <
int Rows,
int Cols>
33 KOKKOS_INLINE_FUNCTION
35 for (
int i = 0; i < Rows; ++i) {
36 for (
int j = 0; j < Cols; ++j) {
42 for (
int i = 0; i < Rows; ++i) {
49 KOKKOS_INLINE_FUNCTION
51 for (
int i = 0; i < Rows; ++i) {
52 for (
int j = 0; j < Cols; ++j) {
59 KOKKOS_INLINE_FUNCTION
61 for (
int i = 0; i < Rows; ++i) {
62 for (
int j = 0; j < Cols; ++j) {
63 m[i][j] = right(i, j);
69 KOKKOS_INLINE_FUNCTION
72 for (
int i = 0; i < Rows; ++i) {
73 for (
int j = 0; j < Cols; ++j) {
74 m[i][j] = right(i, j);
82 KOKKOS_INLINE_FUNCTION
85 KOKKOS_INLINE_FUNCTION
88 KOKKOS_INLINE_FUNCTION
89 int size1()
const {
return Rows; }
91 KOKKOS_INLINE_FUNCTION
92 int size2()
const {
return Cols; }
101template <
unsigned Size>
105template <
int Rows,
int Cols,
class T>
109 for (
int i = 0; i < Rows; ++i) {
111 for (
int j = 0; j < Cols; ++j) {
112 val += rotation(i, j) * vect[j];
121template <
int Rows,
int Cols,
class T>
122KOKKOS_INLINE_FUNCTION
T
126 for (
int i = 0; i < Cols; ++i) {
128 for (
int j = 0; j < Rows; ++j) {
129 val += rotation(j, i) * vect[j];
138template <
int Rows,
int Cols>
141 for (
int i = 0; i < Rows; ++i) {
142 for (
int j = 0; j < Cols; ++j) {
143 transpose(j, i) = rotation(i, j);
150template <
int Rows1,
int Cols1,
int Rows2,
int Cols2>
154 for (
int i = 0; i < Rows1; ++i) {
155 for (
int j = 0; j < Cols2; ++j) {
157 for (
int k = 0; k < Cols1; ++k) {
158 sum += a(i, k) * b(k, j);
168template <
int Rows,
int Cols>
171 ippl::Vector<double, static_cast<unsigned>(Rows)> result(0.0);
172 for (
int i = 0; i < Rows; ++i) {
174 for (
int j = 0; j < Cols; ++j) {
175 sum += m(i, j) * v[j];
KOKKOS_INLINE_FUNCTION matrix_t< Cols, Rows > get_transpose(const matrix_t< Rows, Cols > &rotation)
KOKKOS_INLINE_FUNCTION ippl::Vector< double, static_cast< unsigned >(Rows)> prod_matrix_vector(const matrix_t< Rows, Cols > &m, const ippl::Vector< double, static_cast< unsigned >(Cols)> &v)
ippl::Vector< double, Size > vector_t
KOKKOS_INLINE_FUNCTION T prod_vector(const matrix_t< Rows, Cols > &rotation, const T &vect)
KOKKOS_INLINE_FUNCTION T prod_vector_transpose(const matrix_t< Rows, Cols > &rotation, const T &vect)
KOKKOS_INLINE_FUNCTION matrix_t< Rows1, Cols2 > prod(const matrix_t< Rows1, Cols1 > &a, const matrix_t< Rows2, Cols2 > &b)
KOKKOS_INLINE_FUNCTION double & operator()(int r, int c)
KOKKOS_INLINE_FUNCTION double operator()(int r, int c) const
KOKKOS_INLINE_FUNCTION matrix_t & operator=(const matrix_t &right)
KOKKOS_INLINE_FUNCTION matrix_t(const matrix_t &right)
KOKKOS_INLINE_FUNCTION int size2() const
KOKKOS_INLINE_FUNCTION int size1() const
KOKKOS_INLINE_FUNCTION matrix_t(double init_value)
KOKKOS_INLINE_FUNCTION matrix_t()