static void Main(string[] args) { { // Verbose version F f = (x, y, z) => { return(x + y + z); }; Fz z5 = Curry(f, 5); int result = z5(1, 3); System.Console.WriteLine("1 + 3 + 5 = {0}", result); } { // Inline version 1 Fz z5 = Curry((x, y, z) => { return(x + y + z); }, 5); int result = z5(1, 3); System.Console.WriteLine("1 + 3 + 5 = {0}", result); } { // Inline version 2 int result = Curry((x, y, z) => { return(x + y + z); }, 5)(1, 3); System.Console.WriteLine("1 + 3 + 5 = {0}", result); } { // Inline version 3 Cz zn = (f, z) => { return((x, y) => { return f(x, y, z); }); }; int result = zn((x, y, z) => { return(x + y + z); }, 5)(1, 3); System.Console.WriteLine("1 + 3 + 5 = {0}", result); } { // Inline version 4 (max obfuscation) int result = ((Cz)((f, z) => { return((x, y) => { return f(x, y, z); }); }))((x, y, z) => { return(x + y + z); }, 5)(1, 3); System.Console.WriteLine("1 + 3 + 5 = {0}", result); } }
public void DoSweep(double H0, double dH) { double h; for (int i = 0; i < files.Count; i++) { h = H0 + i * dH; ovf2 mi = new ovf2(files[i].FullName, false); double fzi = fmrfm.CalculateFz(mi) - (0.00206897 * (h - H0)); H.Add(h); Fz.Add(fzi); } }
public void DoSweep(double H0, double dH, bool propEven) { double h; int num = (files.Count - 1) / 2; for (int i = 0; i < num; i++) { int bg = 2 * i + 1; int real = 2 * i + 2; h = H0 + i * dH; ovf2 m0 = new ovf2(files[bg].FullName, false); ovf2 mi = new ovf2(files[real].FullName, false); double fzi = fmrfm.CalculateFz(m0, mi); H.Add(h); Fz.Add(fzi); } }