| 83 | * \param batch the batch index (output) |
| 84 | */ |
| 85 | __host__ __device__ CUMAT_STRONG_INLINE void index(Index index, Index& row, Index& col, Index& batch) const |
| 86 | { |
| 87 | if (CUMAT_IS_ROW_MAJOR(Flags)) { |
| 88 | batch = index / (rows() * cols()); |
| 89 | index -= batch * rows() * cols(); |
| 90 | row = index / cols(); |
| 91 | index -= row * cols(); |
| 92 | col = index; |
| 93 | } |
| 94 | else { |
| 95 | batch = index / (rows() * cols()); |
| 96 | index -= batch * rows() * cols(); |
| 97 | col = index / rows(); |
| 98 | index -= col * rows(); |
| 99 | row = index; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * \brief Accesses the coefficient at the specified coordinate for reading and writing. |