/** * <p>Performs an "in-place" conjugate transpose.</p> * * @see #transpose(CMatrixRMaj) * * @param mat The matrix that is to be transposed. Modified. */ public static void transposeConjugate(CMatrixRMaj mat) { if (mat.numCols == mat.numRows) { TransposeAlgs_CDRM.squareConjugate(mat); } else { CMatrixRMaj b = new CMatrixRMaj(mat.numCols, mat.numRows); transposeConjugate(mat, b); mat.reshape(b.numRows, b.numCols); mat.set(b); } }
/** * <p> * Conjugate transposes input matrix 'a' and stores the results in output matrix 'b':<br> * <br> * b-real<sub>i,j</sub> = a-real<sub>j,i</sub><br> * b-imaginary<sub>i,j</sub> = -1*a-imaginary<sub>j,i</sub><br> * where 'b' is the transpose of 'a'. * </p> * * @param input The original matrix. Not modified. * @param output Where the transpose is stored. If null a new matrix is created. Modified. * @return The transposed matrix. */ public static CMatrixRMaj transposeConjugate(CMatrixRMaj input, CMatrixRMaj output) { if (output == null) { output = new CMatrixRMaj(input.numCols, input.numRows); } else if (input.numCols != output.numRows || input.numRows != output.numCols) { throw new ArgumentException("Input and output shapes are not compatible"); } TransposeAlgs_CDRM.standardConjugate(input, output); return(output); }