// x04db Example Program Text // C# version, NAG Copyright 2008 using System; using NagLibrary; using System.Globalization; namespace NagDotNetExamples { public class X04DBE { const int nmax=4; const int lda=nmax; static void Main(String[] args) { StartExample(); } public static void StartExample() { try { double aa=0.0; int i, indent, j, ncols; Complex[,] a = new Complex[lda, nmax]; string[] clabs = new string[4] {"Un", "Deux", "Trois", "Quatre"}; string[] rlabs = new string[4] {"Uno", "Duo", "Tre", "Quattro"}; int ifail; Console.WriteLine("x04db Example Program Results"); Console.WriteLine(""); // Generate an array of data for (j = 1 ; j <= nmax ; j++) { for (i = 1 ; i <= lda ; i++) { aa = 10 * i + j; a[i - 1 , j - 1] = new Complex(aa, -aa); } } ncols = 80; indent = 0; // // Print 3 by 4 rectangular matrix with default format and integer // row and column labels, and bracketed complex elements X04.x04db("General", "", 3, 4, a, "Bracketed", "", "Example 1:", "Integer", rlabs, "Integer", clabs, ncols, indent, out ifail); // Console.WriteLine(""); // // Print 4 by 4 upper triangular matrix with user-supplied format // and row and column labels, and complex elements with real part // above imaginary part X04.x04db("Upper", "Non-unit", 4, 4, a, "Above", "F8.2", "Example 2:", "Character", rlabs, "Character", clabs, ncols, indent, out ifail); // } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Exception Raised"); } } } }