// g01ft Example Program Text // C# version, NAG Copyright 2008 using System; using NagLibrary; using System.Globalization; using System.IO; namespace NagDotNetExamples { public class G01FTE { static string datafile = "ExampleData/g01fte.d"; static void Main(String[] args) { if (args.Length == 1) { datafile = args[0]; } StartExample(); } public static void StartExample() { try { DataReader sr = new DataReader(datafile); double x, y; int ifail; bool carryon = true; Console.WriteLine("g01ft Example Program Results"); // Skip heading in data file sr.Reset(); Console.WriteLine(""); Console.WriteLine(" {0}", " x y ifail"); Console.WriteLine(""); while (carryon) { try { sr.Reset(); x = double.Parse(sr.Next(), CultureInfo.InvariantCulture); } catch { break; } // // Compute the value of the inverse of the Landau distribution function // // y = G01.g01ft(x, out ifail); // if (ifail >= 0) { Console.WriteLine(" {0,4:f1} {1,12:e4}{2,6}", x, y, ifail); continue; } else { Console.WriteLine("** g01ft failed with ifail = {0,5}", ifail); break; } } // } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine( "Exception Raised"); } } } }