using System; using System.Runtime.InteropServices; using System.Text; using NagCFunctionsAPI; public class NagF02Functions { public static void nag_real_symm_eigenvalues (int n, double [,] a, double [] r, 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.f02aac(n, a, tda, r, ref fail); string tmpstring = new string(fail.char_array); error_message = tmpstring; fail_code = fail.code; } public static void Main() { int n=4; int fail_code=0; String error_message=""; double [,] x = { {0.5, 0.0, 2.3, -2.6}, {0.0, 0.5, -1.4, -0.7}, {2.3, -1.4, 0.5, 0.0}, {-2.6, -0.7, 0.0, 0.5} }; double [] r = new double[n]; nag_real_symm_eigenvalues (n, x, r, ref error_message, ref fail_code); if (fail_code != 0) { Console.WriteLine(error_message); } else { Console.WriteLine("Eigenvalues"); for (int i=0; i