ComplexMatrixInPlaceConjugate Method |
Namespace: Novacta.Analytics
Let be a matrix, and consider its generic entry
where and
are the
number of rows and columns of , respectively.
The conjugate of is the matrix
having rows and
columns, whose generic
entry is:
where is the conjugate of complex .
The method transforms this instance in its conjugate.
In the following example, entries of a matrix are transformed in their corresponding complex conjugates.
using System; using System.Numerics; namespace Novacta.Analytics.CodeExamples { public class ComplexInPlaceConjugateExample0 { public void Main() { // Create a matrix. var data = new Complex[6] { new Complex(1, -1), new Complex(5, -5), new Complex(2, -2), new Complex(6, -6), new Complex(3, -3), new Complex(7, -7) }; var matrix = ComplexMatrix.Dense(3, 2, data, StorageOrder.RowMajor); Console.WriteLine("Initial data matrix:"); Console.WriteLine(matrix); // Transform in the conjugate matrix. matrix.InPlaceConjugate(); Console.WriteLine(); Console.WriteLine("Conjugate data matrix:"); Console.WriteLine(matrix); } } } // Executing method Main() produces the following output: // // Initial data matrix: // ( 1, -1) ( 5, -5) // ( 2, -2) ( 6, -6) // ( 3, -3) ( 7, -7) // // // // Conjugate data matrix: // ( 1, 1) ( 5, 5) // ( 2, 2) ( 6, 6) // ( 3, 3) ( 7, 7) //