// s21bd Example Program Text // C# version, NAG Copyright 2008 using System; using NagLibrary; using System.Globalization; namespace NagDotNetExamples { public class S21BDE { static void Main(String[] args) { StartExample(); } public static void StartExample() { try { PrintManager.Warning = new PrintManager.MessageLogger(discardmessage); double r, rj, x, y, z; int ix, iy, iz; int ifail; Console.WriteLine("s21bd Example Program Results"); Console.WriteLine(""); Console.WriteLine(" {0}", " x y z r s21bd ifail"); Console.WriteLine(""); for (ix = 1; ix <= 3; ix++) { x = ix * 0.50e0; for (iy = ix; iy <= 3; iy++) { y = iy * 0.50e0; for (iz = iy; iz <= 3; iz++) { z = iz * 0.50e0; r = 2.00e0; // rj = S.s21bd(x, y, z, r, out ifail); // if (ifail >= 0) { Console.WriteLine(" {0,7:f2}{1,7:f2}{2,7:f2}{3,7:f2}{4,12:f4}{5,5}", x, y, z, r, rj, ifail); } else { Console.WriteLine("** s21bd failed with ifail = {0,5}", ifail); } } } } // } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine("Exception Raised"); } } static void discardmessage(String message) { } } }