using System; using System.Runtime.InteropServices; using NagCFunctionsAPI; public class NagG02Functions { public static void nag_regsn_mult_linear(int mean_int, int n, double [,] x, int m, int [] sx, int ip, double [] y, double [] wt, ref double rss, ref double df, double [] b, double [] se, double [] cov, double [] res, double [] h, double [,] q, ref int svd, ref int rank, double [] p, double tol, double [] com_ar, ref int fail_int) { NagError fail = new NagError(); fail.char_array = new char [512]; int tdx = m; int tdq = ip + 1; NagFunctions.g02dac(mean_int, n, x, tdx, m, sx, ip, y, wt, ref rss, ref df, b, se, cov, res, h, q, tdq, ref svd, ref rank, p, tol, com_ar, ref fail); fail_int = fail.code; if (fail.code != 0) Console.WriteLine(fail.char_array); } public static void Main() { int mean_int = 1358; int n = 12; int m = 4; int fail_int=0; double [,] x = new double [,] { { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 }, { 0.0, 1.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0, 0.0 }, { 0.0, 1.0, 0.0, 0.0 } }; double [] y = new double[] { 33.63, 39.62, 38.18, 41.46, 38.02, 35.83, 35.99, 36.58, 42.92, 37.80, 40.43, 37.89}; int [] sx = new int[m]; for (int i = 0; i