Exemple #1
0
 /**
  * <p>Performs an "in-place" conjugate transpose.</p>
  *
  * @see #transpose(ZMatrixRMaj)
  *
  * @param mat The matrix that is to be transposed. Modified.
  */
 public static void transposeConjugate(ZMatrixRMaj mat)
 {
     if (mat.numCols == mat.numRows)
     {
         TransposeAlgs_ZDRM.squareConjugate(mat);
     }
     else
     {
         ZMatrixRMaj b = new ZMatrixRMaj(mat.numCols, mat.numRows);
         transposeConjugate(mat, b);
         mat.reshape(b.numRows, b.numCols);
         mat.set(b);
     }
 }
Exemple #2
0
        /**
         * <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 ZMatrixRMaj transposeConjugate(ZMatrixRMaj input, ZMatrixRMaj output)
        {
            if (output == null)
            {
                output = new ZMatrixRMaj(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_ZDRM.standardConjugate(input, output);

            return(output);
        }