// g01rt Example Program Text // C# version, NAG Copyright 2008 using System; using NagLibrary; using System.Globalization; using System.IO; namespace NagDotNetExamples { public class G01RTE { static string datafile = "ExampleData/g01rte.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; bool carryon = true; Console.WriteLine("g01rt Example Program Results"); // Skip heading in data file sr.Reset(); Console.WriteLine(""); Console.WriteLine(" {0}"," x y"); Console.WriteLine(""); while (carryon) { try { sr.Reset(); x = double.Parse(sr.Next(), CultureInfo.InvariantCulture); } catch { break; } // // Compute the value of the derivative of the Landau density function // y = G01.g01rt(x); // Console.WriteLine(" {0,4:f1} {1,12:e4}",x,y); } // } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine( "Exception Raised"); } } } }