TransposeConjugate

Транспонирование комплексной матрицы с сопряжением. Разворачивает или переставляет оси матрицы с изменением знака мнимой части комплексного числа, возвращает измененную матрицу.

matrixc matrixc::TransposeConjugate()

Возвращаемое значение

Транспонированная комплексно-сопряжённая матрица.

Примечание

Сопряженную функцию можно применять к вещественным (некомплексным) матрицам и векторам. В этом случае матрица или вектор просто копируются при возврате.

Простой алгоритм транспонирования комплексной матрицы с сопряжением — объяснение метода

//--- Complex matrix transpose function with conjugation
matrixc MatrixTransposeConjugate(const matrixcmatrix_a)
  {
   //--- create a new matrix_c with dimensions inverse to matrix_a
   matrixc matrix_c(matrix_a.Cols(), matrix_a.Rows());
 
   //--- go through all the rows of the new matrix
   for(ulong i=0i<matrix_c.Rows(); i++)
     {
      //--- go through all the columns of the new matrix
      for(ulong j=0j<matrix_c.Cols(); j++)
        {
         //--- transfer the real part of the element by transposing the index
         matrix_c[i][j].real = matrix_a[j][i].real;
         //--- transfer the imaginary part of the element by changing the sign (conjugation)
         matrix_c[i][j].imag = -matrix_a[j][i].imag;
        }
     }
 
    //--- return the transposed matrix with conjugation
    return(matrix_c);
  }