| 319 | //! Returns the trace of a square matrix |
| 320 | [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE |
| 321 | T trace () const requires (NRows==NCols) |
| 322 | { |
| 323 | T t = 0; |
| 324 | constexpr_for<StartIndex,NRows+StartIndex>([&] (int i) { t += (*this)(i,i); }); |
| 325 | return t; |
| 326 | } |
| 327 | |
| 328 | //! Operator += performing matrix addition as in (*this) += rhs |
| 329 | AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE |