Example: Print a Complex Matrix

A Complex matrix and its transpose is printed.
using System;
using Imsl.Math;

public class ComplexMatrixEx1
{
    public static void  Main(String[] args)
    {
        Complex[,] a = {
            {new Complex(1, 3), new Complex(3, 5), new Complex(7, 9)}, 
            {new Complex(8, 7), new Complex(9, 5), new Complex(1, 9)}, 
            {new Complex(2, 9), new Complex(6, 9), new Complex(7, 3)},
            {new Complex(5, 4), new Complex(8, 4), new Complex(5, 9)}
        };
        
        //    Print the matrix
        new PrintMatrix("Matrix A").Print(a);

        //    Print the transpose of the matrix
        new PrintMatrix("Transpose(A)").Print(ComplexMatrix.Transpose(a));
    }
}

Output

      Matrix A
    0     1     2    
0  1+3i  3+5i  7+9i  
1  8+7i  9+5i  1+9i  
2  2+9i  6+9i  7+3i  
3  5+4i  8+4i  5+9i  

       Transpose(A)
    0     1     2     3    
0  1+3i  8+7i  2+9i  5+4i  
1  3+5i  9+5i  6+9i  8+4i  
2  7+9i  1+9i  7+3i  5+9i  


Link to C# source.