21 #include <tensor/tensor.h>
25 template<
typename n>
inline
26 const Tensor<n> do_adjoint(
const Tensor<n> &a)
28 assert(a.rank() == 2);
29 index rows = a.rows();
30 index cols = a.columns();
31 Tensor<n> b(cols, rows);
33 typename Tensor<n>::const_iterator ij_a = a.begin();
34 typename Tensor<n>::iterator j_b = b.begin();
35 for (index j = cols; j--; j_b++) {
36 typename Tensor<n>::iterator ji_b = j_b;
37 for (index i = rows; i--; ij_a++, ji_b += cols) {
const RTensor conj(const RTensor &r)
Complex conjugate of a real tensor.