// g01da Example Program Text // C# version, NAG Copyright 2008 using System; using NagLibrary; using System.Globalization; using System.IO; namespace NagDotNetExamples { public class G01DAE { static void Main(String[] args) { StartExample(); } public static void StartExample() { try { const int n = 15; double errest, etol; int i, j; double[] pp = new double[n]; int ifail; Console.WriteLine("g01da Example Program Results"); etol = 0.0010e0; for (j = 5; j <= n; j += 5) { // G01.g01da(j, pp, etol, out errest, out ifail); // if (ifail < 0) { Console.WriteLine(""); Console.WriteLine("** g01da failed with ifail = {0,5}", ifail); break; } else { // Console.WriteLine(""); Console.WriteLine(" {0}{1,2}", "Set size = ", j); Console.WriteLine(" {0}{1,13:e3}", "Error tolerance (input) = ", etol); Console.WriteLine(" {0}{1,13:e3}", "Error estimate (output) = ", errest); Console.WriteLine(" {0}", "Normal scores"); Console.WriteLine("\t" + ""); for (i = 1; i <= j; i++) { Console.Write(" {0,7:f3}{1}", pp[i - 1],i%5==0?"\n\t":""); } Console.WriteLine(""); if (ifail != 0) { Console.WriteLine(" {0}{1,5}", "g01da fails with ifail = ", ifail); } } } // } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine( "Exception Raised"); } } } }