private static void PwlDerivative(IILState <double> ils, IReadOnlyList <Node> arguments) { if (arguments.Count < 3) { throw new ArgumentMismatchException(3, arguments.Count); } int points = (arguments.Count - 1) / 2; if (arguments.Count % 2 == 0) { throw new ArgumentMismatchException(points * 2 + 1, arguments.Count); } var il = ils.Generator; // Create our array ils.Push(arguments[0]); ils.PushInt(points); il.Emit(OpCodes.Newarr, typeof(Point)); for (var i = 0; i < points; i++) { il.Emit(OpCodes.Dup); // Make another reference to the array ils.PushInt(i); // Set the index // Create the point ils.Push(arguments[i * 2 + 1]); ils.Push(arguments[i * 2 + 2]); il.Emit(OpCodes.Newobj, _point); // Store the element il.Emit(OpCodes.Stelem, typeof(Point)); } il.Emit(OpCodes.Call, _pwlDerivative); }
private static void Nint(IILState <Complex> ils, IReadOnlyList <Node> arguments) { ils.Push(arguments.Check(1)[0]); ils.PushInt(0); ils.Generator.Emit(OpCodes.Call, _round); }