5#include <amdis/common/TypeTraits.hpp>
6#include <dune/common/typeutilities.hh>
11 template <
class Matrix>
14 using RawMatrix = remove_cvref_t<Matrix>;
17 using size_type =
typename RawMatrix::size_type;
18 using value_type =
typename RawMatrix::value_type;
26 value_type
const& operator[](size_type col)
const
28 return (*mat)[col][row];
32 struct MutableRowProxy
37 value_type& operator[](size_type col)
39 return (*mat)[col][row];
44 template <
class M, Dune::disableCopyMove<TransposedMatrix,M> = 0>
46 : matrix_(FWD(matrix))
49 ConstRowProxy operator[](size_type row)
const
51 return ConstRowProxy{&matrix_, row};
54 template <
class M = Matrix,
55 std::enable_if_t<not std::is_const_v<M>,
int> = 0>
56 MutableRowProxy operator[](size_type row)
58 return MutableRowProxy{&matrix_, row};
74 assert(mat.N() == N());
75 assert(mat.M() == M());
76 for (size_type i = 0; i < N(); ++i)
77 for (size_type j = 0; j < M(); ++j)
78 (*
this)[i][j] += mat[i][j];
87 template <
class Matrix>
88 auto transposed(Matrix&& matrix)
90 using M = std::remove_reference_t<Matrix>;
The transposed view onto a matrix.
Definition: Transposed.hpp:13