using System; using System.Runtime.InteropServices; using System.Text; using NagCFunctionsAPI; public class NagF08Functions { public static void nag_zheevd ( Nag_OrderType order, Nag_JobType job, Nag_UploType uplo, int n, Complex [,] a, double [] w, ref string error_message, ref int fail_code) { int tda = n; NagError fail = new NagError(); fail.char_array = new char [512]; // fail.print=1; NagFunctions.f08fqc(order, job, uplo, n, a, tda, w, ref fail); string tmpstring = new string(fail.char_array); error_message = tmpstring; fail_code = fail.code; } public static void Main() { int n=4; Nag_OrderType order = Nag_OrderType.Nag_RowMajor; Nag_JobType job = Nag_JobType.Nag_EigVecs; Nag_UploType uplo=Nag_UploType.Nag_Lower; int fail_code=0; String error_message=""; Complex [,] a = new Complex[n,n]; a[0,0].re = 1.0; a[0,0].im = 0.0; a[1,0].re = 2.0; a[1,0].im = 1.0; a[1,1].re = 2.0; a[1,1].im = 0.0; a[2,0].re = 3.0; a[2,0].im = 1.0; a[2,1].re = 3.0; a[2,1].im = 2.0; a[2,2].re = 3.0; a[2,2].im = 0.0; a[3,0].re = 4.0; a[3,0].im = 1.0; a[3,1].re = 4.0; a[3,1].im = 2.0; a[3,2].re = 4.0; a[3,2].im = 3.0; a[3,3].re = 4.0; a[3,3].im = 0.0; double [] w = new double[n]; nag_zheevd (order, job, uplo, n, a, w, ref error_message, ref fail_code); if (fail_code != 0) { Console.WriteLine(error_message); } else { Console.WriteLine("Eigenvalues"); for (int i=0; i