diff --git a/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs b/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs index 19f4cd2e..55aab668 100644 --- a/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs +++ b/src/NumSharp.Core/Backends/Default/ArrayManipulation/Default.Transpose.cs @@ -9,13 +9,13 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int check_and_adjust_axis(NDArray nd, int axis) { return check_and_adjust_axis(nd.ndim, axis); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int check_and_adjust_axis(int ndims, int axis) { int adjusted = axis >= 0 ? axis : ndims + axis; diff --git a/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs b/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs index 8544ea12..94077dd5 100644 --- a/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs +++ b/src/NumSharp.Core/Backends/Default/Helpers/DefaultEngine.ResolveUnaryReturnType.cs @@ -5,10 +5,10 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public NPTypeCode ResolveUnaryReturnType(in NDArray nd, Type @override) => ResolveUnaryReturnType(nd, @override?.GetTypeCode()); - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public NPTypeCode ResolveUnaryReturnType(in NDArray nd, NPTypeCode? @override) { if (!@override.HasValue) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs index 3872b1f8..5974853b 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Boolean.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddBoolean(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs index ac7a8db8..77d75f25 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Byte.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddByte(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs index 53b2601a..8bcc23c8 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Char.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddChar(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs index a09886f6..69fd4b14 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Decimal.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddDecimal(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs index 331f9b68..e9f5bdf2 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Double.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddDouble(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs index 90363287..45f327f1 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs index 2bc074c5..44689ea3 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs index 7bd79c68..ff6e3e79 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Int64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs index 2b4d4eb2..0c1b5200 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.Single.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddSingle(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs index 5df258fe..0c25ecb1 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddUInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs index fa6f04d4..e89a7b8c 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddUInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs index ce29ff19..3037f12e 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Add/Default.Add.UInt64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray AddUInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs b/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs index 1c1e41ed..492d4f29 100644 --- a/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs +++ b/src/NumSharp.Core/Backends/Default/Math/BLAS/Default.MatMul.2D2D.cs @@ -19,7 +19,7 @@ protected static NDArray MultiplyMatrix(NDArray left, NDArray right, NDArray @ou #else /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.multiply.html [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] protected static NDArray MultiplyMatrix(NDArray left, NDArray right, NDArray @out = null) { Debug.Assert(left.Shape.NDim == 2); diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs index 418f47a5..648f1ddd 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Boolean.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideBoolean(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs index 6a6e3e23..f448d63b 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Byte.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideByte(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs index f4286836..e6fe7330 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Char.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideChar(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs index 6da4ca69..c7ba96e0 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Decimal.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideDecimal(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs index 83eda834..151c0fc2 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Double.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideDouble(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs index ecd1e963..20faf165 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs index 8616f876..735f5111 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs index 12f9ee36..ce6cdc78 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Int64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs index bb5304fa..72137bd1 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.Single.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideSingle(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs index d45c5335..af461bb9 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideUInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs index e8ab4390..0b852776 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideUInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs index d182a73f..537f2f35 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Divide/Default.Divide.UInt64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray DivideUInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs index 5fc5899c..994f7f35 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Boolean.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModBoolean(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs index 0a0a5c78..11d22a62 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Byte.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModByte(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs index c9d1b0c6..ad067530 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Char.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModChar(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs index 42d6b81b..324a4bb7 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Decimal.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModDecimal(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs index c11a1c6c..a686d028 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Double.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModDouble(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs index fc1c15af..22356c32 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs index b1933f80..1c65c62d 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs index 82cca9ed..809fac77 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Int64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs index de2c60ab..2c6fd25a 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.Single.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModSingle(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs index 98f1510a..48357c47 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModUInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs index d6c930b2..ce46c202 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModUInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs index 72c97fc4..52362279 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Mod/Default.Mod.UInt64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray ModUInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs index 2a3a9c78..2af0ceb0 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Boolean.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyBoolean(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs index 813ebbc1..483cd848 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Byte.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyByte(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs index 62207149..924b85a9 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Char.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyChar(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs index b0e4c079..fe8177ed 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Decimal.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyDecimal(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs index c94e7682..8ac47f9c 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Double.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyDouble(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs index 22afa700..37baeec5 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs index 4d211968..39398974 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs index fe43c451..fc4eafb2 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Int64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs index e6a401cd..8395520c 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.Single.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplySingle(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs index ca9f2866..bf0efb3c 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyUInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs index 86038bd0..7be49267 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyUInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs index f5099050..5c021cc7 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Multiply/Default.Multiply.UInt64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyUInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs index 9ca7c7f0..9bf03885 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Boolean.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractBoolean(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs index 419d89e1..bf2b9dab 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Byte.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractByte(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs index d692edae..d0e8dcce 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Char.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractChar(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs index 29f15bc8..70069735 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Decimal.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractDecimal(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs index 8e506696..e16a2b19 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Double.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractDouble(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs index 4fcf5398..f36d68bb 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs index 1a76fb39..b0dc307d 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs index 926bec66..aab2823c 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Int64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs index 65a49ba3..ebe6eaea 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.Single.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractSingle(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs index 9f9e9374..5c266bfe 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt16.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractUInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs index a130fe15..beba776b 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt32.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractUInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs index 8047bee8..a83addf2 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Subtract/Default.Subtract.UInt64.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray SubtractUInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs index aaeeab09..d41dd443 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.Boolean.template.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray MultiplyBoolean(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs index 73a09a48..381d21a3 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.Dot.template.cs @@ -19,7 +19,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray Dot__1__(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs index 1556126c..3268965e 100644 --- a/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs +++ b/src/NumSharp.Core/Backends/Default/Math/Templates/Default.Op.General.template.cs @@ -25,7 +25,7 @@ namespace NumSharp.Backends //v2 public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray __3____1__(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs b/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs index 25045f97..9829193c 100644 --- a/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs +++ b/src/NumSharp.Core/Backends/Iterators/NDIteratorExtensions.cs @@ -14,7 +14,7 @@ public static class NDIteratorExtensions /// /// The ndarray to iterate. /// Should this iterator loop forever? - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDIterator AsIterator(this NDArray nd, bool autoreset = false) where T : unmanaged { return new NDIterator(nd, autoreset); diff --git a/src/NumSharp.Core/Backends/NDArray.String.cs b/src/NumSharp.Core/Backends/NDArray.String.cs index 612c5e53..a5fd2cce 100644 --- a/src/NumSharp.Core/Backends/NDArray.String.cs +++ b/src/NumSharp.Core/Backends/NDArray.String.cs @@ -15,14 +15,14 @@ public partial class NDArray /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray FromString(string str) => np.array(str); /// /// Converts the entire to a string. /// /// Performs a copy due to String .net-framework limitations. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static string AsString(NDArray arr) { unsafe diff --git a/src/NumSharp.Core/Backends/NDArray.cs b/src/NumSharp.Core/Backends/NDArray.cs index 57108d61..ef944200 100644 --- a/src/NumSharp.Core/Backends/NDArray.cs +++ b/src/NumSharp.Core/Backends/NDArray.cs @@ -301,7 +301,7 @@ private NDArray(IArraySlice array, Shape shape) : this(array.TypeCode) /// internal NPTypeCode GetTypeCode { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => Storage.TypeCode; } @@ -310,7 +310,7 @@ internal NPTypeCode GetTypeCode /// protected internal unsafe void* Address { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => Storage.Address; } @@ -371,9 +371,9 @@ public NDArray T /// public Shape Shape { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => Storage.Shape; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] set => Storage.Reshape(value); } @@ -408,7 +408,7 @@ public ArraySlice Data() where T : unmanaged /// Setting does not replace internal storage array. protected internal IArraySlice Array { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => Storage.InternalArray; } @@ -605,7 +605,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public bool GetBoolean(params int[] indices) => Storage.GetBoolean(indices); /// @@ -614,7 +614,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public byte GetByte(params int[] indices) => Storage.GetByte(indices); /// @@ -623,7 +623,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public char GetChar(params int[] indices) => Storage.GetChar(indices); /// @@ -632,7 +632,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public decimal GetDecimal(params int[] indices) => Storage.GetDecimal(indices); /// @@ -641,7 +641,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public double GetDouble(params int[] indices) => Storage.GetDouble(indices); /// @@ -650,7 +650,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public short GetInt16(params int[] indices) => Storage.GetInt16(indices); /// @@ -659,7 +659,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public int GetInt32(params int[] indices) => Storage.GetInt32(indices); /// @@ -668,7 +668,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public long GetInt64(params int[] indices) => Storage.GetInt64(indices); /// @@ -677,7 +677,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public float GetSingle(params int[] indices) => Storage.GetSingle(indices); /// @@ -686,7 +686,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public ushort GetUInt16(params int[] indices) => Storage.GetUInt16(indices); /// @@ -695,7 +695,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public uint GetUInt32(params int[] indices) => Storage.GetUInt32(indices); /// @@ -704,7 +704,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public ulong GetUInt64(params int[] indices) => Storage.GetUInt64(indices); /// @@ -713,7 +713,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public ValueType GetValue(params int[] indices) => Storage.GetValue(indices); /// @@ -722,7 +722,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// The shape's indices to get. /// /// When is not - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public T GetValue(params int[] indices) where T : unmanaged => Storage.GetValue(indices); /// @@ -730,7 +730,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public ValueType GetAtIndex(int index) => Storage.GetAtIndex(index); /// @@ -738,7 +738,7 @@ public NDArray[] GetNDArrays(int axis = 0) /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public T GetAtIndex(int index) where T : unmanaged => Storage.GetAtIndex(index); #endregion @@ -898,7 +898,7 @@ public void ReplaceData(IArraySlice values) /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetAtIndex(object obj, int index) => Storage.SetAtIndex(obj, index); /// @@ -906,7 +906,7 @@ public void ReplaceData(IArraySlice values) /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetAtIndex(T value, int index) where T : unmanaged => Storage.SetAtIndex(value, index); #if _REGEN @@ -916,7 +916,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void Set#1(#2 value, params int[] indices) => Storage.Set#1(value, indices); % @@ -926,7 +926,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetBoolean(bool value, params int[] indices) => Storage.SetBoolean(value, indices); /// @@ -934,7 +934,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetByte(byte value, params int[] indices) => Storage.SetByte(value, indices); /// @@ -942,7 +942,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetInt16(short value, params int[] indices) => Storage.SetInt16(value, indices); /// @@ -950,7 +950,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetUInt16(ushort value, params int[] indices) => Storage.SetUInt16(value, indices); /// @@ -958,7 +958,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetInt32(int value, params int[] indices) => Storage.SetInt32(value, indices); /// @@ -966,7 +966,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetUInt32(uint value, params int[] indices) => Storage.SetUInt32(value, indices); /// @@ -974,7 +974,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetInt64(long value, params int[] indices) => Storage.SetInt64(value, indices); /// @@ -982,7 +982,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetUInt64(ulong value, params int[] indices) => Storage.SetUInt64(value, indices); /// @@ -990,7 +990,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetChar(char value, params int[] indices) => Storage.SetChar(value, indices); /// @@ -998,7 +998,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetDouble(double value, params int[] indices) => Storage.SetDouble(value, indices); /// @@ -1006,7 +1006,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetSingle(float value, params int[] indices) => Storage.SetSingle(value, indices); /// @@ -1014,7 +1014,7 @@ public void ReplaceData(IArraySlice values) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetDecimal(decimal value, params int[] indices) => Storage.SetDecimal(value, indices); #endif diff --git a/src/NumSharp.Core/Backends/NPTypeCode.cs b/src/NumSharp.Core/Backends/NPTypeCode.cs index 6a1b2d04..78584a68 100644 --- a/src/NumSharp.Core/Backends/NPTypeCode.cs +++ b/src/NumSharp.Core/Backends/NPTypeCode.cs @@ -120,7 +120,7 @@ public static NPTypeCode GetTypeCode() /// /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static Type AsType(this NPTypeCode typeCode) { switch (typeCode) @@ -156,7 +156,7 @@ public static Type AsType(this NPTypeCode typeCode) /// Checks if given has a match in . /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static bool IsValidNPType(this Type type) { return type.GetTypeCode() != NPTypeCode.Empty; @@ -169,7 +169,7 @@ public static bool IsValidNPType(this Type type) /// /// The size is computed by [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static int SizeOf(this NPTypeCode typeCode) { switch (typeCode) @@ -205,7 +205,7 @@ public static int SizeOf(this NPTypeCode typeCode) /// Is a float, double, complex or decimal? /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static bool IsRealNumber(this NPTypeCode typeCode) { switch (typeCode) @@ -241,7 +241,7 @@ public static bool IsRealNumber(this NPTypeCode typeCode) /// Is a uint, byte, ulong and so on. /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static bool IsUnsigned(this NPTypeCode typeCode) { switch (typeCode) @@ -277,7 +277,7 @@ public static bool IsUnsigned(this NPTypeCode typeCode) /// Is a float, double, complex or decimal? /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static bool IsSigned(this NPTypeCode typeCode) { switch (typeCode) @@ -313,7 +313,7 @@ public static bool IsSigned(this NPTypeCode typeCode) /// Is a float, double, complex or decimal? /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] internal static int GetGroup(this NPTypeCode typeCode) { switch (typeCode) @@ -355,7 +355,7 @@ internal static int GetGroup(this NPTypeCode typeCode) /// Is a float, double, complex or decimal? /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] internal static int GetPriority(this NPTypeCode typeCode) { switch (typeCode) @@ -395,7 +395,7 @@ internal static int GetPriority(this NPTypeCode typeCode) /// Gets NumSharp's equivalent of /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] internal static NPTypeCode ToTypeCode(this NPY_TYPECHAR typeCode) { switch (typeCode) @@ -465,7 +465,7 @@ internal static NPTypeCode ToTypeCode(this NPY_TYPECHAR typeCode) /// Gets NumSharp's equivalent of /// [DebuggerNonUserCode] - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] internal static NPY_TYPECHAR ToTYPECHAR(this NPTypeCode typeCode) { switch (typeCode) diff --git a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs index 29f41c0f..4aead90a 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice.cs @@ -90,116 +90,116 @@ public static ArraySlice Scalar(T val) where T : unmanaged return new ArraySlice(UnmanagedMemoryBlock.FromPool(_buffer)) {[0] = val}; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromArray(T[,,,,,,,,,,,,,,,] array, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromArray(array, copy)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromBuffer(byte[] arr, bool copy = false) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromBuffer(arr, copy)); } /// The length in objects of and not in bytes. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ArraySlice FromPool(StackedMemoryPool pool) where T : unmanaged { return new ArraySlice(UnmanagedMemoryBlock.FromPool(pool)); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static IArraySlice FromArray(Array arr, bool copy = false) { var elementType = arr.GetType().GetElementType(); @@ -235,7 +235,7 @@ public static IArraySlice FromArray(Array arr, bool copy = false) } } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static IArraySlice FromMemoryBlock(IMemoryBlock block, bool copy = false) { if (block is IArraySlice arr) diff --git a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs index 5e6e8ba0..ab45a6f9 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/ArraySlice`1.cs @@ -43,7 +43,7 @@ namespace NumSharp.Backends.Unmanaged public int ItemLength { - [MethodImpl((MethodImplOptions)768)] get => InfoOf.Size; + [MethodImpl(OptimizeAndInline)] get => InfoOf.Size; } #region Construction @@ -124,13 +124,13 @@ object IArraySlice.this[int index] /// public T this[int index] { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] get { Debug.Assert(index < Count, "index < Count, Memory corruption expected."); return *(Address + index); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] set { Debug.Assert(index < Count, "index < Count, Memory corruption expected."); @@ -138,20 +138,20 @@ public T this[int index] } } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public T GetIndex(int index) { return *(Address + index); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void SetIndex(int index, object value) { Debug.Assert(index < Count, "index < Count, Memory corruption expected."); *(Address + index) = (T)value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void SetIndex(int index, T value) { Debug.Assert(index < Count, "index < Count, Memory corruption expected."); @@ -160,7 +160,7 @@ public void SetIndex(int index, T value) #endregion - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public bool Contains(T item) { bool equals = false; @@ -179,7 +179,7 @@ public bool Contains(T item) } /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void Fill(T value) { if (Unsafe.SizeOf() == 1) @@ -233,7 +233,7 @@ public void Fill(T value) /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public ArraySlice Slice(int start) { if ((uint)start > (uint)Count) @@ -245,7 +245,7 @@ public ArraySlice Slice(int start) /// /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public ArraySlice Slice(int start, int length) { #if BIT64 @@ -275,7 +275,7 @@ public bool TryCopyTo(Span destination) } /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void CopyTo(Span destination) { if ((uint)Count <= (uint)destination.Length) @@ -293,7 +293,7 @@ public void CopyTo(Span destination) /// /// The address to copy to /// The destiniton has to be atleast the size of this array, otherwise memory corruption is likely to occur. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void CopyTo(IntPtr dst) { // Using "if (!TryCopyTo(...))" results in two branches: one for the length @@ -308,7 +308,7 @@ public void CopyTo(IntPtr dst) /// /// The address to copy to /// The destiniton has to be atleast the size of this array, otherwise memory corruption is likely to occur. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void CopyTo(IntPtr dst, int sourceOffset, int sourceCount) { // Using "if (!TryCopyTo(...))" results in two branches: one for the length @@ -320,7 +320,7 @@ public void CopyTo(IntPtr dst, int sourceOffset, int sourceCount) /// /// offset of source via count (not bytes) - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void CopyTo(Span destination, int sourceOffset) { CopyTo(destination, sourceOffset, Count - sourceOffset); @@ -329,18 +329,18 @@ public void CopyTo(Span destination, int sourceOffset) /// /// offset of source via count (not bytes) /// How many items to copy - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void CopyTo(Span destination, int sourceOffset, int sourceLength) { CopyTo(destination, sourceOffset, sourceLength); } [EditorBrowsable(EditorBrowsableState.Never)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public ref T GetPinnableReference() => ref Unsafe.AsRef(Address); - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public ArraySlice Clone() => new ArraySlice(UnmanagedMemoryBlock.Copy(Address, Count)); @@ -353,14 +353,14 @@ Span IArraySlice.AsSpan() return new Span(VoidAddress, Count); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] TRet IArraySlice.GetIndex(int index) { Debug.Assert(InfoOf.Size == InfoOf.Size); return *((TRet*)VoidAddress + index); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] void IArraySlice.SetIndex(int index, TVal value) { Debug.Assert(InfoOf.Size == InfoOf.Size); @@ -368,7 +368,7 @@ void IArraySlice.SetIndex(int index, TVal value) *((TVal*)VoidAddress + index) = value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] object IArraySlice.GetIndex(int index) { Debug.Assert(index < Count, "index < Count, Memory corruption expected."); @@ -412,7 +412,7 @@ void IArraySlice.CopyTo(Span destination) /// ref T1 IArraySlice.GetPinnableReference() => ref Unsafe.AsRef(VoidAddress); - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] IArraySlice IArraySlice.Clone() => new ArraySlice(UnmanagedMemoryBlock.Copy(Address, Count)); ArraySlice IArraySlice.Clone() => new ArraySlice(UnmanagedMemoryBlock.Copy(Address, Count)); @@ -424,7 +424,7 @@ void IArraySlice.CopyTo(Span destination) /// unsafe void* IMemoryBlock.Address { - [MethodImpl((MethodImplOptions)768)] get => VoidAddress; + [MethodImpl(OptimizeAndInline)] get => VoidAddress; } /// @@ -433,7 +433,7 @@ unsafe void* IMemoryBlock.Address /// long IMemoryBlock.Count { - [MethodImpl((MethodImplOptions)768)] get => Count; + [MethodImpl(OptimizeAndInline)] get => Count; } /// @@ -442,7 +442,7 @@ long IMemoryBlock.Count /// Calculated by * long IMemoryBlock.BytesLength { - [MethodImpl((MethodImplOptions)768)] get => Count * InfoOf.Size; + [MethodImpl(OptimizeAndInline)] get => Count * InfoOf.Size; } /// @@ -450,12 +450,12 @@ long IMemoryBlock.BytesLength /// NPTypeCode IMemoryBlock.TypeCode { - [MethodImpl((MethodImplOptions)768)] get => TypeCode; + [MethodImpl(OptimizeAndInline)] get => TypeCode; } IMemoryBlock IArraySlice.MemoryBlock { - [MethodImpl((MethodImplOptions)768)] get => MemoryBlock; + [MethodImpl(OptimizeAndInline)] get => MemoryBlock; } /// @@ -486,7 +486,7 @@ public void DangerousFree() /// allocates, so should generally be avoided, however it is sometimes /// necessary to bridge the gap with APIs written in terms of arrays. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public T[] ToArray() { if (Count == 0) diff --git a/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs b/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs index 65d9d971..c3ee779a 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/Pooling/StackedMemoryPool.cs @@ -128,7 +128,7 @@ public unsafe void Return(IntPtr x) #region Garbage Collection - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private void tryStartGC() { //try start GC @@ -139,7 +139,7 @@ private void tryStartGC() _runGC(GarbageCollectionDelay); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private void _runGC(int delay, int restarts = 0) { //assinging to prevent GC from collecting. diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs index 4ce85a04..3975a91d 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock.Casting.cs @@ -14,7 +14,7 @@ public static partial class UnmanagedMemoryBlock /// The type to cast this memory block to. /// /// Returns a copy. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static IMemoryBlock CastTo(this IMemoryBlock source, NPTypeCode to) { switch (to) @@ -63,7 +63,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source, NPTypeCode to) /// /// /// Returns a copy. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static IMemoryBlock CastTo(this IMemoryBlock source) where TOut : unmanaged { switch (source.TypeCode) @@ -99,7 +99,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source) where TO /// /// /// Returns a copy. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static IMemoryBlock CastTo(this IMemoryBlock source) where TIn : unmanaged where TOut : unmanaged { unsafe @@ -124,7 +124,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source /// /// /// Returns a copy. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static IMemoryBlock CastTo(this IMemoryBlock source) where TIn : unmanaged where TOut : unmanaged { unsafe @@ -1180,7 +1180,7 @@ public static IMemoryBlock CastTo(this IMemoryBlock source) whe /// /// /// Returns a copy. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static unsafe void CastTo(this IMemoryBlock source, IMemoryBlock @out, int? bytesOffset = null, int? countOffset = null) { var len = source.Count; diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs index aeb88aa1..fc1414a3 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedMemoryBlock`1.cs @@ -24,7 +24,7 @@ public unsafe struct UnmanagedMemoryBlock : IUnmanagedMemoryBlock, IMemoryBlo /// /// The length in objects of and not in bytes. /// Does claim ownership since allocation is publicly. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public UnmanagedMemoryBlock(long count) { var bytes = BytesCount = count * InfoOf.Size; @@ -40,7 +40,7 @@ public UnmanagedMemoryBlock(long count) /// /// The length in objects of and not in bytes. /// Does claim ownership. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public UnmanagedMemoryBlock(T* ptr, long count) { _disposer = Disposer.Null; @@ -56,7 +56,7 @@ public UnmanagedMemoryBlock(T* ptr, long count) /// The length in objects of and not in bytes. /// /// Does claim ownership. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public UnmanagedMemoryBlock(T* start, long count, Action dispose) { Count = count; @@ -71,7 +71,7 @@ public UnmanagedMemoryBlock(T* start, long count, Action dispose) /// /// The length in objects of and not in bytes. /// Does claim ownership. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public UnmanagedMemoryBlock(GCHandle handle, long count) { Count = count; @@ -87,7 +87,7 @@ public UnmanagedMemoryBlock(GCHandle handle, long count) /// The length in objects of and not in bytes. /// /// Does claim ownership. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public UnmanagedMemoryBlock(GCHandle handle, long count, Action dispose) { Count = count; @@ -101,7 +101,7 @@ public UnmanagedMemoryBlock(GCHandle handle, long count, Action dispose) /// /// The length in objects of and not in bytes. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public UnmanagedMemoryBlock(long count, T fill) : this(count) { Fill(fill, 0, count); @@ -111,13 +111,13 @@ public UnmanagedMemoryBlock(long count, T fill) : this(count) #region FromArray - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[] arr, bool copy) { if (!copy) @@ -132,13 +132,13 @@ public static UnmanagedMemoryBlock FromArray(T[] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,] arr, bool copy) { if (!copy) @@ -153,13 +153,13 @@ public static UnmanagedMemoryBlock FromArray(T[,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,] arr, bool copy) { if (!copy) @@ -174,13 +174,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,] arr, bool copy) { if (!copy) @@ -195,13 +195,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,] arr, bool copy) { if (!copy) @@ -216,13 +216,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,] arr, bool copy) { if (!copy) @@ -237,13 +237,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,] arr, bool copy) { if (!copy) @@ -258,13 +258,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,] arr, bool copy) { if (!copy) @@ -279,13 +279,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,] arr, bool copy) { if (!copy) @@ -300,13 +300,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,] arr, bool copy) { if (!copy) @@ -321,13 +321,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,] arr, bool copy) { if (!copy) @@ -342,13 +342,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,] arr, bool copy) { if (!copy) @@ -363,13 +363,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,] arr, bool copy) { if (!copy) @@ -385,13 +385,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,] arr, bool copy) } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,] arr, bool copy) { if (!copy) @@ -406,13 +406,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,] arr, bool copy) return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,] arr, bool copy) { if (!copy) @@ -427,13 +427,13 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,] arr, bool copy return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,,] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,,] arr, bool copy) { if (!copy) @@ -450,19 +450,19 @@ public static UnmanagedMemoryBlock FromArray(T[,,,,,,,,,,,,,,,] arr, bool cop #endregion - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromBuffer(byte[] arr) { return new UnmanagedMemoryBlock(GCHandle.Alloc(arr, GCHandleType.Pinned), arr.Length / InfoOf.Size); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromBuffer(byte[] arr, bool copy) { return new UnmanagedMemoryBlock(GCHandle.Alloc(copy ? arr.Clone() : arr, GCHandleType.Pinned), arr.Length / InfoOf.Size); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock FromPool(StackedMemoryPool manager) { Debug.Assert(manager.SingleSize / InfoOf.Size > 0); @@ -470,7 +470,7 @@ public static UnmanagedMemoryBlock FromPool(StackedMemoryPool manager) return new UnmanagedMemoryBlock((T*)buffer, 1, () => manager.Return(buffer)); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock Copy(UnmanagedMemoryBlock source) { var itemCount = source.Count; @@ -487,7 +487,7 @@ public static UnmanagedMemoryBlock Copy(UnmanagedMemoryBlock source) /// The address of the first /// How many to copy, not how many bytes. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock Copy(void* address, int count) { var len = count * InfoOf.Size; @@ -503,7 +503,7 @@ public static UnmanagedMemoryBlock Copy(void* address, int count) /// /// How many to copy, not how many bytes. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock Copy(IntPtr address, int count) { return Copy((void*)address, count); @@ -515,7 +515,7 @@ public static UnmanagedMemoryBlock Copy(IntPtr address, int count) /// The address of the first /// How many to copy, not how many bytes. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static UnmanagedMemoryBlock Copy(T* address, int count) { return Copy((void*)address, count); @@ -525,11 +525,11 @@ public static UnmanagedMemoryBlock Copy(T* address, int count) public T this[int index] { - [MethodImpl((MethodImplOptions)768)] get => *(Address + index); - [MethodImpl((MethodImplOptions)768)] set => *(Address + index) = value; + [MethodImpl(OptimizeAndInline)] get => *(Address + index); + [MethodImpl(OptimizeAndInline)] set => *(Address + index) = value; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public void Reallocate(long length, bool copyOldValues = false) { if (copyOldValues) @@ -548,7 +548,7 @@ public void Reallocate(long length, bool copyOldValues = false) } } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public void Reallocate(long length, T fill, bool copyOldValues = false) { if (copyOldValues) @@ -576,7 +576,7 @@ public void Reallocate(long length, T fill, bool copyOldValues = false) /// /// Fills the contents of this span with the given value. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void Fill(T value) { if (Count == 0) @@ -631,7 +631,7 @@ public void Fill(T value) /// /// Fills the contents of this span with the given value. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void Fill(T value, long offset, long count) { if (Count == 0 || count == 0) @@ -686,74 +686,74 @@ public void Fill(T value, long offset, long count) } } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public T GetIndex(int index) { return *(Address + index); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public ref T GetRefTo(int index) { return ref *(Address + index); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void SetIndex(int index, ref T value) { *(Address + index) = value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void SetIndex(int index, T value) { *(Address + index) = value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public T GetIndex(long index) { return *(Address + index); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public ref T GetRefTo(long index) { return ref *(Address + index); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void SetIndex(long index, ref T value) { *(Address + index) = value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void SetIndex(long index, T value) { *(Address + index) = value; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public void Free() { _disposer.Dispose(); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public IEnumerator GetEnumerator() { for (var i = 0; i < Count; i++) yield return GetIndex(i); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public bool Contains(T item) { long len = Count; @@ -765,7 +765,7 @@ public bool Contains(T item) return false; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public void CopyTo(T[] array, int arrayIndex) { long len = Count; @@ -775,14 +775,14 @@ public void CopyTo(T[] array, int arrayIndex) } } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public void CopyTo(UnmanagedMemoryBlock memoryBlock, long arrayIndex) { //TODO! at netcore 3, AsSpan.CopyTo might be faster. Buffer.MemoryCopy(Address + arrayIndex, memoryBlock.Address, InfoOf.Size * memoryBlock.Count, InfoOf.Size * (Count - arrayIndex)); } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public void CopyTo(T* array, long arrayIndex, long lengthToCopy) { //TODO! at netcore 3, AsSpan.CopyTo might be faster. @@ -799,7 +799,7 @@ public void CopyTo(T* array, long arrayIndex, long lengthToCopy) /// is less than zero. /// /// is multidimensional.-or- The number of elements in the source is greater than the available space from to the end of the destination .-or-The type of the source cannot be cast automatically to the type of the destination . - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public void CopyTo(Array array, int arrayIndex) { if (!(array is T[] arr)) @@ -874,7 +874,7 @@ object ICloneable.Clone() /// An object to compare with this object. /// /// if the current object is equal to the parameter; otherwise, . - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public bool Equals(UnmanagedMemoryBlock other) { return Count == other.Count && Address == other.Address; @@ -884,7 +884,7 @@ public bool Equals(UnmanagedMemoryBlock other) /// The object to compare with the current instance. /// /// if and this instance are the same type and represent the same value; otherwise, . - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public override bool Equals(object obj) { return obj is UnmanagedMemoryBlock other && Equals(other); @@ -892,7 +892,7 @@ public override bool Equals(object obj) /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public override int GetHashCode() { unchecked @@ -905,7 +905,7 @@ public override int GetHashCode() /// The first value to compare. /// The second value to compare. /// true if the and parameters have the same value; otherwise, false. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static bool operator ==(UnmanagedMemoryBlock left, UnmanagedMemoryBlock right) { return left.Equals(right); @@ -915,7 +915,7 @@ public override int GetHashCode() /// The first value to compare. /// The second value to compare. /// true if and are not equal; otherwise, false. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static bool operator !=(UnmanagedMemoryBlock left, UnmanagedMemoryBlock right) { return !left.Equals(right); @@ -981,7 +981,7 @@ private Disposer() _type = AllocationType.Wrap; } - [MethodImpl((MethodImplOptions)768), SuppressMessage("ReSharper", "PossibleInvalidOperationException")] + [MethodImpl(OptimizeAndInline), SuppressMessage("ReSharper", "PossibleInvalidOperationException")] private void ReleaseUnmanagedResources() { if (Disposed) diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs index e0188911..e5ee978d 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Getters.cs @@ -76,7 +76,7 @@ public unsafe ValueType GetAtIndex(int index) #endif } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public unsafe T GetAtIndex(int index) where T : unmanaged => *((T*)Address + _shape.TransformOffset(index)); /// @@ -111,7 +111,7 @@ public unsafe ValueType GetAtIndex(int index) /// /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public UnmanagedStorage GetData(params int[] indices) { var this_shape = Shape; @@ -173,7 +173,7 @@ public UnmanagedStorage GetData(params int[] indices) /// /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public unsafe UnmanagedStorage GetData(int* dims, int ndims) { var this_shape = Shape; @@ -253,7 +253,7 @@ public T GetValue(params int[] indices) where T : unmanaged /// Get reference to internal data storage /// /// reference to internal storage as System.Array - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public IArraySlice GetData() => InternalArray; #if _REGEN #region Direct Getters diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs index 5a078cc4..5d8f1229 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Reshaping.cs @@ -51,7 +51,7 @@ public void Reshape(int[] dimensions, bool @unsafe) /// /// If shape's size mismatches current shape size. /// If 's size == 0 - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void Reshape(Shape newShape, bool @unsafe = false) { Reshape(ref newShape, @unsafe); @@ -62,7 +62,7 @@ public void Reshape(Shape newShape, bool @unsafe = false) /// /// If shape's size mismatches current shape size. /// If 's size == 0 - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public void Reshape(ref Shape newShape, bool @unsafe = false) { // NumPy behavior: non-contiguous arrays require a copy when reshaping diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs index 55cd7852..368dfb8b 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Setters.cs @@ -15,7 +15,7 @@ public partial class UnmanagedStorage /// Throws if the underlying shape is not writeable (e.g., broadcast arrays). /// NumPy raises: ValueError: assignment destination is read-only /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private void ThrowIfNotWriteable() { NumSharpException.ThrowIfNotWriteable(_shape); @@ -325,7 +325,7 @@ public void SetData(IArraySlice value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void Set#1(#2 value, params int[] indices) { unsafe { @@ -340,7 +340,7 @@ public void SetData(IArraySlice value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetBoolean(bool value, params int[] indices) { ThrowIfNotWriteable(); @@ -355,7 +355,7 @@ public void SetBoolean(bool value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetByte(byte value, params int[] indices) { ThrowIfNotWriteable(); @@ -370,7 +370,7 @@ public void SetByte(byte value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetInt16(short value, params int[] indices) { ThrowIfNotWriteable(); @@ -385,7 +385,7 @@ public void SetInt16(short value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetUInt16(ushort value, params int[] indices) { ThrowIfNotWriteable(); @@ -400,7 +400,7 @@ public void SetUInt16(ushort value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetInt32(int value, params int[] indices) { ThrowIfNotWriteable(); @@ -415,7 +415,7 @@ public void SetInt32(int value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetUInt32(uint value, params int[] indices) { ThrowIfNotWriteable(); @@ -430,7 +430,7 @@ public void SetUInt32(uint value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetInt64(long value, params int[] indices) { ThrowIfNotWriteable(); @@ -445,7 +445,7 @@ public void SetInt64(long value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetUInt64(ulong value, params int[] indices) { ThrowIfNotWriteable(); @@ -460,7 +460,7 @@ public void SetUInt64(ulong value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetChar(char value, params int[] indices) { ThrowIfNotWriteable(); @@ -475,7 +475,7 @@ public void SetChar(char value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetDouble(double value, params int[] indices) { ThrowIfNotWriteable(); @@ -490,7 +490,7 @@ public void SetDouble(double value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetSingle(float value, params int[] indices) { ThrowIfNotWriteable(); @@ -505,7 +505,7 @@ public void SetSingle(float value, params int[] indices) /// /// The values to assign /// The coordinates to set at. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void SetDecimal(decimal value, params int[] indices) { ThrowIfNotWriteable(); @@ -523,7 +523,7 @@ public void SetDecimal(decimal value, params int[] indices) /// /// /// Copies values only if type does not match and doesn't change shape. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void ReplaceData(Array values) { if (values == null) @@ -637,7 +637,7 @@ public void ReplaceData(NDArray nd) /// /// The shape to set in this storage. (without checking if shape matches storage) /// Copies values only if type does not match and doesn't change shape. Doesn't check if shape size matches. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public void ReplaceData(Array values, Shape shape) { if (values == null) diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs index d6b73a30..45701506 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.Slicing.cs @@ -11,10 +11,10 @@ public partial class UnmanagedStorage { #region Slicing - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public UnmanagedStorage GetView(string slicing_notation) => GetView(Slice.ParseSlices(slicing_notation)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public UnmanagedStorage GetView(params Slice[] slices) { if (slices == null) @@ -57,7 +57,7 @@ public UnmanagedStorage GetView(params Slice[] slices) return GetViewInternal(slices); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] [SuppressMessage("ReSharper", "PossibleInvalidOperationException")] private UnmanagedStorage GetViewInternal(params Slice[] slices) { diff --git a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs index 2e9b6e6d..e41b1447 100644 --- a/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs +++ b/src/NumSharp.Core/Backends/Unmanaged/UnmanagedStorage.cs @@ -1455,7 +1455,7 @@ public unsafe void CopyTo(T[] array) where T : unmanaged } } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public unsafe T[] ToArray() where T : unmanaged { if (typeof(T).GetTypeCode() != InternalArray.TypeCode) diff --git a/src/NumSharp.Core/Creation/NdArray.Scalar.cs b/src/NumSharp.Core/Creation/NdArray.Scalar.cs index d8930fda..8f669688 100644 --- a/src/NumSharp.Core/Creation/NdArray.Scalar.cs +++ b/src/NumSharp.Core/Creation/NdArray.Scalar.cs @@ -14,7 +14,7 @@ public partial class NDArray /// The type of the scalar. /// /// In case when is not , will be called. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray Scalar(object value, Type dtype) { return new NDArray(UnmanagedStorage.Scalar(Converts.ChangeType(value, dtype.GetTypeCode()))); @@ -26,7 +26,7 @@ public static NDArray Scalar(object value, Type dtype) /// The value of the scalar /// /// In case when is not , will be called. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray Scalar(object value) { return new NDArray(UnmanagedStorage.Scalar(value)); @@ -38,7 +38,7 @@ public static NDArray Scalar(object value) /// The value of the scalar /// /// In case when is not , will be called. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray Scalar(ValueType value) { return new NDArray(UnmanagedStorage.Scalar(value)); @@ -50,7 +50,7 @@ public static NDArray Scalar(ValueType value) /// The value of the scalar /// /// In case when is not , will be called. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray Scalar(T value) where T : unmanaged { return new NDArray(UnmanagedStorage.Scalar(value)); @@ -62,7 +62,7 @@ public static NDArray Scalar(T value) where T : unmanaged /// The value of the scalar, attempt to convert will be performed /// /// In case when is not , will be called. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray Scalar(object value) where T : unmanaged { return new NDArray(UnmanagedStorage.Scalar(value as T? ?? Converts.ChangeType(value))); @@ -75,7 +75,7 @@ public static NDArray Scalar(object value) where T : unmanaged /// The type code of the scalar. /// /// In case when is not , will be called. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray Scalar(object value, NPTypeCode typeCode) { return new NDArray(UnmanagedStorage.Scalar(value, typeCode)); diff --git a/src/NumSharp.Core/Creation/np.array.cs b/src/NumSharp.Core/Creation/np.array.cs index 99a5d664..2306487e 100644 --- a/src/NumSharp.Core/Creation/np.array.cs +++ b/src/NumSharp.Core/Creation/np.array.cs @@ -20,7 +20,7 @@ public static partial class np /// /// /// If is true then returns a clone. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static NDArray array(NDArray nd, bool copy = false) => copy ? new NDArray(nd.Storage.Clone()) : new NDArray(nd.Storage); /// @@ -30,7 +30,7 @@ public static partial class np /// Always copies if the array is larger than 1-d. /// Not used. /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] [SuppressMessage("ReSharper", "InvalidXmlDocComment")] public static NDArray array(Array array, Type dtype = null, int ndmin = 1, bool copy = true, char order = 'C') { @@ -127,7 +127,7 @@ public static NDArray array(IEnumerable data, int size) where T : unmanage /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray array(string chars) { if (chars == null) @@ -159,7 +159,7 @@ public static NDArray array(string chars) /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html

Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")] [SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")] - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static NDArray array(T[][] data) where T : unmanaged { unsafe @@ -197,7 +197,7 @@ public static NDArray array(T[][] data) where T : unmanaged /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html

Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")] [SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")] - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static NDArray array(T[][][] data) where T : unmanaged { unsafe @@ -242,7 +242,7 @@ public static NDArray array(T[][][] data) where T : unmanaged /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html

Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")] [SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")] - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static NDArray array(T[][][][] data) where T : unmanaged { unsafe @@ -294,7 +294,7 @@ public static NDArray array(T[][][][] data) where T : unmanaged /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html

Always performs a copy.
[SuppressMessage("ReSharper", "SuggestVarOrType_SimpleTypes")] [SuppressMessage("ReSharper", "SuggestVarOrType_Elsewhere")] - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static NDArray array(T[][][][][] data) where T : unmanaged { unsafe diff --git a/src/NumSharp.Core/Creation/np.array.string.cs b/src/NumSharp.Core/Creation/np.array.string.cs index c2c54b09..5f8d43fc 100644 --- a/src/NumSharp.Core/Creation/np.array.string.cs +++ b/src/NumSharp.Core/Creation/np.array.string.cs @@ -17,7 +17,7 @@ public static partial class np /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static NDArray array(string[] strArray) { if (strArray == null) diff --git a/src/NumSharp.Core/Exceptions/NumSharpException.cs b/src/NumSharp.Core/Exceptions/NumSharpException.cs index ecc1f58e..f46df0c1 100644 --- a/src/NumSharp.Core/Exceptions/NumSharpException.cs +++ b/src/NumSharp.Core/Exceptions/NumSharpException.cs @@ -34,7 +34,7 @@ public NumSharpException(string message, Exception innerException) : base(messag /// NumPy raises: ValueError: assignment destination is read-only /// NumSharp raises: NumSharpException: assignment destination is read-only /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static void ThrowIfNotWriteable(in Shape shape, string name = "assignment destination") { if (!shape.IsWriteable) diff --git a/src/NumSharp.Core/Generics/NDArray`1.cs b/src/NumSharp.Core/Generics/NDArray`1.cs index cb9b14a1..98f18d50 100644 --- a/src/NumSharp.Core/Generics/NDArray`1.cs +++ b/src/NumSharp.Core/Generics/NDArray`1.cs @@ -146,9 +146,9 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh /// protected internal new ArraySlice Array { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => Storage.GetData(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] set => Storage.ReplaceData(value); } @@ -157,13 +157,13 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh /// protected internal new unsafe TDType* Address { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => (TDType*)Storage.Address; } public new TDType this[params int[] indices] { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get { if (Shape.IsScalar && indices.Length != 1 || !Shape.IsScalar && indices.Length != ndim) @@ -171,7 +171,7 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh return Storage.GetValue(indices); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] set { if (Shape.IsScalar && indices.Length != 1 || !Shape.IsScalar && indices.Length != ndim) @@ -187,13 +187,13 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh /// public new NDArray this[string slice] { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get { return base[slice].MakeGeneric(); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] set { base[slice] = value; @@ -206,10 +206,10 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh /// public new NDArray this[params Slice[] slices] { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => base[slices].MakeGeneric(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] set => base[slices] = value; } @@ -248,10 +248,10 @@ public NDArray(Shape shape, bool fillZeros) : base(InfoOf.NPTypeCode, sh } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static implicit operator ArraySlice(NDArray nd) => nd.Array; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static explicit operator NDArray(TDType[] tArray) => new NDArray(tArray).MakeGeneric(); } diff --git a/src/NumSharp.Core/GlobalUsings.cs b/src/NumSharp.Core/GlobalUsings.cs new file mode 100644 index 00000000..ff1cbf9a --- /dev/null +++ b/src/NumSharp.Core/GlobalUsings.cs @@ -0,0 +1 @@ +global using static NumSharp.MethodImplOptionsConstants; diff --git a/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs b/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs index fa324404..ef077cfc 100644 --- a/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs +++ b/src/NumSharp.Core/LinearAlgebra/np.linalg.norm.cs @@ -1,222 +1,222 @@ -using System; -using System.Numerics; -using NumSharp.Utilities; - -namespace NumSharp -{ - public static partial class np - { - public static partial class linalg - { - /// - /// Matrix or vector norm. - /// This function is able to return one of seven different matrix norms, - /// or one of an infinite number of vector norms(described below), depending - /// on the value of the ``ord`` parameter. - /// - /// Input array. If `axis` is None, `x` must be 1-D or 2-D. - /// non-zero int, "inf", "-inf" or "fro", optional - /// Order of the norm(see table under ``Notes``). - /// int, 2-tuple of ints int[], null}, optional - /// If `axis` is an integer, it specifies the axis of `x` along which to - /// compute the vector norms.If `axis` is a 2-tuple, it specifies the - /// axes that hold 2-D matrices, and the matrix norms of these matrices - /// are computed.If `axis` is None then either a vector norm (when `x` - /// is 1-D) or a matrix norm(when `x` is 2-D) is returned. - /// - /// Norm of the matrix or vector(s) as double or NDArray. - /// - /// - /// Notes: - /// ----- - /// For values of ``ord <= 0``, the result is, strictly speaking, not a - /// mathematical 'norm', but it may still be useful for various numerical - /// purposes. - /// The following norms can be calculated: - /// ===== ============================ ========================== - /// ord norm for matrices norm for vectors - /// ===== ============================ ========================== - /// None Frobenius norm 2-norm - /// 'fro' Frobenius norm -- - /// inf max(sum(abs(x), axis= 1)) max(abs(x)) - /// -inf min(sum(abs(x), axis= 1)) min(abs(x)) - /// 0 -- sum(x != 0) - /// 1 max(sum(abs(x), axis= 0)) as below - /// -1 min(sum(abs(x), axis= 0)) as below - /// 2 2-norm(largest sing. value) as below - /// -2 smallest singular value as below - /// other -- sum(abs(x) ** ord)**(1./ord) - /// ===== ============================ ========================== - /// The Frobenius norm is given by[1]_: - /// :math:`||A||_F = [\\sum_{i, j} - /// abs(a_{ i,j})^2]^{1/2}` - /// References - /// ---------- - /// .. [1] G.H.Golub and C.F.Van Loan, *Matrix Computations*, - /// Baltimore, MD, Johns Hopkins University Press, 1985, pg. 15 - /// - private static object norm(NDArray x, object ord = null, object axis_obj = null) - { - // Check the default case first and handle it immediately. - if (ord == null && axis_obj == null) - { - x = x.ravel(); // order = 'K' - NDArray sqnorm = null; - if (x.dtype == typeof(Complex)) - // Python: sqnorm = dot(x.real, x.real) + dot(x.imag, x.imag) - throw new NotImplementedException("Complex is not implemented yet"); - else - sqnorm = dot(x, x); - return sqrt(sqnorm); - } - - // Normalize the `axis` argument to a tuple. - var dim = x.ndim; - int[] axis = null; - if (axis_obj == null) - axis = py.range(dim); - else if (axis_obj is int) - axis = new int[] {(int)axis_obj}; - else if (axis_obj is int[]) - axis = (int[])axis_obj; - else - throw new ArgumentException($"Invalid axis type: {axis_obj}"); -// if (axis.Length == 1) -// { -// if ((string)ord == "inf") -// return abs(x).max(axis = axis); -// elif ord == -Inf: -// return abs(x).min(axis = axis) -// elif ord == 0: -// # Zero norm -// return (x != 0).sum(axis = axis) -// elif ord == 1: -// # special case for speedup -// return add.reduce(abs(x), axis = axis) -// elif ord is None or ord == 2: -// # special case for speedup -// s = (x.conj() * x).real -// return sqrt(add.reduce(s, axis = axis)) -// else: -// try: -// ord + 1 -// except TypeError: -// raise ValueError("Invalid norm order for vectors.") -// if x.dtype.type is longdouble: -// # Convert to a float type, so integer arrays give -// # float results. Don't apply asfarray to longdouble arrays, -// # because it will downcast to float64. -// absx = abs(x) -// else: -// absx = x if isComplexType(x.dtype.type) else asfarray(x) -// if absx.dtype is x.dtype: -// absx = abs(absx) -// else: -// #if the type changed, we can safely overwrite absx -// abs(absx, out=absx) -// absx **= ord -// return add.reduce(absx, axis=axis) ** (1.0 / ord) - -// } -//elif len(axis) == 2: -// row_axis, col_axis = axis -// if not (-nd <= row_axis < nd and -nd <= col_axis < nd): -// raise ValueError('Invalid axis %r for an array with shape %r' % -// (axis, x.shape)) -// if row_axis % nd == col_axis % nd: -// raise ValueError('Duplicate axes given.') -// if ord == 2: -// return _multi_svd_norm(x, row_axis, col_axis, amax) -// elif ord == -2: -// return _multi_svd_norm(x, row_axis, col_axis, amin) -// elif ord == 1: -// if col_axis > row_axis: -// col_axis -= 1 -// return add.reduce(abs(x), axis=row_axis).max(axis=col_axis) -// elif ord == Inf: -// if row_axis > col_axis: -// row_axis -= 1 -// return add.reduce(abs(x), axis=col_axis).max(axis=row_axis) -// elif ord == -1: -// if col_axis > row_axis: -// col_axis -= 1 -// return add.reduce(abs(x), axis=row_axis).min(axis=col_axis) -// elif ord == -Inf: -// if row_axis > col_axis: -// row_axis -= 1 -// return add.reduce(abs(x), axis=col_axis).min(axis=row_axis) -// elif ord in [None, 'fro', 'f']: -// return sqrt(add.reduce((x.conj() * x).real, axis=axis)) -// else: -// raise ValueError("Invalid norm order for matrices.") -//else: -// raise ValueError("Improper number of dimensions to norm.") - throw new NotImplementedException(); - } - - /* - >>> from numpy import linalg as LA - >>> a = np.arange(9) - 4 - >>> a - array([-4, -3, -2, -1, 0, 1, 2, 3, 4]) - >>> b = a.reshape((3, 3)) - >>> b - array([[-4, -3, -2], - [-1, 0, 1], - [ 2, 3, 4]]) - >>> LA.norm(a) - 7.745966692414834 - >>> LA.norm(b) - 7.745966692414834 - >>> LA.norm(b, 'fro') - 7.745966692414834 - >>> LA.norm(a, np.inf) - 4 - >>> LA.norm(b, np.inf) - 9 - >>> LA.norm(a, -np.inf) - 0 - >>> LA.norm(b, -np.inf) - 2 - >>> LA.norm(a, 1) - 20 - >>> LA.norm(b, 1) - 7 - >>> LA.norm(a, -1) - -4.6566128774142013e-010 - >>> LA.norm(b, -1) - 6 - >>> LA.norm(a, 2) - 7.745966692414834 - >>> LA.norm(b, 2) - 7.3484692283495345 - >>> LA.norm(a, -2) - nan - >>> LA.norm(b, -2) - 1.8570331885190563e-016 - >>> LA.norm(a, 3) - 5.8480354764257312 - >>> LA.norm(a, -3) - nan - Using the `axis` argument to compute vector norms: - >>> c = np.array([[1, 2, 3], - ... [-1, 1, 4]]) - >>> LA.norm(c, axis=0) - array([ 1.41421356, 2.23606798, 5. ]) - >>> LA.norm(c, axis=1) - array([ 3.74165739, 4.24264069]) - >>> LA.norm(c, ord=1, axis=1) - array([6, 6]) - Using the `axis` argument to compute matrix norms: - >>> m = np.arange(8).reshape(2,2,2) - >>> LA.norm(m, axis=(1,2)) - array([ 3.74165739, 11.22497216]) - >>> LA.norm(m[0, :, :]), LA.norm(m[1, :, :]) - (3.7416573867739413, 11.224972160321824) - """ - - - */ - } - } -} +using System; +using System.Numerics; +using NumSharp.Utilities; + +namespace NumSharp +{ + public static partial class np + { + public static partial class linalg + { + /// + /// Matrix or vector norm. + /// This function is able to return one of seven different matrix norms, + /// or one of an infinite number of vector norms(described below), depending + /// on the value of the ``ord`` parameter. + /// + /// Input array. If `axis` is None, `x` must be 1-D or 2-D. + /// non-zero int, "inf", "-inf" or "fro", optional + /// Order of the norm(see table under ``Notes``). + /// int, 2-tuple of ints int[], null}, optional + /// If `axis` is an integer, it specifies the axis of `x` along which to + /// compute the vector norms.If `axis` is a 2-tuple, it specifies the + /// axes that hold 2-D matrices, and the matrix norms of these matrices + /// are computed.If `axis` is None then either a vector norm (when `x` + /// is 1-D) or a matrix norm(when `x` is 2-D) is returned. + /// + /// Norm of the matrix or vector(s) as double or NDArray. + /// + /// + /// Notes: + /// ----- + /// For values of ``ord <= 0``, the result is, strictly speaking, not a + /// mathematical 'norm', but it may still be useful for various numerical + /// purposes. + /// The following norms can be calculated: + /// ===== ============================ ========================== + /// ord norm for matrices norm for vectors + /// ===== ============================ ========================== + /// None Frobenius norm 2-norm + /// 'fro' Frobenius norm -- + /// inf max(sum(abs(x), axis= 1)) max(abs(x)) + /// -inf min(sum(abs(x), axis= 1)) min(abs(x)) + /// 0 -- sum(x != 0) + /// 1 max(sum(abs(x), axis= 0)) as below + /// -1 min(sum(abs(x), axis= 0)) as below + /// 2 2-norm(largest sing. value) as below + /// -2 smallest singular value as below + /// other -- sum(abs(x) ** ord)**(1./ord) + /// ===== ============================ ========================== + /// The Frobenius norm is given by[1]_: + /// :math:`||A||_F = [\\sum_{i, j} + /// abs(a_{ i,j})^2]^{1/2}` + /// References + /// ---------- + /// .. [1] G.H.Golub and C.F.Van Loan, *Matrix Computations*, + /// Baltimore, MD, Johns Hopkins University Press, 1985, pg. 15 + /// + private static object norm(NDArray x, object ord = null, object axis_obj = null) + { + // Check the default case first and handle it immediately. + if (ord == null && axis_obj == null) + { + x = x.ravel(); // order = 'K' + NDArray sqnorm = null; + if (x.dtype == typeof(Complex)) + // Python: sqnorm = dot(x.real, x.real) + dot(x.imag, x.imag) + throw new NotImplementedException("Complex is not implemented yet"); + else + sqnorm = dot(x, x); + return sqrt(sqnorm); + } + + // Normalize the `axis` argument to a tuple. + var dim = x.ndim; + int[] axis = null; + if (axis_obj == null) + axis = py.range(dim); + else if (axis_obj is int) + axis = new int[] {(int)axis_obj}; + else if (axis_obj is int[]) + axis = (int[])axis_obj; + else + throw new ArgumentException($"Invalid axis type: {axis_obj}"); +// if (axis.Length == 1) +// { +// if ((string)ord == "inf") +// return abs(x).max(axis = axis); +// elif ord == -Inf: +// return abs(x).min(axis = axis) +// elif ord == 0: +// # Zero norm +// return (x != 0).sum(axis = axis) +// elif ord == 1: +// # special case for speedup +// return add.reduce(abs(x), axis = axis) +// elif ord is None or ord == 2: +// # special case for speedup +// s = (x.conj() * x).real +// return sqrt(add.reduce(s, axis = axis)) +// else: +// try: +// ord + 1 +// except TypeError: +// raise ValueError("Invalid norm order for vectors.") +// if x.dtype.type is longdouble: +// # Convert to a float type, so integer arrays give +// # float results. Don't apply asfarray to longdouble arrays, +// # because it will downcast to float64. +// absx = abs(x) +// else: +// absx = x if isComplexType(x.dtype.type) else asfarray(x) +// if absx.dtype is x.dtype: +// absx = abs(absx) +// else: +// #if the type changed, we can safely overwrite absx +// abs(absx, out=absx) +// absx **= ord +// return add.reduce(absx, axis=axis) ** (1.0 / ord) + +// } +//elif len(axis) == 2: +// row_axis, col_axis = axis +// if not (-nd <= row_axis < nd and -nd <= col_axis < nd): +// raise ValueError('Invalid axis %r for an array with shape %r' % +// (axis, x.shape)) +// if row_axis % nd == col_axis % nd: +// raise ValueError('Duplicate axes given.') +// if ord == 2: +// return _multi_svd_norm(x, row_axis, col_axis, amax) +// elif ord == -2: +// return _multi_svd_norm(x, row_axis, col_axis, amin) +// elif ord == 1: +// if col_axis > row_axis: +// col_axis -= 1 +// return add.reduce(abs(x), axis=row_axis).max(axis=col_axis) +// elif ord == Inf: +// if row_axis > col_axis: +// row_axis -= 1 +// return add.reduce(abs(x), axis=col_axis).max(axis=row_axis) +// elif ord == -1: +// if col_axis > row_axis: +// col_axis -= 1 +// return add.reduce(abs(x), axis=row_axis).min(axis=col_axis) +// elif ord == -Inf: +// if row_axis > col_axis: +// row_axis -= 1 +// return add.reduce(abs(x), axis=col_axis).min(axis=row_axis) +// elif ord in [None, 'fro', 'f']: +// return sqrt(add.reduce((x.conj() * x).real, axis=axis)) +// else: +// raise ValueError("Invalid norm order for matrices.") +//else: +// raise ValueError("Improper number of dimensions to norm.") + throw new NotImplementedException(); + } + + /* + >>> from numpy import linalg as LA + >>> a = np.arange(9) - 4 + >>> a + array([-4, -3, -2, -1, 0, 1, 2, 3, 4]) + >>> b = a.reshape((3, 3)) + >>> b + array([[-4, -3, -2], + [-1, 0, 1], + [ 2, 3, 4]]) + >>> LA.norm(a) + 7.745966692414834 + >>> LA.norm(b) + 7.745966692414834 + >>> LA.norm(b, 'fro') + 7.745966692414834 + >>> LA.norm(a, np.inf) + 4 + >>> LA.norm(b, np.inf) + 9 + >>> LA.norm(a, -np.inf) + 0 + >>> LA.norm(b, -np.inf) + 2 + >>> LA.norm(a, 1) + 20 + >>> LA.norm(b, 1) + 7 + >>> LA.norm(a, -1) + -4.6566128774142013e-010 + >>> LA.norm(b, -1) + 6 + >>> LA.norm(a, 2) + 7.745966692414834 + >>> LA.norm(b, 2) + 7.3484692283495345 + >>> LA.norm(a, -2) + nan + >>> LA.norm(b, -2) + 1.8570331885190563e-016 + >>> LA.norm(a, 3) + 5.8480354764257312 + >>> LA.norm(a, -3) + nan + Using the `axis` argument to compute vector norms: + >>> c = np.array([[1, 2, 3], + ... [-1, 1, 4]]) + >>> LA.norm(c, axis=0) + array([ 1.41421356, 2.23606798, 5. ]) + >>> LA.norm(c, axis=1) + array([ 3.74165739, 4.24264069]) + >>> LA.norm(c, ord=1, axis=1) + array([6, 6]) + Using the `axis` argument to compute matrix norms: + >>> m = np.arange(8).reshape(2,2,2) + >>> LA.norm(m, axis=(1,2)) + array([ 3.74165739, 11.22497216]) + >>> LA.norm(m[0, :, :]), LA.norm(m[1, :, :]) + (3.7416573867739413, 11.224972160321824) + """ + + + */ + } + } +} diff --git a/src/NumSharp.Core/Logic/np.find_common_type.cs b/src/NumSharp.Core/Logic/np.find_common_type.cs index ebd3f380..5616cc2c 100644 --- a/src/NumSharp.Core/Logic/np.find_common_type.cs +++ b/src/NumSharp.Core/Logic/np.find_common_type.cs @@ -600,7 +600,7 @@ internal static NPTypeCode _FindCommonArrayScalarType(Type dtypeArray, Type dtyp /// Resolves to which type should the output be. /// /// This function relys on being ordered numerically by size. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] internal static NPTypeCode _FindCommonType(NPTypeCode[] array_types, NPTypeCode[] scalar_types) { NPTypeCode maxa = _can_coerce_all(array_types); @@ -634,7 +634,7 @@ internal static NPTypeCode _FindCommonType(NPTypeCode[] array_types, NPTypeCode[ /// Resolves to which type should the output be. /// /// This function relys on being ordered numerically by size. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] internal static NPTypeCode _FindCommonType(List array_types, List scalar_types) { NPTypeCode maxa = _can_coerce_all(array_types); @@ -668,7 +668,7 @@ internal static NPTypeCode _FindCommonType(List array_types, List /// This function relys on being ordered numerically by size. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] internal static NPTypeCode _FindCommonType_Scalar(params NPTypeCode[] scalar_types) { return _can_coerce_all(scalar_types); @@ -678,7 +678,7 @@ internal static NPTypeCode _FindCommonType_Scalar(params NPTypeCode[] scalar_typ /// Resolves to which type should the output be. /// /// This function relys on being ordered numerically by size. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] internal static NPTypeCode _FindCommonType_Array(params NPTypeCode[] array_types) { return _can_coerce_all(array_types); @@ -688,7 +688,7 @@ internal static NPTypeCode _FindCommonType_Array(params NPTypeCode[] array_types /// Resolves to which type should the output be. /// /// This function relys on being ordered numerically by size. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] internal static NPTypeCode _FindCommonType(params NDArray[] involvedArrays) { List scalar = new List(involvedArrays.Length); @@ -707,7 +707,7 @@ internal static NPTypeCode _FindCommonType(params NDArray[] involvedArrays) /// /// Resolves to which type should the output be. /// - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static NPTypeCode find_common_type(params string[] involvedTypes) { return _can_coerce_all(involvedTypes.Select(s => dtype(s).typecode).ToArray()); @@ -717,7 +717,7 @@ public static NPTypeCode find_common_type(params string[] involvedTypes) /// Resolves to which type should the output be. /// /// This function relys on being ordered numerically by size. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] internal static NPTypeCode _FindCommonType(NDArray firstNDArray, NDArray secondNDArray) { var lscalar = firstNDArray.Shape.IsScalar; @@ -737,7 +737,7 @@ internal static NPTypeCode _FindCommonType(NDArray firstNDArray, NDArray secondN #region Private of find_common_type - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist) { int N = dtypelist.Length; @@ -761,7 +761,7 @@ private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist) return ret; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] private static NPTypeCode _can_coerce_all(List dtypelist) { int N = dtypelist.Count; @@ -786,7 +786,7 @@ private static NPTypeCode _can_coerce_all(List dtypelist) return ret; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist, int start) { int N = dtypelist.Length; @@ -818,7 +818,7 @@ private static NPTypeCode _can_coerce_all(NPTypeCode[] dtypelist, int start) return ret; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] private static NPTypeCode _can_coerce_all(List dtypelist, int start) { int N = dtypelist.Count; diff --git a/src/NumSharp.Core/Manipulation/np.squeeze.cs b/src/NumSharp.Core/Manipulation/np.squeeze.cs index ad57c1f6..f403fe2b 100644 --- a/src/NumSharp.Core/Manipulation/np.squeeze.cs +++ b/src/NumSharp.Core/Manipulation/np.squeeze.cs @@ -60,7 +60,7 @@ public static Shape squeeze(Shape shape) /// The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a. /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.squeeze.html /// If axis is not None, and an axis being squeezed is not of length 1 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] internal static NDArray squeeze_fast(NDArray a, int axis) { return a.reshape(squeeze_fast(a.Shape, axis)); @@ -74,7 +74,7 @@ internal static NDArray squeeze_fast(NDArray a, int axis) /// The input array, but with all or a subset of the dimensions of length 1 removed. This is always a itself or a view into a. /// https://docs.scipy.org/doc/numpy/reference/generated/numpy.squeeze.html /// If axis is not None, and an axis being squeezed is not of length 1 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] internal static Shape squeeze_fast(Shape a, int axis) { var r = a.dimensions.RemoveAt(axis); diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs index b047625b..2907841b 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Boolean.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsBoolean(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs index f9371e9c..d856fec7 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Byte.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsByte(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs index b827c0a6..0dd8b978 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Char.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsChar(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs index 98678c79..fc01a829 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Decimal.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsDecimal(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs index a4753598..249abdd8 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Double.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsDouble(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs index 77e959ed..350688ef 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int16.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs index f1a9ce6a..96cd351d 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int32.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs index 81f73926..52989de6 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Int64.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs index 752ceb5f..21acc01b 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.Single.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsSingle(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs index 35ac4b31..19fbd270 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt16.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsUInt16(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs index 8cddd956..284f134d 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt32.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsUInt32(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs index ca168498..dab08961 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Equals/Default.Equals.UInt64.cs @@ -11,7 +11,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray EqualsUInt64(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs index 09f465ba..60509271 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Boolean.template.cs @@ -21,7 +21,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray Equals__1__(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs index a6186add..288a503c 100644 --- a/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs +++ b/src/NumSharp.Core/Operations/Elementwise/Templates/Default.Op.Equals.template.cs @@ -20,7 +20,7 @@ namespace NumSharp.Backends { public partial class DefaultEngine { - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] [SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")] [SuppressMessage("ReSharper", "CompareOfFloatsByEqualityOperator")] public unsafe NDArray Equals__1__(in NDArray lhs, in NDArray rhs) diff --git a/src/NumSharp.Core/RandomSampling/np.random.poisson.cs b/src/NumSharp.Core/RandomSampling/np.random.poisson.cs index 82fe1fde..585b2714 100644 --- a/src/NumSharp.Core/RandomSampling/np.random.poisson.cs +++ b/src/NumSharp.Core/RandomSampling/np.random.poisson.cs @@ -43,7 +43,7 @@ public NDArray poisson(double lam, params int[] dims) return result; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] private int knuth(double lambda) { // Knuth, 1969. diff --git a/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs b/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs index bc6838b3..0c2b7d51 100644 --- a/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs +++ b/src/NumSharp.Core/Selection/NDArray.Indexing.Selection.cs @@ -40,7 +40,7 @@ protected static IEnumerable ExpandEllipsis(object[] ndarrays, int ndim) /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] protected internal static NDArray GetIndicesFromSlice(Shape shape, Slice slice, int axis) { return GetIndicesFromSlice(shape.dimensions, slice, axis); @@ -53,7 +53,7 @@ protected internal static NDArray GetIndicesFromSlice(Shape shape, Slice sl /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] protected internal static NDArray GetIndicesFromSlice(int[] shape, Slice slice, int axis) { var dim = shape[axis]; diff --git a/src/NumSharp.Core/Selection/NDArray.Indexing.cs b/src/NumSharp.Core/Selection/NDArray.Indexing.cs index 41a67703..990d2405 100644 --- a/src/NumSharp.Core/Selection/NDArray.Indexing.cs +++ b/src/NumSharp.Core/Selection/NDArray.Indexing.cs @@ -1,113 +1,113 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using System.Globalization; -using System.Linq; -using System.Runtime.CompilerServices; -using NumSharp.Backends; -using NumSharp.Generic; -using NumSharp.Utilities; - -namespace NumSharp -{ - [SuppressMessage("ReSharper", "CoVariantArrayConversion")] - public partial class NDArray - { - /// - /// Throws if this NDArray is not writeable (e.g., broadcast arrays). - /// NumPy raises: ValueError: assignment destination is read-only - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void ThrowIfNotWriteable() - { - NumSharpException.ThrowIfNotWriteable(Shape); - } - - /// - /// Used to perform selection based on given indices. - /// - /// The pointer to the dimensions - /// The count of ints in - public unsafe NDArray this[int* dims, int ndims] - { - get => new NDArray(Storage.GetData(dims, ndims)); - set { ThrowIfNotWriteable(); Storage.GetData(dims, ndims).SetData(value); } - } - - /// - /// Used to perform selection based on a selection indices. - /// - /// https://docs.scipy.org/doc/numpy-1.17.0/user/basics.indexing.html - /// When one of the indices exceeds limits. - /// indices must be of Int type (byte, u/short, u/int, u/long). - public NDArray this[params NDArray[] selection] - { - get => FetchIndices(this, selection.Select(array => (NDArray)array).ToArray(), null, true); - set - { - ThrowIfNotWriteable(); - SetIndices(this, selection, value); - } - } - - /// - /// Slice the array with Python slice notation like this: ":, 2:7:1, ..., np.newaxis" - /// - /// A string containing slice notations for every dimension, delimited by comma - /// A sliced view - public NDArray this[string slice] - { - get - { - return new NDArray(Storage.GetView(Slice.ParseSlices(slice))); - } - set { ThrowIfNotWriteable(); Storage.GetView(Slice.ParseSlices(slice)).SetData(value); } - } - - - /// - /// Slice the array with Python slice notation like this: ":, 2:7:1, ..., np.newaxis" - /// - /// A string containing slice notations for every dimension, delimited by comma - /// A sliced view - public NDArray this[params Slice[] slice] - { - get - { - return new NDArray(Storage.GetView(slice)); - } - set { ThrowIfNotWriteable(); Storage.GetView(slice).SetData(value); } - } - - ///// - ///// todo: doc - ///// - ///// A string containing slice notations for every dimension, delimited by comma - ///// A sliced view - //public NDArray this[params IIndex[] slice] //TODO IIndex is NDArray and - //{ - // get => new NDArray(Storage.GetView(slice)); - // set => Storage.GetView(slice).SetData(value); - //} - - - /// - /// Perform slicing, index extraction, masking and indexing all at the same time with mixed index objects - /// - /// - /// - public NDArray this[params object[] indicesObjects] - { - get - { - return this.FetchIndices(indicesObjects); - } - set - { - ThrowIfNotWriteable(); - SetIndices(indicesObjects, value); - } - } - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Globalization; +using System.Linq; +using System.Runtime.CompilerServices; +using NumSharp.Backends; +using NumSharp.Generic; +using NumSharp.Utilities; + +namespace NumSharp +{ + [SuppressMessage("ReSharper", "CoVariantArrayConversion")] + public partial class NDArray + { + /// + /// Throws if this NDArray is not writeable (e.g., broadcast arrays). + /// NumPy raises: ValueError: assignment destination is read-only + /// + [MethodImpl(Inline)] + private void ThrowIfNotWriteable() + { + NumSharpException.ThrowIfNotWriteable(Shape); + } + + /// + /// Used to perform selection based on given indices. + /// + /// The pointer to the dimensions + /// The count of ints in + public unsafe NDArray this[int* dims, int ndims] + { + get => new NDArray(Storage.GetData(dims, ndims)); + set { ThrowIfNotWriteable(); Storage.GetData(dims, ndims).SetData(value); } + } + + /// + /// Used to perform selection based on a selection indices. + /// + /// https://docs.scipy.org/doc/numpy-1.17.0/user/basics.indexing.html + /// When one of the indices exceeds limits. + /// indices must be of Int type (byte, u/short, u/int, u/long). + public NDArray this[params NDArray[] selection] + { + get => FetchIndices(this, selection.Select(array => (NDArray)array).ToArray(), null, true); + set + { + ThrowIfNotWriteable(); + SetIndices(this, selection, value); + } + } + + /// + /// Slice the array with Python slice notation like this: ":, 2:7:1, ..., np.newaxis" + /// + /// A string containing slice notations for every dimension, delimited by comma + /// A sliced view + public NDArray this[string slice] + { + get + { + return new NDArray(Storage.GetView(Slice.ParseSlices(slice))); + } + set { ThrowIfNotWriteable(); Storage.GetView(Slice.ParseSlices(slice)).SetData(value); } + } + + + /// + /// Slice the array with Python slice notation like this: ":, 2:7:1, ..., np.newaxis" + /// + /// A string containing slice notations for every dimension, delimited by comma + /// A sliced view + public NDArray this[params Slice[] slice] + { + get + { + return new NDArray(Storage.GetView(slice)); + } + set { ThrowIfNotWriteable(); Storage.GetView(slice).SetData(value); } + } + + ///// + ///// todo: doc + ///// + ///// A string containing slice notations for every dimension, delimited by comma + ///// A sliced view + //public NDArray this[params IIndex[] slice] //TODO IIndex is NDArray and + //{ + // get => new NDArray(Storage.GetView(slice)); + // set => Storage.GetView(slice).SetData(value); + //} + + + /// + /// Perform slicing, index extraction, masking and indexing all at the same time with mixed index objects + /// + /// + /// + public NDArray this[params object[] indicesObjects] + { + get + { + return this.FetchIndices(indicesObjects); + } + set + { + ThrowIfNotWriteable(); + SetIndices(indicesObjects, value); + } + } + } +} diff --git a/src/NumSharp.Core/Utilities/ArrayConvert.cs b/src/NumSharp.Core/Utilities/ArrayConvert.cs index b92e6dbd..aac89c09 100644 --- a/src/NumSharp.Core/Utilities/ArrayConvert.cs +++ b/src/NumSharp.Core/Utilities/ArrayConvert.cs @@ -863,7 +863,7 @@ public static Complex[] ToComplex(Array sourceArray) /// The array to convert /// Converted array of type #1 /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static #1[] To#1(#1[] sourceArray) { if (sourceArray == null) @@ -885,7 +885,7 @@ public static Complex[] ToComplex(Array sourceArray) /// The array to convert /// Converted array of type Boolean /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Boolean[] sourceArray) { if (sourceArray == null) @@ -904,7 +904,7 @@ public static Boolean[] ToBoolean(Boolean[] sourceArray) /// The array to convert /// Converted array of type Byte /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Byte[] sourceArray) { if (sourceArray == null) @@ -923,7 +923,7 @@ public static Byte[] ToByte(Byte[] sourceArray) /// The array to convert /// Converted array of type Int16 /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Int16[] sourceArray) { if (sourceArray == null) @@ -942,7 +942,7 @@ public static Int16[] ToInt16(Int16[] sourceArray) /// The array to convert /// Converted array of type UInt16 /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(UInt16[] sourceArray) { if (sourceArray == null) @@ -961,7 +961,7 @@ public static UInt16[] ToUInt16(UInt16[] sourceArray) /// The array to convert /// Converted array of type Int32 /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Int32[] sourceArray) { if (sourceArray == null) @@ -980,7 +980,7 @@ public static Int32[] ToInt32(Int32[] sourceArray) /// The array to convert /// Converted array of type UInt32 /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(UInt32[] sourceArray) { if (sourceArray == null) @@ -999,7 +999,7 @@ public static UInt32[] ToUInt32(UInt32[] sourceArray) /// The array to convert /// Converted array of type Int64 /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Int64[] sourceArray) { if (sourceArray == null) @@ -1018,7 +1018,7 @@ public static Int64[] ToInt64(Int64[] sourceArray) /// The array to convert /// Converted array of type UInt64 /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(UInt64[] sourceArray) { if (sourceArray == null) @@ -1037,7 +1037,7 @@ public static UInt64[] ToUInt64(UInt64[] sourceArray) /// The array to convert /// Converted array of type Char /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Char[] sourceArray) { if (sourceArray == null) @@ -1056,7 +1056,7 @@ public static Char[] ToChar(Char[] sourceArray) /// The array to convert /// Converted array of type Double /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Double[] sourceArray) { if (sourceArray == null) @@ -1075,7 +1075,7 @@ public static Double[] ToDouble(Double[] sourceArray) /// The array to convert /// Converted array of type Single /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Single[] sourceArray) { if (sourceArray == null) @@ -1094,7 +1094,7 @@ public static Single[] ToSingle(Single[] sourceArray) /// The array to convert /// Converted array of type Decimal /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Decimal[] sourceArray) { if (sourceArray == null) @@ -1113,7 +1113,7 @@ public static Decimal[] ToDecimal(Decimal[] sourceArray) /// The array to convert /// Converted array of type String /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(String[] sourceArray) { if (sourceArray == null) @@ -1132,7 +1132,7 @@ public static String[] ToString(String[] sourceArray) /// The array to convert /// Converted array of type Complex /// Based on benchmark ArrayCopying - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Complex[] sourceArray) { if (sourceArray == null) @@ -1157,7 +1157,7 @@ public static Complex[] ToComplex(Complex[] sourceArray) /// /// The array to convert /// Converted array of type #2 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static #2[] To#2(#1[] sourceArray) { if (sourceArray == null) @@ -1180,7 +1180,7 @@ public static Complex[] ToComplex(Complex[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Boolean[] sourceArray) { if (sourceArray == null) @@ -1197,7 +1197,7 @@ public static Byte[] ToByte(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Boolean[] sourceArray) { if (sourceArray == null) @@ -1214,7 +1214,7 @@ public static Int16[] ToInt16(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Boolean[] sourceArray) { if (sourceArray == null) @@ -1231,7 +1231,7 @@ public static UInt16[] ToUInt16(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Boolean[] sourceArray) { if (sourceArray == null) @@ -1248,7 +1248,7 @@ public static Int32[] ToInt32(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Boolean[] sourceArray) { if (sourceArray == null) @@ -1265,7 +1265,7 @@ public static UInt32[] ToUInt32(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Boolean[] sourceArray) { if (sourceArray == null) @@ -1282,7 +1282,7 @@ public static Int64[] ToInt64(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Boolean[] sourceArray) { if (sourceArray == null) @@ -1299,7 +1299,7 @@ public static UInt64[] ToUInt64(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Boolean[] sourceArray) { if (sourceArray == null) @@ -1316,7 +1316,7 @@ public static Char[] ToChar(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Boolean[] sourceArray) { if (sourceArray == null) @@ -1333,7 +1333,7 @@ public static Double[] ToDouble(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Boolean[] sourceArray) { if (sourceArray == null) @@ -1350,7 +1350,7 @@ public static Single[] ToSingle(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Boolean[] sourceArray) { if (sourceArray == null) @@ -1367,7 +1367,7 @@ public static Decimal[] ToDecimal(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Boolean[] sourceArray) { if (sourceArray == null) @@ -1384,7 +1384,7 @@ public static String[] ToString(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Byte[] sourceArray) { if (sourceArray == null) @@ -1401,7 +1401,7 @@ public static Boolean[] ToBoolean(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Byte[] sourceArray) { if (sourceArray == null) @@ -1418,7 +1418,7 @@ public static Int16[] ToInt16(Byte[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Byte[] sourceArray) { if (sourceArray == null) @@ -1435,7 +1435,7 @@ public static UInt16[] ToUInt16(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Byte[] sourceArray) { if (sourceArray == null) @@ -1452,7 +1452,7 @@ public static Int32[] ToInt32(Byte[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Byte[] sourceArray) { if (sourceArray == null) @@ -1469,7 +1469,7 @@ public static UInt32[] ToUInt32(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Byte[] sourceArray) { if (sourceArray == null) @@ -1486,7 +1486,7 @@ public static Int64[] ToInt64(Byte[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Byte[] sourceArray) { if (sourceArray == null) @@ -1503,7 +1503,7 @@ public static UInt64[] ToUInt64(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Byte[] sourceArray) { if (sourceArray == null) @@ -1520,7 +1520,7 @@ public static Char[] ToChar(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Byte[] sourceArray) { if (sourceArray == null) @@ -1537,7 +1537,7 @@ public static Double[] ToDouble(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Byte[] sourceArray) { if (sourceArray == null) @@ -1554,7 +1554,7 @@ public static Single[] ToSingle(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Byte[] sourceArray) { if (sourceArray == null) @@ -1571,7 +1571,7 @@ public static Decimal[] ToDecimal(Byte[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Byte[] sourceArray) { if (sourceArray == null) @@ -1588,7 +1588,7 @@ public static String[] ToString(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Int16[] sourceArray) { if (sourceArray == null) @@ -1605,7 +1605,7 @@ public static Boolean[] ToBoolean(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Int16[] sourceArray) { if (sourceArray == null) @@ -1622,7 +1622,7 @@ public static Byte[] ToByte(Int16[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Int16[] sourceArray) { if (sourceArray == null) @@ -1639,7 +1639,7 @@ public static UInt16[] ToUInt16(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Int16[] sourceArray) { if (sourceArray == null) @@ -1656,7 +1656,7 @@ public static Int32[] ToInt32(Int16[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Int16[] sourceArray) { if (sourceArray == null) @@ -1673,7 +1673,7 @@ public static UInt32[] ToUInt32(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Int16[] sourceArray) { if (sourceArray == null) @@ -1690,7 +1690,7 @@ public static Int64[] ToInt64(Int16[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Int16[] sourceArray) { if (sourceArray == null) @@ -1707,7 +1707,7 @@ public static UInt64[] ToUInt64(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Int16[] sourceArray) { if (sourceArray == null) @@ -1724,7 +1724,7 @@ public static Char[] ToChar(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Int16[] sourceArray) { if (sourceArray == null) @@ -1741,7 +1741,7 @@ public static Double[] ToDouble(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Int16[] sourceArray) { if (sourceArray == null) @@ -1758,7 +1758,7 @@ public static Single[] ToSingle(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Int16[] sourceArray) { if (sourceArray == null) @@ -1775,7 +1775,7 @@ public static Decimal[] ToDecimal(Int16[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Int16[] sourceArray) { if (sourceArray == null) @@ -1792,7 +1792,7 @@ public static String[] ToString(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(UInt16[] sourceArray) { if (sourceArray == null) @@ -1809,7 +1809,7 @@ public static Boolean[] ToBoolean(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(UInt16[] sourceArray) { if (sourceArray == null) @@ -1826,7 +1826,7 @@ public static Byte[] ToByte(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(UInt16[] sourceArray) { if (sourceArray == null) @@ -1843,7 +1843,7 @@ public static Int16[] ToInt16(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(UInt16[] sourceArray) { if (sourceArray == null) @@ -1860,7 +1860,7 @@ public static Int32[] ToInt32(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(UInt16[] sourceArray) { if (sourceArray == null) @@ -1877,7 +1877,7 @@ public static UInt32[] ToUInt32(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(UInt16[] sourceArray) { if (sourceArray == null) @@ -1894,7 +1894,7 @@ public static Int64[] ToInt64(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(UInt16[] sourceArray) { if (sourceArray == null) @@ -1911,7 +1911,7 @@ public static UInt64[] ToUInt64(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(UInt16[] sourceArray) { if (sourceArray == null) @@ -1928,7 +1928,7 @@ public static Char[] ToChar(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(UInt16[] sourceArray) { if (sourceArray == null) @@ -1945,7 +1945,7 @@ public static Double[] ToDouble(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(UInt16[] sourceArray) { if (sourceArray == null) @@ -1962,7 +1962,7 @@ public static Single[] ToSingle(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(UInt16[] sourceArray) { if (sourceArray == null) @@ -1979,7 +1979,7 @@ public static Decimal[] ToDecimal(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(UInt16[] sourceArray) { if (sourceArray == null) @@ -1996,7 +1996,7 @@ public static String[] ToString(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Int32[] sourceArray) { if (sourceArray == null) @@ -2013,7 +2013,7 @@ public static Boolean[] ToBoolean(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Int32[] sourceArray) { if (sourceArray == null) @@ -2030,7 +2030,7 @@ public static Byte[] ToByte(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Int32[] sourceArray) { if (sourceArray == null) @@ -2047,7 +2047,7 @@ public static Int16[] ToInt16(Int32[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Int32[] sourceArray) { if (sourceArray == null) @@ -2064,7 +2064,7 @@ public static UInt16[] ToUInt16(Int32[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Int32[] sourceArray) { if (sourceArray == null) @@ -2081,7 +2081,7 @@ public static UInt32[] ToUInt32(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Int32[] sourceArray) { if (sourceArray == null) @@ -2098,7 +2098,7 @@ public static Int64[] ToInt64(Int32[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Int32[] sourceArray) { if (sourceArray == null) @@ -2115,7 +2115,7 @@ public static UInt64[] ToUInt64(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Int32[] sourceArray) { if (sourceArray == null) @@ -2132,7 +2132,7 @@ public static Char[] ToChar(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Int32[] sourceArray) { if (sourceArray == null) @@ -2149,7 +2149,7 @@ public static Double[] ToDouble(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Int32[] sourceArray) { if (sourceArray == null) @@ -2166,7 +2166,7 @@ public static Single[] ToSingle(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Int32[] sourceArray) { if (sourceArray == null) @@ -2183,7 +2183,7 @@ public static Decimal[] ToDecimal(Int32[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Int32[] sourceArray) { if (sourceArray == null) @@ -2200,7 +2200,7 @@ public static String[] ToString(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(UInt32[] sourceArray) { if (sourceArray == null) @@ -2217,7 +2217,7 @@ public static Boolean[] ToBoolean(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(UInt32[] sourceArray) { if (sourceArray == null) @@ -2234,7 +2234,7 @@ public static Byte[] ToByte(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(UInt32[] sourceArray) { if (sourceArray == null) @@ -2251,7 +2251,7 @@ public static Int16[] ToInt16(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(UInt32[] sourceArray) { if (sourceArray == null) @@ -2268,7 +2268,7 @@ public static UInt16[] ToUInt16(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(UInt32[] sourceArray) { if (sourceArray == null) @@ -2285,7 +2285,7 @@ public static Int32[] ToInt32(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(UInt32[] sourceArray) { if (sourceArray == null) @@ -2302,7 +2302,7 @@ public static Int64[] ToInt64(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(UInt32[] sourceArray) { if (sourceArray == null) @@ -2319,7 +2319,7 @@ public static UInt64[] ToUInt64(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(UInt32[] sourceArray) { if (sourceArray == null) @@ -2336,7 +2336,7 @@ public static Char[] ToChar(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(UInt32[] sourceArray) { if (sourceArray == null) @@ -2353,7 +2353,7 @@ public static Double[] ToDouble(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(UInt32[] sourceArray) { if (sourceArray == null) @@ -2370,7 +2370,7 @@ public static Single[] ToSingle(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(UInt32[] sourceArray) { if (sourceArray == null) @@ -2387,7 +2387,7 @@ public static Decimal[] ToDecimal(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(UInt32[] sourceArray) { if (sourceArray == null) @@ -2404,7 +2404,7 @@ public static String[] ToString(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Int64[] sourceArray) { if (sourceArray == null) @@ -2421,7 +2421,7 @@ public static Boolean[] ToBoolean(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Int64[] sourceArray) { if (sourceArray == null) @@ -2438,7 +2438,7 @@ public static Byte[] ToByte(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Int64[] sourceArray) { if (sourceArray == null) @@ -2455,7 +2455,7 @@ public static Int16[] ToInt16(Int64[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Int64[] sourceArray) { if (sourceArray == null) @@ -2472,7 +2472,7 @@ public static UInt16[] ToUInt16(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Int64[] sourceArray) { if (sourceArray == null) @@ -2489,7 +2489,7 @@ public static Int32[] ToInt32(Int64[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Int64[] sourceArray) { if (sourceArray == null) @@ -2506,7 +2506,7 @@ public static UInt32[] ToUInt32(Int64[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Int64[] sourceArray) { if (sourceArray == null) @@ -2523,7 +2523,7 @@ public static UInt64[] ToUInt64(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Int64[] sourceArray) { if (sourceArray == null) @@ -2540,7 +2540,7 @@ public static Char[] ToChar(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Int64[] sourceArray) { if (sourceArray == null) @@ -2557,7 +2557,7 @@ public static Double[] ToDouble(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Int64[] sourceArray) { if (sourceArray == null) @@ -2574,7 +2574,7 @@ public static Single[] ToSingle(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Int64[] sourceArray) { if (sourceArray == null) @@ -2591,7 +2591,7 @@ public static Decimal[] ToDecimal(Int64[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Int64[] sourceArray) { if (sourceArray == null) @@ -2608,7 +2608,7 @@ public static String[] ToString(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(UInt64[] sourceArray) { if (sourceArray == null) @@ -2625,7 +2625,7 @@ public static Boolean[] ToBoolean(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(UInt64[] sourceArray) { if (sourceArray == null) @@ -2642,7 +2642,7 @@ public static Byte[] ToByte(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(UInt64[] sourceArray) { if (sourceArray == null) @@ -2659,7 +2659,7 @@ public static Int16[] ToInt16(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(UInt64[] sourceArray) { if (sourceArray == null) @@ -2676,7 +2676,7 @@ public static UInt16[] ToUInt16(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(UInt64[] sourceArray) { if (sourceArray == null) @@ -2693,7 +2693,7 @@ public static Int32[] ToInt32(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(UInt64[] sourceArray) { if (sourceArray == null) @@ -2710,7 +2710,7 @@ public static UInt32[] ToUInt32(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(UInt64[] sourceArray) { if (sourceArray == null) @@ -2727,7 +2727,7 @@ public static Int64[] ToInt64(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(UInt64[] sourceArray) { if (sourceArray == null) @@ -2744,7 +2744,7 @@ public static Char[] ToChar(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(UInt64[] sourceArray) { if (sourceArray == null) @@ -2761,7 +2761,7 @@ public static Double[] ToDouble(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(UInt64[] sourceArray) { if (sourceArray == null) @@ -2778,7 +2778,7 @@ public static Single[] ToSingle(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(UInt64[] sourceArray) { if (sourceArray == null) @@ -2795,7 +2795,7 @@ public static Decimal[] ToDecimal(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(UInt64[] sourceArray) { if (sourceArray == null) @@ -2812,7 +2812,7 @@ public static String[] ToString(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Char[] sourceArray) { if (sourceArray == null) @@ -2829,7 +2829,7 @@ public static Boolean[] ToBoolean(Char[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Char[] sourceArray) { if (sourceArray == null) @@ -2846,7 +2846,7 @@ public static Byte[] ToByte(Char[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Char[] sourceArray) { if (sourceArray == null) @@ -2863,7 +2863,7 @@ public static Int16[] ToInt16(Char[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Char[] sourceArray) { if (sourceArray == null) @@ -2880,7 +2880,7 @@ public static UInt16[] ToUInt16(Char[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Char[] sourceArray) { if (sourceArray == null) @@ -2897,7 +2897,7 @@ public static Int32[] ToInt32(Char[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Char[] sourceArray) { if (sourceArray == null) @@ -2914,7 +2914,7 @@ public static UInt32[] ToUInt32(Char[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Char[] sourceArray) { if (sourceArray == null) @@ -2931,7 +2931,7 @@ public static Int64[] ToInt64(Char[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Char[] sourceArray) { if (sourceArray == null) @@ -2948,7 +2948,7 @@ public static UInt64[] ToUInt64(Char[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Char[] sourceArray) { if (sourceArray == null) @@ -2965,7 +2965,7 @@ public static Double[] ToDouble(Char[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Char[] sourceArray) { if (sourceArray == null) @@ -2982,7 +2982,7 @@ public static Single[] ToSingle(Char[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Char[] sourceArray) { if (sourceArray == null) @@ -2999,7 +2999,7 @@ public static Decimal[] ToDecimal(Char[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Char[] sourceArray) { if (sourceArray == null) @@ -3016,7 +3016,7 @@ public static String[] ToString(Char[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Double[] sourceArray) { if (sourceArray == null) @@ -3033,7 +3033,7 @@ public static Boolean[] ToBoolean(Double[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Double[] sourceArray) { if (sourceArray == null) @@ -3050,7 +3050,7 @@ public static Byte[] ToByte(Double[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Double[] sourceArray) { if (sourceArray == null) @@ -3067,7 +3067,7 @@ public static Int16[] ToInt16(Double[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Double[] sourceArray) { if (sourceArray == null) @@ -3084,7 +3084,7 @@ public static UInt16[] ToUInt16(Double[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Double[] sourceArray) { if (sourceArray == null) @@ -3101,7 +3101,7 @@ public static Int32[] ToInt32(Double[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Double[] sourceArray) { if (sourceArray == null) @@ -3118,7 +3118,7 @@ public static UInt32[] ToUInt32(Double[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Double[] sourceArray) { if (sourceArray == null) @@ -3135,7 +3135,7 @@ public static Int64[] ToInt64(Double[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Double[] sourceArray) { if (sourceArray == null) @@ -3152,7 +3152,7 @@ public static UInt64[] ToUInt64(Double[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Double[] sourceArray) { if (sourceArray == null) @@ -3169,7 +3169,7 @@ public static Char[] ToChar(Double[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Double[] sourceArray) { if (sourceArray == null) @@ -3186,7 +3186,7 @@ public static Single[] ToSingle(Double[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Double[] sourceArray) { if (sourceArray == null) @@ -3203,7 +3203,7 @@ public static Decimal[] ToDecimal(Double[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Double[] sourceArray) { if (sourceArray == null) @@ -3220,7 +3220,7 @@ public static String[] ToString(Double[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Single[] sourceArray) { if (sourceArray == null) @@ -3237,7 +3237,7 @@ public static Boolean[] ToBoolean(Single[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Single[] sourceArray) { if (sourceArray == null) @@ -3254,7 +3254,7 @@ public static Byte[] ToByte(Single[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Single[] sourceArray) { if (sourceArray == null) @@ -3271,7 +3271,7 @@ public static Int16[] ToInt16(Single[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Single[] sourceArray) { if (sourceArray == null) @@ -3288,7 +3288,7 @@ public static UInt16[] ToUInt16(Single[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Single[] sourceArray) { if (sourceArray == null) @@ -3305,7 +3305,7 @@ public static Int32[] ToInt32(Single[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Single[] sourceArray) { if (sourceArray == null) @@ -3322,7 +3322,7 @@ public static UInt32[] ToUInt32(Single[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Single[] sourceArray) { if (sourceArray == null) @@ -3339,7 +3339,7 @@ public static Int64[] ToInt64(Single[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Single[] sourceArray) { if (sourceArray == null) @@ -3356,7 +3356,7 @@ public static UInt64[] ToUInt64(Single[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Single[] sourceArray) { if (sourceArray == null) @@ -3373,7 +3373,7 @@ public static Char[] ToChar(Single[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Single[] sourceArray) { if (sourceArray == null) @@ -3390,7 +3390,7 @@ public static Double[] ToDouble(Single[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(Single[] sourceArray) { if (sourceArray == null) @@ -3407,7 +3407,7 @@ public static Decimal[] ToDecimal(Single[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Single[] sourceArray) { if (sourceArray == null) @@ -3424,7 +3424,7 @@ public static String[] ToString(Single[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(Decimal[] sourceArray) { if (sourceArray == null) @@ -3441,7 +3441,7 @@ public static Boolean[] ToBoolean(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(Decimal[] sourceArray) { if (sourceArray == null) @@ -3458,7 +3458,7 @@ public static Byte[] ToByte(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(Decimal[] sourceArray) { if (sourceArray == null) @@ -3475,7 +3475,7 @@ public static Int16[] ToInt16(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(Decimal[] sourceArray) { if (sourceArray == null) @@ -3492,7 +3492,7 @@ public static UInt16[] ToUInt16(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(Decimal[] sourceArray) { if (sourceArray == null) @@ -3509,7 +3509,7 @@ public static Int32[] ToInt32(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(Decimal[] sourceArray) { if (sourceArray == null) @@ -3526,7 +3526,7 @@ public static UInt32[] ToUInt32(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(Decimal[] sourceArray) { if (sourceArray == null) @@ -3543,7 +3543,7 @@ public static Int64[] ToInt64(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(Decimal[] sourceArray) { if (sourceArray == null) @@ -3560,7 +3560,7 @@ public static UInt64[] ToUInt64(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(Decimal[] sourceArray) { if (sourceArray == null) @@ -3577,7 +3577,7 @@ public static Char[] ToChar(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(Decimal[] sourceArray) { if (sourceArray == null) @@ -3594,7 +3594,7 @@ public static Double[] ToDouble(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(Decimal[] sourceArray) { if (sourceArray == null) @@ -3611,7 +3611,7 @@ public static Single[] ToSingle(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String[] ToString(Decimal[] sourceArray) { if (sourceArray == null) @@ -3628,7 +3628,7 @@ public static String[] ToString(Decimal[] sourceArray) /// /// The array to convert /// Converted array of type Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean[] ToBoolean(String[] sourceArray) { if (sourceArray == null) @@ -3645,7 +3645,7 @@ public static Boolean[] ToBoolean(String[] sourceArray) /// /// The array to convert /// Converted array of type Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte[] ToByte(String[] sourceArray) { if (sourceArray == null) @@ -3662,7 +3662,7 @@ public static Byte[] ToByte(String[] sourceArray) /// /// The array to convert /// Converted array of type Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16[] ToInt16(String[] sourceArray) { if (sourceArray == null) @@ -3679,7 +3679,7 @@ public static Int16[] ToInt16(String[] sourceArray) /// /// The array to convert /// Converted array of type UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16[] ToUInt16(String[] sourceArray) { if (sourceArray == null) @@ -3696,7 +3696,7 @@ public static UInt16[] ToUInt16(String[] sourceArray) /// /// The array to convert /// Converted array of type Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32[] ToInt32(String[] sourceArray) { if (sourceArray == null) @@ -3713,7 +3713,7 @@ public static Int32[] ToInt32(String[] sourceArray) /// /// The array to convert /// Converted array of type UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32[] ToUInt32(String[] sourceArray) { if (sourceArray == null) @@ -3730,7 +3730,7 @@ public static UInt32[] ToUInt32(String[] sourceArray) /// /// The array to convert /// Converted array of type Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64[] ToInt64(String[] sourceArray) { if (sourceArray == null) @@ -3747,7 +3747,7 @@ public static Int64[] ToInt64(String[] sourceArray) /// /// The array to convert /// Converted array of type UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64[] ToUInt64(String[] sourceArray) { if (sourceArray == null) @@ -3764,7 +3764,7 @@ public static UInt64[] ToUInt64(String[] sourceArray) /// /// The array to convert /// Converted array of type Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char[] ToChar(String[] sourceArray) { if (sourceArray == null) @@ -3781,7 +3781,7 @@ public static Char[] ToChar(String[] sourceArray) /// /// The array to convert /// Converted array of type Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double[] ToDouble(String[] sourceArray) { if (sourceArray == null) @@ -3798,7 +3798,7 @@ public static Double[] ToDouble(String[] sourceArray) /// /// The array to convert /// Converted array of type Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single[] ToSingle(String[] sourceArray) { if (sourceArray == null) @@ -3815,7 +3815,7 @@ public static Single[] ToSingle(String[] sourceArray) /// /// The array to convert /// Converted array of type Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal[] ToDecimal(String[] sourceArray) { if (sourceArray == null) @@ -3841,7 +3841,7 @@ public static Decimal[] ToDecimal(String[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(#1[] sourceArray) { if (sourceArray == null) @@ -3863,7 +3863,7 @@ public static Complex[] ToComplex(#1[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Boolean[] sourceArray) { if (sourceArray == null) @@ -3881,7 +3881,7 @@ public static Complex[] ToComplex(Boolean[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Byte[] sourceArray) { if (sourceArray == null) @@ -3899,7 +3899,7 @@ public static Complex[] ToComplex(Byte[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Int16[] sourceArray) { if (sourceArray == null) @@ -3917,7 +3917,7 @@ public static Complex[] ToComplex(Int16[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(UInt16[] sourceArray) { if (sourceArray == null) @@ -3935,7 +3935,7 @@ public static Complex[] ToComplex(UInt16[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Int32[] sourceArray) { if (sourceArray == null) @@ -3953,7 +3953,7 @@ public static Complex[] ToComplex(Int32[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(UInt32[] sourceArray) { if (sourceArray == null) @@ -3971,7 +3971,7 @@ public static Complex[] ToComplex(UInt32[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Int64[] sourceArray) { if (sourceArray == null) @@ -3989,7 +3989,7 @@ public static Complex[] ToComplex(Int64[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(UInt64[] sourceArray) { if (sourceArray == null) @@ -4007,7 +4007,7 @@ public static Complex[] ToComplex(UInt64[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Char[] sourceArray) { if (sourceArray == null) @@ -4025,7 +4025,7 @@ public static Complex[] ToComplex(Char[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Double[] sourceArray) { if (sourceArray == null) @@ -4043,7 +4043,7 @@ public static Complex[] ToComplex(Double[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Single[] sourceArray) { if (sourceArray == null) @@ -4061,7 +4061,7 @@ public static Complex[] ToComplex(Single[] sourceArray) /// /// The array to convert /// Converted array of type Complex - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(Decimal[] sourceArray) { if (sourceArray == null) @@ -4080,7 +4080,7 @@ public static Complex[] ToComplex(Decimal[] sourceArray) /// The array to convert /// Converted array of type Complex /// A string in sourceArray has an invalid complex format - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Complex[] ToComplex(String[] sourceArray) { if (sourceArray == null) diff --git a/src/NumSharp.Core/Utilities/Arrays.cs b/src/NumSharp.Core/Utilities/Arrays.cs index a9ce7121..83a2b7a0 100644 --- a/src/NumSharp.Core/Utilities/Arrays.cs +++ b/src/NumSharp.Core/Utilities/Arrays.cs @@ -116,7 +116,7 @@ public static T[] AppendAt(T[] source, int index, T value) /// The array to remove from. /// The index to remove. /// A copy of without given - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static T[] RemoveAt(this T[] source, int index) { var dest = new T[source.Length - 1]; @@ -132,7 +132,7 @@ public static T[] RemoveAt(this T[] source, int index) /// The copying destinition /// The 's offset /// A copy of without given - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static void CopyToExceptAt(this T[] source, int index, T[] destinition, int destOffset = 0) { if (index > 0) @@ -151,7 +151,7 @@ public static void CopyToExceptAt(this T[] source, int index, T[] destinition /// The copying destinition /// The 's offset /// A copy of without given - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static void CopyToExceptAt(this T[] source, int sourceOffset, int index, T[] destinition, int destOffset = 0) { if (sourceOffset + index > 0) @@ -194,7 +194,7 @@ IEnumerable _flat(IEnumerable @this) /// /// /// - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static T[] Concat(params T[][] arrays) { int sum = 0; @@ -222,7 +222,7 @@ public static T[] Concat(params T[][] arrays) /// /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static T[] Concat(T[] left, T[] right) { T[] ret = new T[left.Length + right.Length]; @@ -237,7 +237,7 @@ public static T[] Concat(T[] left, T[] right) /// /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static Type ResolveElementType(this Array arr) { if (arr == null) @@ -255,7 +255,7 @@ public static Type ResolveElementType(this Array arr) /// Resolves 's rank, supports both jagged array and multidim array. /// /// The number of ranks has - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static int ResolveRank(this Array arr) { if (arr == null) @@ -279,7 +279,7 @@ public static int ResolveRank(this Array arr) /// /// /// Supports multi-dim and jagged arrays. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static (Shape Shape, Type Type) ResolveShapeAndType(this Array array) { //get lengths incase it is multi-dimensional @@ -318,7 +318,7 @@ public static (Shape Shape, Type Type) ResolveShapeAndType(this Array array) /// /// /// Supports multi-dim and jagged arrays. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static Shape ResolveShape(this Array array) { Shape shape; @@ -360,7 +360,7 @@ public static Shape ResolveShape(this Array array) /// The type to create this array. /// The length of the array /// Do not use this if you are trying to create jagged or multidimensional array. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Array Create(Type type, IEnumerable enumerable) { // ReSharper disable once PossibleNullReferenceException @@ -380,7 +380,7 @@ public static Array Create(Type type, IEnumerable enumerable) /// The type to create this array. /// The length of the array /// Do not use this if you are trying to create jagged or multidimensional array. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Array Create(Type type, int length) { // ReSharper disable once PossibleNullReferenceException @@ -395,7 +395,7 @@ public static Array Create(Type type, int length) /// /// The type to create this array. /// The length of the array - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Array Create(Type type, int[] length) { // ReSharper disable once PossibleNullReferenceException @@ -410,7 +410,7 @@ public static Array Create(Type type, int[] length) /// /// The type of the array /// The length of the array - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static T[] Create(int length) { return new T[length]; diff --git a/src/NumSharp.Core/Utilities/ArraysExtensions.cs b/src/NumSharp.Core/Utilities/ArraysExtensions.cs index ed73aea5..7aa90607 100644 --- a/src/NumSharp.Core/Utilities/ArraysExtensions.cs +++ b/src/NumSharp.Core/Utilities/ArraysExtensions.cs @@ -15,7 +15,7 @@ public static class ArraysExtensions /// Slice an array. /// /// Supports negative index - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static int[] CloneArray(this int[] source) => (int[])source.Clone(); } diff --git a/src/NumSharp.Core/Utilities/Converts.Native.cs b/src/NumSharp.Core/Utilities/Converts.Native.cs index d897373b..2c6721d5 100644 --- a/src/NumSharp.Core/Utilities/Converts.Native.cs +++ b/src/NumSharp.Core/Utilities/Converts.Native.cs @@ -23,7 +23,7 @@ public static partial class Converts // Otherwise, the result is the type code of the object, as determined by // the object's implementation of IConvertible. [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static TypeCode GetTypeCode(object value) { if (value == null) return TypeCode.Empty; @@ -38,7 +38,7 @@ public static TypeCode GetTypeCode(object value) // Returns true if the given object is a database null. This operation // corresponds to "value.GetTypeCode() == TypeCode.DBNull". [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool IsDBNull(object value) { if (value == System.DBNull.Value) return true; @@ -57,13 +57,13 @@ public static bool IsDBNull(object value) // object already has the given type code, in which case the object is // simply returned. Otherwise, the appropriate ToXXX() is invoked on the // object's implementation of IConvertible. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static object ChangeType(object value, TypeCode typeCode) { return ChangeType(value, typeCode, Thread.CurrentThread.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static object ChangeType(object value, TypeCode typeCode, IFormatProvider provider) { if (value == null && (typeCode == TypeCode.Empty || typeCode == TypeCode.String || typeCode == TypeCode.Object)) @@ -119,27 +119,27 @@ public static object ChangeType(object value, TypeCode typeCode, IFormatProvider } // Conversions to Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(object value) { return value != null && ((IConvertible)value).ToBoolean(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(object value, IFormatProvider provider) { return value != null && ((IConvertible)value).ToBoolean(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(bool value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(sbyte value) { return value != 0; @@ -147,59 +147,59 @@ public static bool ToBoolean(sbyte value) // To be consistent with IConvertible in the base data types else we get different semantics // with widening operations. Without this operator this widen succeeds,with this API the widening throws. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(char value) { return ((IConvertible)value).ToBoolean(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(byte value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(short value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(ushort value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(int value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(uint value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(long value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(ulong value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(string value) { if (value == null) @@ -207,7 +207,7 @@ public static bool ToBoolean(string value) return bool.Parse(value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(string value, IFormatProvider provider) { if (value == null) @@ -215,62 +215,62 @@ public static bool ToBoolean(string value, IFormatProvider provider) return bool.Parse(value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(float value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(double value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(decimal value) { return value != 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(DateTime value) { return ((IConvertible)value).ToBoolean(null); } // Disallowed conversions to Boolean - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static bool ToBoolean(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static bool ToBoolean(TimeSpan value) // Conversions to Char - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(object value) { return value == null ? (char)0 : ((IConvertible)value).ToChar(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(object value, IFormatProvider provider) { return value == null ? (char)0 : ((IConvertible)value).ToChar(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(bool value) { return ((IConvertible)value).ToChar(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(char value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(sbyte value) { if (value < 0) throw new OverflowException(("Overflow_Char")); @@ -278,13 +278,13 @@ public static char ToChar(sbyte value) return (char)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(byte value) { return (char)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(short value) { if (value < 0) throw new OverflowException(("Overflow_Char")); @@ -293,13 +293,13 @@ public static char ToChar(short value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(ushort value) { return (char)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(int value) { if (value < 0 || value > char.MaxValue) throw new OverflowException(("Overflow_Char")); @@ -308,7 +308,7 @@ public static char ToChar(int value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(uint value) { if (value > char.MaxValue) throw new OverflowException(("Overflow_Char")); @@ -316,7 +316,7 @@ public static char ToChar(uint value) return (char)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(long value) { if (value < 0 || value > char.MaxValue) throw new OverflowException(("Overflow_Char")); @@ -325,7 +325,7 @@ public static char ToChar(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(ulong value) { if (value > char.MaxValue) throw new OverflowException(("Overflow_Char")); @@ -337,13 +337,13 @@ public static char ToChar(ulong value) // @VariantSwitch // Remove FormatExceptions; // - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(string value) { return ToChar(value, null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(string value, IFormatProvider provider) { if (value == null) @@ -358,7 +358,7 @@ public static char ToChar(string value, IFormatProvider provider) // To be consistent with IConvertible in the base data types else we get different semantics // with widening operations. Without this operator this widen succeeds,with this API the widening throws. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(float value) { return ((IConvertible)value).ToChar(null); @@ -366,7 +366,7 @@ public static char ToChar(float value) // To be consistent with IConvertible in the base data types else we get different semantics // with widening operations. Without this operator this widen succeeds,with this API the widening throws. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(double value) { return ((IConvertible)value).ToChar(null); @@ -374,13 +374,13 @@ public static char ToChar(double value) // To be consistent with IConvertible in the base data types else we get different semantics // with widening operations. Without this operator this widen succeeds,with this API the widening throws. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(decimal value) { return ((IConvertible)value).ToChar(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static char ToChar(DateTime value) { return ((IConvertible)value).ToChar(null); @@ -388,40 +388,40 @@ public static char ToChar(DateTime value) // Disallowed conversions to Char - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static char ToChar(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static char ToChar(TimeSpan value) // Conversions to SByte - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(object value) { return value == null ? (sbyte)0 : ((IConvertible)value).ToSByte(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(object value, IFormatProvider provider) { return value == null ? (sbyte)0 : ((IConvertible)value).ToSByte(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(bool value) { return value ? (sbyte)1 : (sbyte)0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(sbyte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(char value) { if (value > sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -430,7 +430,7 @@ public static sbyte ToSByte(char value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(byte value) { if (value > sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -439,7 +439,7 @@ public static sbyte ToSByte(byte value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(short value) { if (value < sbyte.MinValue || value > sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -448,7 +448,7 @@ public static sbyte ToSByte(short value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(ushort value) { if (value > sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -457,7 +457,7 @@ public static sbyte ToSByte(ushort value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(int value) { if (value < sbyte.MinValue || value > sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -466,7 +466,7 @@ public static sbyte ToSByte(int value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(uint value) { if (value > sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -475,7 +475,7 @@ public static sbyte ToSByte(uint value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(long value) { if (value < sbyte.MinValue || value > sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -484,7 +484,7 @@ public static sbyte ToSByte(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(ulong value) { if (value > (ulong)sbyte.MaxValue) throw new OverflowException(("Overflow_SByte")); @@ -493,28 +493,28 @@ public static sbyte ToSByte(ulong value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(float value) { return ToSByte((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(double value) { return ToSByte(ToInt32(value)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(decimal value) { return decimal.ToSByte(decimal.Round(value, 0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(string value) { if (value == null) @@ -523,49 +523,49 @@ public static sbyte ToSByte(string value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(string value, IFormatProvider provider) { return sbyte.Parse(value, NumberStyles.Integer, provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(DateTime value) { return ((IConvertible)value).ToSByte(null); } // Disallowed conversions to SByte - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static sbyte ToSByte(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static sbyte ToSByte(TimeSpan value) // Conversions to Byte - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(object value) { return value == null ? (byte)0 : ((IConvertible)value).ToByte(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(object value, IFormatProvider provider) { return value == null ? (byte)0 : ((IConvertible)value).ToByte(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(bool value) { return value ? (byte)1 : (byte)0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(char value) { if (value > byte.MaxValue) throw new OverflowException(("Overflow_Byte")); @@ -574,7 +574,7 @@ public static byte ToByte(char value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(sbyte value) { if (value < byte.MinValue) throw new OverflowException(("Overflow_Byte")); @@ -582,7 +582,7 @@ public static byte ToByte(sbyte value) return (byte)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(short value) { if (value < byte.MinValue || value > byte.MaxValue) throw new OverflowException(("Overflow_Byte")); @@ -591,7 +591,7 @@ public static byte ToByte(short value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(ushort value) { if (value > byte.MaxValue) throw new OverflowException(("Overflow_Byte")); @@ -599,7 +599,7 @@ public static byte ToByte(ushort value) return (byte)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(int value) { if (value < byte.MinValue || value > byte.MaxValue) throw new OverflowException(("Overflow_Byte")); @@ -608,7 +608,7 @@ public static byte ToByte(int value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(uint value) { if (value > byte.MaxValue) throw new OverflowException(("Overflow_Byte")); @@ -616,7 +616,7 @@ public static byte ToByte(uint value) return (byte)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(long value) { if (value < byte.MinValue || value > byte.MaxValue) throw new OverflowException(("Overflow_Byte")); @@ -625,7 +625,7 @@ public static byte ToByte(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(ulong value) { if (value > byte.MaxValue) throw new OverflowException(("Overflow_Byte")); @@ -633,25 +633,25 @@ public static byte ToByte(ulong value) return (byte)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(float value) { return ToByte((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(double value) { return ToByte(ToInt32(value)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(decimal value) { return decimal.ToByte(decimal.Round(value, 0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(string value) { if (value == null) @@ -659,7 +659,7 @@ public static byte ToByte(string value) return byte.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(string value, IFormatProvider provider) { if (value == null) @@ -667,7 +667,7 @@ public static byte ToByte(string value, IFormatProvider provider) return byte.Parse(value, NumberStyles.Integer, provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte ToByte(DateTime value) { return ((IConvertible)value).ToByte(null); @@ -675,29 +675,29 @@ public static byte ToByte(DateTime value) // Disallowed conversions to Byte - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static byte ToByte(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static byte ToByte(TimeSpan value) // Conversions to Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(object value) { return value == null ? (short)0 : ((IConvertible)value).ToInt16(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(object value, IFormatProvider provider) { return value == null ? (short)0 : ((IConvertible)value).ToInt16(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(bool value) { return value ? (short)1 : (short)0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(char value) { if (value > short.MaxValue) throw new OverflowException(("Overflow_Int16")); @@ -706,20 +706,20 @@ public static short ToInt16(char value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(sbyte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(ushort value) { if (value > short.MaxValue) throw new OverflowException(("Overflow_Int16")); @@ -727,7 +727,7 @@ public static short ToInt16(ushort value) return (short)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(int value) { if (value < short.MinValue || value > short.MaxValue) throw new OverflowException(("Overflow_Int16")); @@ -736,7 +736,7 @@ public static short ToInt16(int value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(uint value) { if (value > short.MaxValue) throw new OverflowException(("Overflow_Int16")); @@ -744,13 +744,13 @@ public static short ToInt16(uint value) return (short)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(short value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(long value) { if (value < short.MinValue || value > short.MaxValue) throw new OverflowException(("Overflow_Int16")); @@ -759,7 +759,7 @@ public static short ToInt16(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(ulong value) { if (value > (ulong)short.MaxValue) throw new OverflowException(("Overflow_Int16")); @@ -767,25 +767,25 @@ public static short ToInt16(ulong value) return (short)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(float value) { return ToInt16((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(double value) { return ToInt16(ToInt32(value)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(decimal value) { return decimal.ToInt16(decimal.Round(value, 0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(string value) { if (value == null) @@ -793,7 +793,7 @@ public static short ToInt16(string value) return short.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(string value, IFormatProvider provider) { if (value == null) @@ -801,7 +801,7 @@ public static short ToInt16(string value, IFormatProvider provider) return short.Parse(value, NumberStyles.Integer, provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static short ToInt16(DateTime value) { return ((IConvertible)value).ToInt16(null); @@ -809,39 +809,39 @@ public static short ToInt16(DateTime value) // Disallowed conversions to Int16 - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static short ToInt16(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static short ToInt16(TimeSpan value) // Conversions to UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(object value) { return value == null ? (ushort)0 : ((IConvertible)value).ToUInt16(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(object value, IFormatProvider provider) { return value == null ? (ushort)0 : ((IConvertible)value).ToUInt16(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(bool value) { return value ? (ushort)1 : (ushort)0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(char value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(sbyte value) { if (value < 0) throw new OverflowException(("Overflow_UInt16")); @@ -850,14 +850,14 @@ public static ushort ToUInt16(sbyte value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(short value) { if (value < 0) throw new OverflowException(("Overflow_UInt16")); @@ -866,7 +866,7 @@ public static ushort ToUInt16(short value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(int value) { if (value < 0 || value > ushort.MaxValue) throw new OverflowException(("Overflow_UInt16")); @@ -875,14 +875,14 @@ public static ushort ToUInt16(int value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(uint value) { if (value > ushort.MaxValue) throw new OverflowException(("Overflow_UInt16")); @@ -891,7 +891,7 @@ public static ushort ToUInt16(uint value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(long value) { if (value < 0 || value > ushort.MaxValue) throw new OverflowException(("Overflow_UInt16")); @@ -900,7 +900,7 @@ public static ushort ToUInt16(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(ulong value) { if (value > ushort.MaxValue) throw new OverflowException(("Overflow_UInt16")); @@ -909,28 +909,28 @@ public static ushort ToUInt16(ulong value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(float value) { return ToUInt16((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(double value) { return ToUInt16(ToInt32(value)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(decimal value) { return decimal.ToUInt16(decimal.Round(value, 0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(string value) { if (value == null) @@ -939,7 +939,7 @@ public static ushort ToUInt16(string value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(string value, IFormatProvider provider) { if (value == null) @@ -948,70 +948,70 @@ public static ushort ToUInt16(string value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(DateTime value) { return ((IConvertible)value).ToUInt16(null); } // Disallowed conversions to UInt16 - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static ushort ToUInt16(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static ushort ToUInt16(TimeSpan value) // Conversions to Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(object value) { return value == null ? 0 : ((IConvertible)value).ToInt32(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(object value, IFormatProvider provider) { return value == null ? 0 : ((IConvertible)value).ToInt32(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(bool value) { return value ? 1 : 0; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(char value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(sbyte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(short value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(uint value) { if (value > int.MaxValue) throw new OverflowException(("Overflow_Int32")); @@ -1019,13 +1019,13 @@ public static int ToInt32(uint value) return (int)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(int value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(long value) { if (value < int.MinValue || value > int.MaxValue) throw new OverflowException(("Overflow_Int32")); @@ -1034,7 +1034,7 @@ public static int ToInt32(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(ulong value) { if (value > int.MaxValue) throw new OverflowException(("Overflow_Int32")); @@ -1042,13 +1042,13 @@ public static int ToInt32(ulong value) return (int)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(float value) { return ToInt32((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(double value) { if (value >= 0) @@ -1076,13 +1076,13 @@ public static int ToInt32(double value) } [System.Security.SecuritySafeCritical] // auto-generated - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(decimal value) { return Converts.ToInt32(value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(string value) { if (value == null) @@ -1090,7 +1090,7 @@ public static int ToInt32(string value) return int.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(string value, IFormatProvider provider) { if (value == null) @@ -1098,7 +1098,7 @@ public static int ToInt32(string value, IFormatProvider provider) return int.Parse(value, NumberStyles.Integer, provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToInt32(DateTime value) { return ((IConvertible)value).ToInt32(null); @@ -1106,40 +1106,40 @@ public static int ToInt32(DateTime value) // Disallowed conversions to Int32 - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static int ToInt32(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static int ToInt32(TimeSpan value) // Conversions to UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(object value) { return value == null ? 0 : ((IConvertible)value).ToUInt32(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(object value, IFormatProvider provider) { return value == null ? 0 : ((IConvertible)value).ToUInt32(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(bool value) { return value ? 1u : 0u; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(char value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(sbyte value) { if (value < 0) throw new OverflowException(("Overflow_UInt32")); @@ -1148,14 +1148,14 @@ public static uint ToUInt32(sbyte value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(short value) { if (value < 0) throw new OverflowException(("Overflow_UInt32")); @@ -1164,14 +1164,14 @@ public static uint ToUInt32(short value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(int value) { if (value < 0) throw new OverflowException(("Overflow_UInt32")); @@ -1180,14 +1180,14 @@ public static uint ToUInt32(int value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(uint value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(long value) { if (value < 0 || value > uint.MaxValue) throw new OverflowException(("Overflow_UInt32")); @@ -1196,7 +1196,7 @@ public static uint ToUInt32(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(ulong value) { if (value > uint.MaxValue) throw new OverflowException(("Overflow_UInt32")); @@ -1205,14 +1205,14 @@ public static uint ToUInt32(ulong value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(float value) { return ToUInt32((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(double value) { if (value >= -0.5 && value < 4294967295.5) @@ -1227,14 +1227,14 @@ public static uint ToUInt32(double value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(decimal value) { return decimal.ToUInt32(decimal.Round(value, 0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(string value) { if (value == null) @@ -1243,7 +1243,7 @@ public static uint ToUInt32(string value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(string value, IFormatProvider provider) { if (value == null) @@ -1252,83 +1252,83 @@ public static uint ToUInt32(string value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(DateTime value) { return ((IConvertible)value).ToUInt32(null); } // Disallowed conversions to UInt32 - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static uint ToUInt32(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static uint ToUInt32(TimeSpan value) // Conversions to Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(object value) { return value == null ? 0 : ((IConvertible)value).ToInt64(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(object value, IFormatProvider provider) { return value == null ? 0 : ((IConvertible)value).ToInt64(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(bool value) { return value ? 1L : 0L; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(char value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(sbyte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(short value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(int value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(uint value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(ulong value) { if (value > long.MaxValue) throw new OverflowException(("Overflow_Int64")); @@ -1336,32 +1336,32 @@ public static long ToInt64(ulong value) return (long)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(long value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(float value) { return ToInt64((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(double value) { return checked((long)Math.Round(value)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(decimal value) { return decimal.ToInt64(decimal.Round(value, 0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(string value) { if (value == null) @@ -1369,7 +1369,7 @@ public static long ToInt64(string value) return long.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(string value, IFormatProvider provider) { if (value == null) @@ -1377,47 +1377,47 @@ public static long ToInt64(string value, IFormatProvider provider) return long.Parse(value, NumberStyles.Integer, provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static long ToInt64(DateTime value) { return ((IConvertible)value).ToInt64(null); } // Disallowed conversions to Int64 - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static long ToInt64(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static long ToInt64(TimeSpan value) // Conversions to UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(object value) { return value == null ? 0 : ((IConvertible)value).ToUInt64(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(object value, IFormatProvider provider) { return value == null ? 0 : ((IConvertible)value).ToUInt64(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(bool value) { return value ? 1ul : 0ul; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(char value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(sbyte value) { if (value < 0) throw new OverflowException(("Overflow_UInt64")); @@ -1426,14 +1426,14 @@ public static ulong ToUInt64(sbyte value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(short value) { if (value < 0) throw new OverflowException(("Overflow_UInt64")); @@ -1442,14 +1442,14 @@ public static ulong ToUInt64(short value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(int value) { if (value < 0) throw new OverflowException(("Overflow_UInt64")); @@ -1458,14 +1458,14 @@ public static ulong ToUInt64(int value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(uint value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(long value) { if (value < 0) throw new OverflowException(("Overflow_UInt64")); @@ -1474,35 +1474,35 @@ public static ulong ToUInt64(long value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(ulong value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(float value) { return ToUInt64((double)value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(double value) { return checked((ulong)Math.Round(value)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(decimal value) { return decimal.ToUInt64(decimal.Round(value, 0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(string value) { if (value == null) @@ -1511,7 +1511,7 @@ public static ulong ToUInt64(string value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(string value, IFormatProvider provider) { if (value == null) @@ -1520,106 +1520,106 @@ public static ulong ToUInt64(string value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(DateTime value) { return ((IConvertible)value).ToUInt64(null); } // Disallowed conversions to UInt64 - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static ulong ToUInt64(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static ulong ToUInt64(TimeSpan value) // Conversions to Single - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(object value) { return value == null ? 0 : ((IConvertible)value).ToSingle(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(object value, IFormatProvider provider) { return value == null ? 0 : ((IConvertible)value).ToSingle(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(sbyte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(char value) { return ((IConvertible)value).ToSingle(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(short value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(int value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(uint value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(long value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(ulong value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(float value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(double value) { return (float)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(decimal value) { return (float)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(string value) { if (value == null) @@ -1627,7 +1627,7 @@ public static float ToSingle(string value) return float.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(string value, IFormatProvider provider) { if (value == null) @@ -1636,112 +1636,112 @@ public static float ToSingle(string value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(bool value) { return value ? 1f : 0f; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static float ToSingle(DateTime value) { return ((IConvertible)value).ToSingle(null); } // Disallowed conversions to Single - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static float ToSingle(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static float ToSingle(TimeSpan value) // Conversions to Double - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(object value) { return value == null ? 0 : ((IConvertible)value).ToDouble(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(object value, IFormatProvider provider) { return value == null ? 0 : ((IConvertible)value).ToDouble(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(sbyte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(short value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(char value) { return ((IConvertible)value).ToDouble(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(int value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(uint value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(long value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(ulong value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(float value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(double value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(decimal value) { return (double)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(string value) { if (value == null) @@ -1749,7 +1749,7 @@ public static double ToDouble(string value) return double.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(string value, IFormatProvider provider) { if (value == null) @@ -1757,106 +1757,106 @@ public static double ToDouble(string value, IFormatProvider provider) return double.Parse(value, NumberStyles.Float | NumberStyles.AllowThousands, provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(bool value) { return value ? 1d : 0d; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static double ToDouble(DateTime value) { return ((IConvertible)value).ToDouble(null); } // Disallowed conversions to Double - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static double ToDouble(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static double ToDouble(TimeSpan value) // Conversions to Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(object value) { return value == null ? 0 : ((IConvertible)value).ToDecimal(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(object value, IFormatProvider provider) { return value == null ? 0 : ((IConvertible)value).ToDecimal(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(sbyte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(byte value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(char value) { return ((IConvertible)value).ToDecimal(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(short value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(ushort value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(int value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(uint value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(long value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(ulong value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(float value) { return (decimal)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(double value) { return (decimal)value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(string value) { if (value == null) @@ -1864,7 +1864,7 @@ public static decimal ToDecimal(string value) return decimal.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(string value, IFormatProvider provider) { if (value == null) @@ -1872,48 +1872,48 @@ public static decimal ToDecimal(string value, IFormatProvider provider) return decimal.Parse(value, NumberStyles.Number, provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(decimal value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(bool value) { return value ? 1m : 0m; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(DateTime value) { return ((IConvertible)value).ToDecimal(null); } // Disallowed conversions to Decimal - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static decimal ToDecimal(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static decimal ToDecimal(TimeSpan value) // Conversions to DateTime - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(DateTime value) { return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(object value) { return value == null ? DateTime.MinValue : ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(object value, IFormatProvider provider) { return value == null ? DateTime.MinValue : ((IConvertible)value).ToDateTime(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(string value) { if (value == null) @@ -1921,7 +1921,7 @@ public static DateTime ToDateTime(string value) return DateTime.Parse(value, CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(string value, IFormatProvider provider) { if (value == null) @@ -1930,99 +1930,99 @@ public static DateTime ToDateTime(string value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(sbyte value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(byte value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(short value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(ushort value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(int value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(uint value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(long value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(ulong value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(bool value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(char value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(float value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(double value) { return ((IConvertible)value).ToDateTime(null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(decimal value) { return ((IConvertible)value).ToDateTime(null); } // Disallowed conversions to DateTime - // [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] public static DateTime ToDateTime(TimeSpan value) + // [MethodImpl(OptimizeAndInline)] public static DateTime ToDateTime(TimeSpan value) // Conversions to String - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(object value) { return ToString(value, null); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(object value, IFormatProvider provider) { switch (value) @@ -2036,28 +2036,28 @@ public static string ToString(object value, IFormatProvider provider) } } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(bool value) { Contract.Ensures(Contract.Result() != null); return value.ToString(); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(bool value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(char value) { Contract.Ensures(Contract.Result() != null); return char.ToString(value); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(char value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); @@ -2065,7 +2065,7 @@ public static string ToString(char value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(sbyte value) { Contract.Ensures(Contract.Result() != null); @@ -2073,35 +2073,35 @@ public static string ToString(sbyte value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(sbyte value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(byte value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(byte value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(short value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(short value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); @@ -2109,7 +2109,7 @@ public static string ToString(short value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(ushort value) { Contract.Ensures(Contract.Result() != null); @@ -2117,21 +2117,21 @@ public static string ToString(ushort value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(ushort value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(int value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(int value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); @@ -2139,7 +2139,7 @@ public static string ToString(int value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(uint value) { Contract.Ensures(Contract.Result() != null); @@ -2147,21 +2147,21 @@ public static string ToString(uint value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(uint value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(long value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(long value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); @@ -2169,7 +2169,7 @@ public static string ToString(long value, IFormatProvider provider) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(ulong value) { Contract.Ensures(Contract.Result() != null); @@ -2177,84 +2177,84 @@ public static string ToString(ulong value) } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(ulong value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(float value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(float value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(double value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(double value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(decimal value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.CurrentCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(decimal value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(DateTime value) { Contract.Ensures(Contract.Result() != null); return value.ToString(CultureInfo.InvariantCulture); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(DateTime value, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); return value.ToString(provider); } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(string value) { Contract.Ensures(Contract.Result() == value); // We were always skipping the null check here. return value; } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static string ToString(string value, IFormatProvider provider) { Contract.Ensures(Contract.Result() == value); // We were always skipping the null check here. return value; // avoid the null check } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut) { Contract.Ensures(Contract.Result() >= 0); @@ -2266,7 +2266,7 @@ public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, ch [System.Security.SecuritySafeCritical] // auto-generated [System.Runtime.InteropServices.ComVisible(false)] - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static unsafe int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut, Base64FormattingOptions options) { //Do data verfication @@ -2422,7 +2422,7 @@ private static int ToBase64_CalculateAndValidateOutputLength(int inputLength, bo /// The string to convert /// The array of bytes represented by the specifed Base64 string. [SecuritySafeCritical] - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte[] FromBase64String(string s) { // "s" is an unfortunate parameter name, but we need to keep it for backward compat. @@ -2450,7 +2450,7 @@ public static byte[] FromBase64String(string s) /// Number of element to convert. /// The array of bytes represented by the specified Base64 encoding characters. [SecuritySafeCritical] - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static byte[] FromBase64CharArray(char[] inArray, int offset, int length) { if (inArray == null) diff --git a/src/NumSharp.Core/Utilities/Converts.cs b/src/NumSharp.Core/Utilities/Converts.cs index 9e6cfe56..0b15915c 100644 --- a/src/NumSharp.Core/Utilities/Converts.cs +++ b/src/NumSharp.Core/Utilities/Converts.cs @@ -25,7 +25,7 @@ public static partial class Converts /// value is not in a format recognized by the typeCode type. /// value represents a number that is out of the range of the typeCode type. /// typeCode is invalid. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static TOut ChangeType(Object value) { if (value == null) @@ -84,7 +84,7 @@ public static TOut ChangeType(Object value) /// value is not in a format recognized by the typeCode type. /// value represents a number that is out of the range of the typeCode type. /// typeCode is invalid. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static Object ChangeType(Object value, NPTypeCode typeCode) { if (value == null && (typeCode == NPTypeCode.Empty || typeCode == NPTypeCode.String)) @@ -142,7 +142,7 @@ public static Object ChangeType(Object value, NPTypeCode typeCode) /// value is not in a format recognized by the typeCode type. /// value represents a number that is out of the range of the typeCode type. /// typeCode is invalid. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static Object ChangeType(T value, NPTypeCode typeCode) where T : IConvertible { if (value == null && (typeCode == NPTypeCode.Empty || typeCode == NPTypeCode.String)) @@ -409,7 +409,7 @@ public static Object ChangeType(T value, NPTypeCode typeCode) where T : IConv /// value is not in a format recognized by the typeCode type. /// value represents a number that is out of the range of the typeCode type. /// typeCode is invalid. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static TOut ChangeType(TIn value) where TIn : IConvertible where TOut : IConvertible { // This line is invalid for things like Enums that return a NPTypeCode @@ -686,7 +686,7 @@ public static TOut ChangeType(TIn value) where TIn : IConvertible whe /// value is not in a format recognized by the typeCode type. /// value represents a number that is out of the range of the typeCode type. /// typeCode is invalid. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static Object ChangeType(Object value, NPTypeCode typeCode, IFormatProvider provider) { if (value == null && (typeCode == NPTypeCode.Empty || typeCode == NPTypeCode.String)) @@ -1647,7 +1647,7 @@ public static Func FindConverter() #region Compute %foreach supported_dtypes,supported_dtypes_lowercase% - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static #2 To#1(NDArray nd) { if (nd.size != 1) @@ -1662,7 +1662,7 @@ public static Func FindConverter() #region Compute - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static bool ToBoolean(NDArray nd) { if (nd.size != 1) @@ -1671,7 +1671,7 @@ public static bool ToBoolean(NDArray nd) return nd.typecode == NPTypeCode.Boolean ? nd.GetAtIndex(0) : Converts.ToBoolean(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte ToByte(NDArray nd) { if (nd.size != 1) @@ -1680,7 +1680,7 @@ public static byte ToByte(NDArray nd) return nd.typecode == NPTypeCode.Byte ? nd.GetAtIndex(0) : Converts.ToByte(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short ToInt16(NDArray nd) { if (nd.size != 1) @@ -1689,7 +1689,7 @@ public static short ToInt16(NDArray nd) return nd.typecode == NPTypeCode.Int16 ? nd.GetAtIndex(0) : Converts.ToInt16(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort ToUInt16(NDArray nd) { if (nd.size != 1) @@ -1698,7 +1698,7 @@ public static ushort ToUInt16(NDArray nd) return nd.typecode == NPTypeCode.UInt16 ? nd.GetAtIndex(0) : Converts.ToUInt16(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int ToInt32(NDArray nd) { if (nd.size != 1) @@ -1707,7 +1707,7 @@ public static int ToInt32(NDArray nd) return nd.typecode == NPTypeCode.Int32 ? nd.GetAtIndex(0) : Converts.ToInt32(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint ToUInt32(NDArray nd) { if (nd.size != 1) @@ -1716,7 +1716,7 @@ public static uint ToUInt32(NDArray nd) return nd.typecode == NPTypeCode.UInt32 ? nd.GetAtIndex(0) : Converts.ToUInt32(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long ToInt64(NDArray nd) { if (nd.size != 1) @@ -1725,7 +1725,7 @@ public static long ToInt64(NDArray nd) return nd.typecode == NPTypeCode.Int64 ? nd.GetAtIndex(0) : Converts.ToInt64(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong ToUInt64(NDArray nd) { if (nd.size != 1) @@ -1734,7 +1734,7 @@ public static ulong ToUInt64(NDArray nd) return nd.typecode == NPTypeCode.UInt64 ? nd.GetAtIndex(0) : Converts.ToUInt64(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static char ToChar(NDArray nd) { if (nd.size != 1) @@ -1743,7 +1743,7 @@ public static char ToChar(NDArray nd) return nd.typecode == NPTypeCode.Char ? nd.GetAtIndex(0) : Converts.ToChar(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double ToDouble(NDArray nd) { if (nd.size != 1) @@ -1752,7 +1752,7 @@ public static double ToDouble(NDArray nd) return nd.typecode == NPTypeCode.Double ? nd.GetAtIndex(0) : Converts.ToDouble(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float ToSingle(NDArray nd) { if (nd.size != 1) @@ -1761,7 +1761,7 @@ public static float ToSingle(NDArray nd) return nd.typecode == NPTypeCode.Single ? nd.GetAtIndex(0) : Converts.ToSingle(nd.GetAtIndex(0)); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal ToDecimal(NDArray nd) { if (nd.size != 1) diff --git a/src/NumSharp.Core/Utilities/Converts`1.cs b/src/NumSharp.Core/Utilities/Converts`1.cs index 4522f172..bf818b47 100644 --- a/src/NumSharp.Core/Utilities/Converts`1.cs +++ b/src/NumSharp.Core/Utilities/Converts`1.cs @@ -25,7 +25,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static #2 To#1(T obj) => _to#1(obj); + [MethodImpl(Inline)] public static #2 To#1(T obj) => _to#1(obj); private static readonly Func _to#1 = Converts.FindConverter(); % @@ -34,7 +34,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static String ToString(T obj) => _toString(obj); + [MethodImpl(Inline)] public static String ToString(T obj) => _toString(obj); private static readonly Func _toString = Converts.FindConverter(); #endregion #else @@ -46,7 +46,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static bool ToBoolean(T obj) => _toBoolean(obj); private static readonly Func _toBoolean = Converts.FindConverter(); @@ -56,7 +56,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte ToByte(T obj) => _toByte(obj); private static readonly Func _toByte = Converts.FindConverter(); @@ -66,7 +66,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short ToInt16(T obj) => _toInt16(obj); private static readonly Func _toInt16 = Converts.FindConverter(); @@ -76,7 +76,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort ToUInt16(T obj) => _toUInt16(obj); private static readonly Func _toUInt16 = Converts.FindConverter(); @@ -86,7 +86,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int ToInt32(T obj) => _toInt32(obj); private static readonly Func _toInt32 = Converts.FindConverter(); @@ -96,7 +96,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint ToUInt32(T obj) => _toUInt32(obj); private static readonly Func _toUInt32 = Converts.FindConverter(); @@ -106,7 +106,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long ToInt64(T obj) => _toInt64(obj); private static readonly Func _toInt64 = Converts.FindConverter(); @@ -116,7 +116,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong ToUInt64(T obj) => _toUInt64(obj); private static readonly Func _toUInt64 = Converts.FindConverter(); @@ -126,7 +126,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static char ToChar(T obj) => _toChar(obj); private static readonly Func _toChar = Converts.FindConverter(); @@ -136,7 +136,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double ToDouble(T obj) => _toDouble(obj); private static readonly Func _toDouble = Converts.FindConverter(); @@ -146,7 +146,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float ToSingle(T obj) => _toSingle(obj); private static readonly Func _toSingle = Converts.FindConverter(); @@ -156,7 +156,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal ToDecimal(T obj) => _toDecimal(obj); private static readonly Func _toDecimal = Converts.FindConverter(); @@ -166,7 +166,7 @@ static Converts() /// /// The object to convert to /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String ToString(T obj) => _toString(obj); private static readonly Func _toString = Converts.FindConverter(); @@ -183,7 +183,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(#2 obj) => _from#1(obj); + [MethodImpl(Inline)] public static T From(#2 obj) => _from#1(obj); private static readonly Func<#2, T> _from#1 = Converts.FindConverter<#2, T>(); % @@ -192,7 +192,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(string obj) => _fromString(obj); + [MethodImpl(Inline)] public static T From(string obj) => _fromString(obj); private static readonly Func _fromString = Converts.FindConverter(); #endregion #else @@ -203,7 +203,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(bool obj) => _fromBoolean(obj); + [MethodImpl(Inline)] public static T From(bool obj) => _fromBoolean(obj); private static readonly Func _fromBoolean = Converts.FindConverter(); /// @@ -211,7 +211,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(byte obj) => _fromByte(obj); + [MethodImpl(Inline)] public static T From(byte obj) => _fromByte(obj); private static readonly Func _fromByte = Converts.FindConverter(); /// @@ -219,7 +219,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(short obj) => _fromInt16(obj); + [MethodImpl(Inline)] public static T From(short obj) => _fromInt16(obj); private static readonly Func _fromInt16 = Converts.FindConverter(); /// @@ -227,7 +227,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(ushort obj) => _fromUInt16(obj); + [MethodImpl(Inline)] public static T From(ushort obj) => _fromUInt16(obj); private static readonly Func _fromUInt16 = Converts.FindConverter(); /// @@ -235,7 +235,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(int obj) => _fromInt32(obj); + [MethodImpl(Inline)] public static T From(int obj) => _fromInt32(obj); private static readonly Func _fromInt32 = Converts.FindConverter(); /// @@ -243,7 +243,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(uint obj) => _fromUInt32(obj); + [MethodImpl(Inline)] public static T From(uint obj) => _fromUInt32(obj); private static readonly Func _fromUInt32 = Converts.FindConverter(); /// @@ -251,7 +251,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(long obj) => _fromInt64(obj); + [MethodImpl(Inline)] public static T From(long obj) => _fromInt64(obj); private static readonly Func _fromInt64 = Converts.FindConverter(); /// @@ -259,7 +259,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(ulong obj) => _fromUInt64(obj); + [MethodImpl(Inline)] public static T From(ulong obj) => _fromUInt64(obj); private static readonly Func _fromUInt64 = Converts.FindConverter(); /// @@ -267,7 +267,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(char obj) => _fromChar(obj); + [MethodImpl(Inline)] public static T From(char obj) => _fromChar(obj); private static readonly Func _fromChar = Converts.FindConverter(); /// @@ -275,7 +275,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(double obj) => _fromDouble(obj); + [MethodImpl(Inline)] public static T From(double obj) => _fromDouble(obj); private static readonly Func _fromDouble = Converts.FindConverter(); /// @@ -283,7 +283,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(float obj) => _fromSingle(obj); + [MethodImpl(Inline)] public static T From(float obj) => _fromSingle(obj); private static readonly Func _fromSingle = Converts.FindConverter(); /// @@ -291,7 +291,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(decimal obj) => _fromDecimal(obj); + [MethodImpl(Inline)] public static T From(decimal obj) => _fromDecimal(obj); private static readonly Func _fromDecimal = Converts.FindConverter(); /// @@ -299,7 +299,7 @@ static Converts() /// /// The object to convert to from /// A - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T From(string obj) => _fromString(obj); + [MethodImpl(Inline)] public static T From(string obj) => _fromString(obj); private static readonly Func _fromString = Converts.FindConverter(); #endregion #endif diff --git a/src/NumSharp.Core/Utilities/DecimalEx.cs b/src/NumSharp.Core/Utilities/DecimalEx.cs index b8109284..b00ee490 100644 --- a/src/NumSharp.Core/Utilities/DecimalEx.cs +++ b/src/NumSharp.Core/Utilities/DecimalEx.cs @@ -12,7 +12,7 @@ namespace DecimalMath /// public static partial class DecimalEx { - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Abs(decimal a) { if (a >= 0) @@ -29,7 +29,7 @@ public static decimal Abs(decimal a) /// Uses an implementation of the "Babylonian Method". /// See http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Sqrt(decimal s) { if (s < 0) @@ -69,7 +69,7 @@ public static decimal Sqrt(decimal s) /// /// A number to be raised to a power. /// A number that specifies a power. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Pow(decimal x, decimal y) { decimal result; @@ -123,7 +123,7 @@ public static decimal Pow(decimal x, decimal y) /// /// See http://en.wikipedia.org/wiki/Exponentiation_by_squaring /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] private static decimal ExpBySquaring(decimal x, decimal y) { Debug.Assert(y >= 0 && decimal.Truncate(y) == y, "Only non-negative, integer powers supported."); @@ -153,7 +153,7 @@ private static decimal ExpBySquaring(decimal x, decimal y) /// Returns e raised to the specified power. /// /// A number specifying a power. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Exp(decimal d) { decimal result; @@ -226,7 +226,7 @@ public static decimal Exp(decimal d) /// algorithms that you can find in a historical version of this /// source file. The one I settled on was the best of mediocrity. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Log(decimal d) { if (d < 0) throw new ArgumentException("Natural logarithm is a complex number for values less than zero!", "d"); @@ -294,7 +294,7 @@ public static decimal Log(decimal d) /// This is a relatively naive implementation that simply divides the /// natural log of by the natural log of the base. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Log(decimal d, decimal newBase) { // Short circuit the checks below if d is 1 because @@ -315,7 +315,7 @@ public static decimal Log(decimal d, decimal newBase) /// Returns the base 10 logarithm of a specified number. /// /// A number whose logarithm is to be found. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Log10(decimal d) { if (d < 0) throw new ArgumentException("Logarithm is a complex number for values less than zero!", nameof(d)); @@ -328,7 +328,7 @@ public static decimal Log10(decimal d) /// Returns the base 2 logarithm of a specified number. /// /// A number whose logarithm is to be found. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Log2(decimal d) { if (d < 0) throw new ArgumentException("Logarithm is a complex number for values less than zero!", nameof(d)); @@ -345,7 +345,7 @@ public static decimal Log2(decimal d) /// /// Only supports non-negative integers. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Factorial(decimal n) { if (n < 0) throw new ArgumentException("Values less than zero are not supoprted!", "n"); @@ -371,7 +371,7 @@ public static decimal Factorial(decimal n) /// Will return empty results where there is no solution and for complex solutions. /// See http://www.wikihow.com/Factor-Second-Degree-Polynomials-%28Quadratic-Equations%29 /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal[] SolveQuadratic(decimal a, decimal b, decimal c) { // Horizontal line is either 0 nowhere or everywhere so no solution. @@ -430,7 +430,7 @@ public static decimal[] SolveQuadratic(decimal a, decimal b, decimal c) /// A decimal value. /// An integer representing the maximum number of digits /// after the decimal point to end up with. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Floor(decimal value, int places = 0) { if (places < 0) throw new ArgumentOutOfRangeException("places", "Places must be greater than or equal to 0."); @@ -449,7 +449,7 @@ public static decimal Floor(decimal value, int places = 0) /// A decimal value. /// An integer representing the maximum number of digits /// after the decimal point to end up with. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Ceiling(decimal value, int places = 0) { if (places < 0) throw new ArgumentOutOfRangeException("places", "Places must be greater than or equal to 0."); @@ -471,7 +471,7 @@ public static decimal Ceiling(decimal value, int places = 0) /// same precision as the most precise value. /// For example, 1.2 and 0.42 will yield 0.06. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal GCF(decimal a, decimal b) { // Run Euclid's algorithm @@ -489,7 +489,7 @@ public static decimal GCF(decimal a, decimal b) /// /// Gets the greatest common factor of three or more numbers. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal GCF(decimal a, decimal b, params decimal[] values) { return values.Aggregate(GCF(a, b), (current, value) => GCF(current, value)); @@ -507,7 +507,7 @@ public static decimal GCF(decimal a, decimal b, params decimal[] values) /// natural logarithm: http://en.wikipedia.org/wiki/Natural_logarithm#High_precision /// But it didn't yield a precise enough answer. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal AGMean(decimal x, decimal y) { decimal a; @@ -552,7 +552,7 @@ public static decimal AGMean(decimal x, decimal y) /// Simply uses LINQ's Average function, but switches to a potentially less /// accurate method of summing each value divided by the number of values. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Average(params decimal[] values) { decimal avg; @@ -576,7 +576,7 @@ public static decimal Average(params decimal[] values) /// /// Started with something found here: http://stackoverflow.com/a/6092298/856595 /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static int GetDecimalPlaces(decimal dec, bool countTrailingZeros) { const int signMask = unchecked((int)0x80000000); @@ -606,7 +606,7 @@ public static int GetDecimalPlaces(decimal dec, bool countTrailingZeros) /// /// Gets the remainder of one number divided by another number in such a way as to retain maximum precision. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Remainder(decimal d1, decimal d2) { if (Math.Abs(d1) < Math.Abs(d2)) return d1; @@ -693,7 +693,7 @@ public static decimal Remainder(decimal d1, decimal d2) /// Converts degrees to radians. (π radians = 180 degrees) /// /// The degrees to convert. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToRad(decimal degrees) { if (degrees % 360m == 0) @@ -733,7 +733,7 @@ public static decimal ToRad(decimal degrees) /// Converts radians to degrees. (π radians = 180 degrees) /// /// The radians to convert. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ToDeg(decimal radians) { const decimal ratio = 180m / Pi; @@ -745,7 +745,7 @@ public static decimal ToDeg(decimal radians) /// Normalizes an angle in radians to the 0 to 2Pi interval. /// /// Angle in radians. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal NormalizeAngle(decimal radians) { radians = Remainder(radians, TwoPi); @@ -757,7 +757,7 @@ public static decimal NormalizeAngle(decimal radians) /// Normalizes an angle in degrees to the 0 to 360 degree interval. /// /// Angle in degrees. - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal NormalizeAngleDeg(decimal degrees) { degrees = degrees % 360m; @@ -773,7 +773,7 @@ public static decimal NormalizeAngleDeg(decimal degrees) /// Uses a Taylor series to calculate sine. See /// http://en.wikipedia.org/wiki/Trigonometric_functions for details. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Sin(decimal x) { // Normalize to between -2Pi <= x <= 2Pi @@ -834,7 +834,7 @@ public static decimal Sin(decimal x) /// Uses a Taylor series to calculate sine. See /// http://en.wikipedia.org/wiki/Trigonometric_functions for details. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Cos(decimal x) { // Normalize to between -2Pi <= x <= 2Pi @@ -893,7 +893,7 @@ public static decimal Cos(decimal x) /// Uses a Taylor series to calculate sine. See /// http://en.wikipedia.org/wiki/Trigonometric_functions for details. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal Tan(decimal radians) { try @@ -917,7 +917,7 @@ public static decimal Tan(decimal radians) /// around -1 and 1 (millions of iterations) and still ends up being less /// accurate than deriving from the ATan function. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ASin(decimal z) { if (z < -1 || z > 1) @@ -941,7 +941,7 @@ public static decimal ASin(decimal z) /// See http://en.wikipedia.org/wiki/Inverse_trigonometric_function /// and http://mathworld.wolfram.com/InverseCosine.html /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ACos(decimal z) { if (z < -1 || z > 1) @@ -965,7 +965,7 @@ public static decimal ACos(decimal z) /// See http://mathworld.wolfram.com/InverseTangent.html for faster converging /// series from Euler that was used here. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ATan(decimal x) { // Special cases @@ -1027,7 +1027,7 @@ public static decimal ATan(decimal x) /// For (x, y) in quadrant 3, -π < θ < -π/2. /// For (x, y) in quadrant 4, -π/2 < θ < 0. /// - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions)512)] + [MethodImpl(OptimizeAndInline)] public static decimal ATan2(decimal y, decimal x) { if (x == 0 && y == 0) diff --git a/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesAxisIncrementor.cs b/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesAxisIncrementor.cs index 6950e0ac..761f6640 100644 --- a/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesAxisIncrementor.cs +++ b/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesAxisIncrementor.cs @@ -90,7 +90,7 @@ public void Reset() subcursor = resetto; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public Slice[] Next() { if (subcursor <= -1) diff --git a/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesIncrementor.cs b/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesIncrementor.cs index 8781bff9..4e98e631 100644 --- a/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesIncrementor.cs +++ b/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesIncrementor.cs @@ -51,7 +51,7 @@ public void Reset() subcursor = resetto; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int[] Next() { if (subcursor <= -1) @@ -122,7 +122,7 @@ public void Reset() subcursor = resetto; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int[] Next() { if (++Index[subcursor] >= dimensions[subcursor]) diff --git a/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesLeftToAxisIncrementor.cs b/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesLeftToAxisIncrementor.cs index 95816f8f..8b080879 100644 --- a/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesLeftToAxisIncrementor.cs +++ b/src/NumSharp.Core/Utilities/Incrementors/NDCoordinatesLeftToAxisIncrementor.cs @@ -90,7 +90,7 @@ public void Reset() subcursor = resetto; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public Slice[] Next() { if (subcursor <= -1) diff --git a/src/NumSharp.Core/Utilities/Incrementors/NDExtendedCoordinatesIncrementor.cs b/src/NumSharp.Core/Utilities/Incrementors/NDExtendedCoordinatesIncrementor.cs index 26f942ac..a2d051d2 100644 --- a/src/NumSharp.Core/Utilities/Incrementors/NDExtendedCoordinatesIncrementor.cs +++ b/src/NumSharp.Core/Utilities/Incrementors/NDExtendedCoordinatesIncrementor.cs @@ -42,7 +42,7 @@ public void Reset() subcursor = resetto; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int[] Next() { if (subcursor <= -1) @@ -75,7 +75,7 @@ public int[] Next() return Index; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int[] Next(params int[] extendedIndices) { if (subcursor <= -1) diff --git a/src/NumSharp.Core/Utilities/Incrementors/NDOffsetIncrementor.cs b/src/NumSharp.Core/Utilities/Incrementors/NDOffsetIncrementor.cs index 8e7300c0..69e84771 100644 --- a/src/NumSharp.Core/Utilities/Incrementors/NDOffsetIncrementor.cs +++ b/src/NumSharp.Core/Utilities/Incrementors/NDOffsetIncrementor.cs @@ -27,7 +27,7 @@ public void Reset() hasNext = true; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int Next() { if (!hasNext) @@ -77,7 +77,7 @@ public void Reset() incr.Reset(); } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int Next() { int offset = 0; diff --git a/src/NumSharp.Core/Utilities/Incrementors/ValueCoordinatesIncrementor.cs b/src/NumSharp.Core/Utilities/Incrementors/ValueCoordinatesIncrementor.cs index 9c47e7e7..73923426 100644 --- a/src/NumSharp.Core/Utilities/Incrementors/ValueCoordinatesIncrementor.cs +++ b/src/NumSharp.Core/Utilities/Incrementors/ValueCoordinatesIncrementor.cs @@ -54,7 +54,7 @@ public void Reset() subcursor = resetto; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int[] Next() { if (subcursor <= -1) @@ -125,7 +125,7 @@ public void Reset() subcursor = resetto; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int[] Next() { if (++Index[subcursor] >= dimensions[subcursor]) diff --git a/src/NumSharp.Core/Utilities/Incrementors/ValueOffsetIncrementor.cs b/src/NumSharp.Core/Utilities/Incrementors/ValueOffsetIncrementor.cs index 02efe965..daee648c 100644 --- a/src/NumSharp.Core/Utilities/Incrementors/ValueOffsetIncrementor.cs +++ b/src/NumSharp.Core/Utilities/Incrementors/ValueOffsetIncrementor.cs @@ -27,7 +27,7 @@ public void Reset() _hasNext = true; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int Next() { if (!_hasNext) @@ -77,7 +77,7 @@ public void Reset() incr.Reset(); } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public int Next() { int offset = 0; diff --git a/src/NumSharp.Core/Utilities/Maths/Operator.cs b/src/NumSharp.Core/Utilities/Maths/Operator.cs index 5421bb2a..af363808 100644 --- a/src/NumSharp.Core/Utilities/Maths/Operator.cs +++ b/src/NumSharp.Core/Utilities/Maths/Operator.cs @@ -20,7 +20,7 @@ internal class Operator %foreach ops,names% %foreach supported_numericals,supported_numericals_lowercase% %foreach supported_numericals,supported_numericals_lowercase% - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static #(np.find_common_type(#101.ToString(), #201.ToString())) #2(#101 lhs, #201 rhs) => lhs #1 rhs; + [MethodImpl(Inline)] public static #(np.find_common_type(#101.ToString(), #201.ToString())) #2(#101 lhs, #201 rhs) => lhs #1 rhs; % % % @@ -29,18 +29,18 @@ internal class Operator #endif //boolean gen - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Add(bool lhs, bool rhs) => (lhs || rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Subtract(bool lhs, bool rhs) => ((lhs ? 1 : 0) - (rhs ? 1 : 0)) != 0; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Multiply(bool lhs, bool rhs) => lhs && rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Mod(bool lhs, bool rhs) => ((lhs ? 1 : 0) % (rhs ? 1 : 0)) != 0; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Divide(bool lhs, bool rhs) => lhs && rhs; + [MethodImpl(Inline)] public static bool Add(bool lhs, bool rhs) => (lhs || rhs); + [MethodImpl(Inline)] public static bool Subtract(bool lhs, bool rhs) => ((lhs ? 1 : 0) - (rhs ? 1 : 0)) != 0; + [MethodImpl(Inline)] public static bool Multiply(bool lhs, bool rhs) => lhs && rhs; + [MethodImpl(Inline)] public static bool Mod(bool lhs, bool rhs) => ((lhs ? 1 : 0) % (rhs ? 1 : 0)) != 0; + [MethodImpl(Inline)] public static bool Divide(bool lhs, bool rhs) => lhs && rhs; //boolean gen - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int AddBoolean(bool lhs, bool rhs) => (lhs || rhs) ? 1 : 0; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int SubtractBoolean(bool lhs, bool rhs) => (((lhs ? 1 : 0) - (rhs ? 1 : 0)) != 0) ? 1 : 0; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int MultiplyBoolean(bool lhs, bool rhs) => (lhs && rhs) ? 1 : 0; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int ModBoolean(bool lhs, bool rhs) => (((lhs ? 1 : 0) % (rhs ? 1 : 0)) != 0) ? 1 : 0; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int DivideBoolean(bool lhs, bool rhs) => (lhs && rhs) ? 1 : 0; + [MethodImpl(Inline)] public static int AddBoolean(bool lhs, bool rhs) => (lhs || rhs) ? 1 : 0; + [MethodImpl(Inline)] public static int SubtractBoolean(bool lhs, bool rhs) => (((lhs ? 1 : 0) - (rhs ? 1 : 0)) != 0) ? 1 : 0; + [MethodImpl(Inline)] public static int MultiplyBoolean(bool lhs, bool rhs) => (lhs && rhs) ? 1 : 0; + [MethodImpl(Inline)] public static int ModBoolean(bool lhs, bool rhs) => (((lhs ? 1 : 0) % (rhs ? 1 : 0)) != 0) ? 1 : 0; + [MethodImpl(Inline)] public static int DivideBoolean(bool lhs, bool rhs) => (lhs && rhs) ? 1 : 0; #if _REGEN //We manually fixed types that naturally do not match with casting. @@ -55,7 +55,7 @@ internal class Operator %foreach ["Boolean"],["bool"]% %foreach supported_numericals,supported_numericals_lowercase,supported_numericals_defaultvals,supported_numericals_onevales% |#rettype = np.find_common_type("#101", "#201") - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static #(rettype) #2(#101 lhs, #201 rhs) => (#(rettype)) ((lhs ? #204 : #203) #1 rhs); + [MethodImpl(Inline)] public static #(rettype) #2(#101 lhs, #201 rhs) => (#(rettype)) ((lhs ? #204 : #203) #1 rhs); % % % @@ -65,1940 +65,1940 @@ internal class Operator %foreach supported_numericals,supported_numericals_lowercase,supported_numericals_defaultvals,supported_numericals_onevales% %foreach ["Boolean"],["bool"]% |#rettype = np.find_common_type("#101", "#201") - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static #(rettype) #2(#101 lhs, #201 rhs) => (#(rettype)) (lhs #1 (rhs ? #104 : #103)); + [MethodImpl(Inline)] public static #(rettype) #2(#101 lhs, #201 rhs) => (#(rettype)) (lhs #1 (rhs ? #104 : #103)); % % % #else //Add, Subtract, Mod, Multiply and Divide Booleanic Operators - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Add(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Add(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Add(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Add(bool lhs, int rhs) => (lhs ? 1 : 0) + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Add(bool lhs, uint rhs) => (lhs ? 1u : 0u) + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Add(bool lhs, long rhs) => (lhs ? 1L : 0L) + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Add(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Add(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Add(bool lhs, double rhs) => (lhs ? 1d : 0d) + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Add(bool lhs, float rhs) => (lhs ? 1f : 0f) + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Add(bool lhs, decimal rhs) => (lhs ? 1m : 0m) + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Subtract(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Subtract(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Subtract(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Subtract(bool lhs, int rhs) => (lhs ? 1 : 0) - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Subtract(bool lhs, uint rhs) => (lhs ? 1u : 0u) - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Subtract(bool lhs, long rhs) => (lhs ? 1L : 0L) - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Subtract(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Subtract(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Subtract(bool lhs, double rhs) => (lhs ? 1d : 0d) - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Subtract(bool lhs, float rhs) => (lhs ? 1f : 0f) - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Subtract(bool lhs, decimal rhs) => (lhs ? 1m : 0m) - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Mod(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Mod(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Mod(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Mod(bool lhs, int rhs) => (lhs ? 1 : 0) % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Mod(bool lhs, uint rhs) => (lhs ? 1u : 0u) % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Mod(bool lhs, long rhs) => (lhs ? 1L : 0L) % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Mod(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Mod(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Mod(bool lhs, double rhs) => (lhs ? 1d : 0d) % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Mod(bool lhs, float rhs) => (lhs ? 1f : 0f) % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Mod(bool lhs, decimal rhs) => (lhs ? 1m : 0m) % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Multiply(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Multiply(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Multiply(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Multiply(bool lhs, int rhs) => (lhs ? 1 : 0) * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Multiply(bool lhs, uint rhs) => (lhs ? 1u : 0u) * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Multiply(bool lhs, long rhs) => (lhs ? 1L : 0L) * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Multiply(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Multiply(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Multiply(bool lhs, double rhs) => (lhs ? 1d : 0d) * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Multiply(bool lhs, float rhs) => (lhs ? 1f : 0f) * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Multiply(bool lhs, decimal rhs) => (lhs ? 1m : 0m) * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Divide(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Divide(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Divide(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Divide(bool lhs, int rhs) => (lhs ? 1 : 0) / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Divide(bool lhs, uint rhs) => (lhs ? 1u : 0u) / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Divide(bool lhs, long rhs) => (lhs ? 1L : 0L) / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Divide(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Divide(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Divide(bool lhs, double rhs) => (lhs ? 1d : 0d) / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Divide(bool lhs, float rhs) => (lhs ? 1f : 0f) / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Divide(bool lhs, decimal rhs) => (lhs ? 1m : 0m) / rhs; + [MethodImpl(Inline)] public static byte Add(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) + rhs); + [MethodImpl(Inline)] public static short Add(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) + rhs); + [MethodImpl(Inline)] public static ushort Add(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) + rhs); + [MethodImpl(Inline)] public static int Add(bool lhs, int rhs) => (lhs ? 1 : 0) + rhs; + [MethodImpl(Inline)] public static uint Add(bool lhs, uint rhs) => (lhs ? 1u : 0u) + rhs; + [MethodImpl(Inline)] public static long Add(bool lhs, long rhs) => (lhs ? 1L : 0L) + rhs; + [MethodImpl(Inline)] public static ulong Add(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) + rhs; + [MethodImpl(Inline)] public static char Add(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) + rhs); + [MethodImpl(Inline)] public static double Add(bool lhs, double rhs) => (lhs ? 1d : 0d) + rhs; + [MethodImpl(Inline)] public static float Add(bool lhs, float rhs) => (lhs ? 1f : 0f) + rhs; + [MethodImpl(Inline)] public static decimal Add(bool lhs, decimal rhs) => (lhs ? 1m : 0m) + rhs; + [MethodImpl(Inline)] public static byte Subtract(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) - rhs); + [MethodImpl(Inline)] public static short Subtract(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) - rhs); + [MethodImpl(Inline)] public static ushort Subtract(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) - rhs); + [MethodImpl(Inline)] public static int Subtract(bool lhs, int rhs) => (lhs ? 1 : 0) - rhs; + [MethodImpl(Inline)] public static uint Subtract(bool lhs, uint rhs) => (lhs ? 1u : 0u) - rhs; + [MethodImpl(Inline)] public static long Subtract(bool lhs, long rhs) => (lhs ? 1L : 0L) - rhs; + [MethodImpl(Inline)] public static ulong Subtract(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) - rhs; + [MethodImpl(Inline)] public static char Subtract(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) - rhs); + [MethodImpl(Inline)] public static double Subtract(bool lhs, double rhs) => (lhs ? 1d : 0d) - rhs; + [MethodImpl(Inline)] public static float Subtract(bool lhs, float rhs) => (lhs ? 1f : 0f) - rhs; + [MethodImpl(Inline)] public static decimal Subtract(bool lhs, decimal rhs) => (lhs ? 1m : 0m) - rhs; + [MethodImpl(Inline)] public static byte Mod(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) % rhs); + [MethodImpl(Inline)] public static short Mod(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) % rhs); + [MethodImpl(Inline)] public static ushort Mod(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) % rhs); + [MethodImpl(Inline)] public static int Mod(bool lhs, int rhs) => (lhs ? 1 : 0) % rhs; + [MethodImpl(Inline)] public static uint Mod(bool lhs, uint rhs) => (lhs ? 1u : 0u) % rhs; + [MethodImpl(Inline)] public static long Mod(bool lhs, long rhs) => (lhs ? 1L : 0L) % rhs; + [MethodImpl(Inline)] public static ulong Mod(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) % rhs; + [MethodImpl(Inline)] public static char Mod(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) % rhs); + [MethodImpl(Inline)] public static double Mod(bool lhs, double rhs) => (lhs ? 1d : 0d) % rhs; + [MethodImpl(Inline)] public static float Mod(bool lhs, float rhs) => (lhs ? 1f : 0f) % rhs; + [MethodImpl(Inline)] public static decimal Mod(bool lhs, decimal rhs) => (lhs ? 1m : 0m) % rhs; + [MethodImpl(Inline)] public static byte Multiply(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) * rhs); + [MethodImpl(Inline)] public static short Multiply(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) * rhs); + [MethodImpl(Inline)] public static ushort Multiply(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) * rhs); + [MethodImpl(Inline)] public static int Multiply(bool lhs, int rhs) => (lhs ? 1 : 0) * rhs; + [MethodImpl(Inline)] public static uint Multiply(bool lhs, uint rhs) => (lhs ? 1u : 0u) * rhs; + [MethodImpl(Inline)] public static long Multiply(bool lhs, long rhs) => (lhs ? 1L : 0L) * rhs; + [MethodImpl(Inline)] public static ulong Multiply(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) * rhs; + [MethodImpl(Inline)] public static char Multiply(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) * rhs); + [MethodImpl(Inline)] public static double Multiply(bool lhs, double rhs) => (lhs ? 1d : 0d) * rhs; + [MethodImpl(Inline)] public static float Multiply(bool lhs, float rhs) => (lhs ? 1f : 0f) * rhs; + [MethodImpl(Inline)] public static decimal Multiply(bool lhs, decimal rhs) => (lhs ? 1m : 0m) * rhs; + [MethodImpl(Inline)] public static byte Divide(bool lhs, byte rhs) => (byte) ((lhs ? 1 : 0) / rhs); + [MethodImpl(Inline)] public static short Divide(bool lhs, short rhs) => (short) ((lhs ? 1 : 0) / rhs); + [MethodImpl(Inline)] public static ushort Divide(bool lhs, ushort rhs) => (ushort) ((lhs ? 1 : 0) / rhs); + [MethodImpl(Inline)] public static int Divide(bool lhs, int rhs) => (lhs ? 1 : 0) / rhs; + [MethodImpl(Inline)] public static uint Divide(bool lhs, uint rhs) => (lhs ? 1u : 0u) / rhs; + [MethodImpl(Inline)] public static long Divide(bool lhs, long rhs) => (lhs ? 1L : 0L) / rhs; + [MethodImpl(Inline)] public static ulong Divide(bool lhs, ulong rhs) => (lhs ? 1UL : 0UL) / rhs; + [MethodImpl(Inline)] public static char Divide(bool lhs, char rhs) => (char) ((lhs ? 1 : 0) / rhs); + [MethodImpl(Inline)] public static double Divide(bool lhs, double rhs) => (lhs ? 1d : 0d) / rhs; + [MethodImpl(Inline)] public static float Divide(bool lhs, float rhs) => (lhs ? 1f : 0f) / rhs; + [MethodImpl(Inline)] public static decimal Divide(bool lhs, decimal rhs) => (lhs ? 1m : 0m) / rhs; //bool is rhs - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Add(byte lhs, bool rhs) => (byte) (lhs + (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Add(short lhs, bool rhs) => (short) (lhs + (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Add(ushort lhs, bool rhs) => (ushort) (lhs + (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Add(int lhs, bool rhs) => lhs + (rhs ? 1 : 0); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Add(uint lhs, bool rhs) => lhs + (rhs ? 1u : 0u); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Add(long lhs, bool rhs) => lhs + (rhs ? 1L : 0L); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Add(ulong lhs, bool rhs) => lhs + (rhs ? 1UL : 0UL); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Add(char lhs, bool rhs) => (char) (lhs + (rhs ? 1 : '\0')); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Add(double lhs, bool rhs) => lhs + (rhs ? 1d : 0d); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Add(float lhs, bool rhs) => lhs + (rhs ? 1f : 0f); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Add(decimal lhs, bool rhs) => lhs + (rhs ? 1m : 0m); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Subtract(byte lhs, bool rhs) => (byte) (lhs - (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Subtract(short lhs, bool rhs) => (short) (lhs - (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Subtract(ushort lhs, bool rhs) => (ushort) (lhs - (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Subtract(int lhs, bool rhs) => lhs - (rhs ? 1 : 0); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Subtract(uint lhs, bool rhs) => lhs - (rhs ? 1u : 0u); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Subtract(long lhs, bool rhs) => lhs - (rhs ? 1L : 0L); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Subtract(ulong lhs, bool rhs) => lhs - (rhs ? 1UL : 0UL); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Subtract(char lhs, bool rhs) => (char) (lhs - (rhs ? 1 : '\0')); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Subtract(double lhs, bool rhs) => lhs - (rhs ? 1d : 0d); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Subtract(float lhs, bool rhs) => lhs - (rhs ? 1f : 0f); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Subtract(decimal lhs, bool rhs) => lhs - (rhs ? 1m : 0m); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Mod(byte lhs, bool rhs) => (byte) (lhs % (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Mod(short lhs, bool rhs) => (short) (lhs % (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Mod(ushort lhs, bool rhs) => (ushort) (lhs % (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Mod(int lhs, bool rhs) => lhs % (rhs ? 1 : 0); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Mod(uint lhs, bool rhs) => lhs % (rhs ? 1u : 0u); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Mod(long lhs, bool rhs) => lhs % (rhs ? 1L : 0L); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Mod(ulong lhs, bool rhs) => lhs % (rhs ? 1UL : 0UL); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Mod(char lhs, bool rhs) => (char) (lhs % (rhs ? 1 : '\0')); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Mod(double lhs, bool rhs) => lhs % (rhs ? 1d : 0d); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Mod(float lhs, bool rhs) => lhs % (rhs ? 1f : 0f); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Mod(decimal lhs, bool rhs) => lhs % (rhs ? 1m : 0m); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Multiply(byte lhs, bool rhs) => (byte) (lhs * (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Multiply(short lhs, bool rhs) => (short) (lhs * (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Multiply(ushort lhs, bool rhs) => (ushort) (lhs * (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Multiply(int lhs, bool rhs) => lhs * (rhs ? 1 : 0); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Multiply(uint lhs, bool rhs) => lhs * (rhs ? 1u : 0u); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Multiply(long lhs, bool rhs) => lhs * (rhs ? 1L : 0L); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Multiply(ulong lhs, bool rhs) => lhs * (rhs ? 1UL : 0UL); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Multiply(char lhs, bool rhs) => (char) (lhs * (rhs ? 1 : '\0')); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Multiply(double lhs, bool rhs) => lhs * (rhs ? 1d : 0d); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Multiply(float lhs, bool rhs) => lhs * (rhs ? 1f : 0f); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Multiply(decimal lhs, bool rhs) => lhs * (rhs ? 1m : 0m); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Divide(byte lhs, bool rhs) => (byte) (lhs / (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Divide(short lhs, bool rhs) => (short) (lhs / (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ushort Divide(ushort lhs, bool rhs) => (ushort) (lhs / (rhs ? 1 : 0)); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Divide(int lhs, bool rhs) => lhs / (rhs ? 1 : 0); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint Divide(uint lhs, bool rhs) => lhs / (rhs ? 1u : 0u); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Divide(long lhs, bool rhs) => lhs / (rhs ? 1L : 0L); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong Divide(ulong lhs, bool rhs) => lhs / (rhs ? 1UL : 0UL); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static char Divide(char lhs, bool rhs) => (char) (lhs / (rhs ? 1 : '\0')); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Divide(double lhs, bool rhs) => lhs / (rhs ? 1d : 0d); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Divide(float lhs, bool rhs) => lhs / (rhs ? 1f : 0f); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Divide(decimal lhs, bool rhs) => lhs / (rhs ? 1m : 0m); + [MethodImpl(Inline)] public static byte Add(byte lhs, bool rhs) => (byte) (lhs + (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static short Add(short lhs, bool rhs) => (short) (lhs + (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static ushort Add(ushort lhs, bool rhs) => (ushort) (lhs + (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static int Add(int lhs, bool rhs) => lhs + (rhs ? 1 : 0); + [MethodImpl(Inline)] public static uint Add(uint lhs, bool rhs) => lhs + (rhs ? 1u : 0u); + [MethodImpl(Inline)] public static long Add(long lhs, bool rhs) => lhs + (rhs ? 1L : 0L); + [MethodImpl(Inline)] public static ulong Add(ulong lhs, bool rhs) => lhs + (rhs ? 1UL : 0UL); + [MethodImpl(Inline)] public static char Add(char lhs, bool rhs) => (char) (lhs + (rhs ? 1 : '\0')); + [MethodImpl(Inline)] public static double Add(double lhs, bool rhs) => lhs + (rhs ? 1d : 0d); + [MethodImpl(Inline)] public static float Add(float lhs, bool rhs) => lhs + (rhs ? 1f : 0f); + [MethodImpl(Inline)] public static decimal Add(decimal lhs, bool rhs) => lhs + (rhs ? 1m : 0m); + [MethodImpl(Inline)] public static byte Subtract(byte lhs, bool rhs) => (byte) (lhs - (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static short Subtract(short lhs, bool rhs) => (short) (lhs - (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static ushort Subtract(ushort lhs, bool rhs) => (ushort) (lhs - (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static int Subtract(int lhs, bool rhs) => lhs - (rhs ? 1 : 0); + [MethodImpl(Inline)] public static uint Subtract(uint lhs, bool rhs) => lhs - (rhs ? 1u : 0u); + [MethodImpl(Inline)] public static long Subtract(long lhs, bool rhs) => lhs - (rhs ? 1L : 0L); + [MethodImpl(Inline)] public static ulong Subtract(ulong lhs, bool rhs) => lhs - (rhs ? 1UL : 0UL); + [MethodImpl(Inline)] public static char Subtract(char lhs, bool rhs) => (char) (lhs - (rhs ? 1 : '\0')); + [MethodImpl(Inline)] public static double Subtract(double lhs, bool rhs) => lhs - (rhs ? 1d : 0d); + [MethodImpl(Inline)] public static float Subtract(float lhs, bool rhs) => lhs - (rhs ? 1f : 0f); + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, bool rhs) => lhs - (rhs ? 1m : 0m); + [MethodImpl(Inline)] public static byte Mod(byte lhs, bool rhs) => (byte) (lhs % (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static short Mod(short lhs, bool rhs) => (short) (lhs % (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static ushort Mod(ushort lhs, bool rhs) => (ushort) (lhs % (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static int Mod(int lhs, bool rhs) => lhs % (rhs ? 1 : 0); + [MethodImpl(Inline)] public static uint Mod(uint lhs, bool rhs) => lhs % (rhs ? 1u : 0u); + [MethodImpl(Inline)] public static long Mod(long lhs, bool rhs) => lhs % (rhs ? 1L : 0L); + [MethodImpl(Inline)] public static ulong Mod(ulong lhs, bool rhs) => lhs % (rhs ? 1UL : 0UL); + [MethodImpl(Inline)] public static char Mod(char lhs, bool rhs) => (char) (lhs % (rhs ? 1 : '\0')); + [MethodImpl(Inline)] public static double Mod(double lhs, bool rhs) => lhs % (rhs ? 1d : 0d); + [MethodImpl(Inline)] public static float Mod(float lhs, bool rhs) => lhs % (rhs ? 1f : 0f); + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, bool rhs) => lhs % (rhs ? 1m : 0m); + [MethodImpl(Inline)] public static byte Multiply(byte lhs, bool rhs) => (byte) (lhs * (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static short Multiply(short lhs, bool rhs) => (short) (lhs * (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static ushort Multiply(ushort lhs, bool rhs) => (ushort) (lhs * (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static int Multiply(int lhs, bool rhs) => lhs * (rhs ? 1 : 0); + [MethodImpl(Inline)] public static uint Multiply(uint lhs, bool rhs) => lhs * (rhs ? 1u : 0u); + [MethodImpl(Inline)] public static long Multiply(long lhs, bool rhs) => lhs * (rhs ? 1L : 0L); + [MethodImpl(Inline)] public static ulong Multiply(ulong lhs, bool rhs) => lhs * (rhs ? 1UL : 0UL); + [MethodImpl(Inline)] public static char Multiply(char lhs, bool rhs) => (char) (lhs * (rhs ? 1 : '\0')); + [MethodImpl(Inline)] public static double Multiply(double lhs, bool rhs) => lhs * (rhs ? 1d : 0d); + [MethodImpl(Inline)] public static float Multiply(float lhs, bool rhs) => lhs * (rhs ? 1f : 0f); + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, bool rhs) => lhs * (rhs ? 1m : 0m); + [MethodImpl(Inline)] public static byte Divide(byte lhs, bool rhs) => (byte) (lhs / (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static short Divide(short lhs, bool rhs) => (short) (lhs / (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static ushort Divide(ushort lhs, bool rhs) => (ushort) (lhs / (rhs ? 1 : 0)); + [MethodImpl(Inline)] public static int Divide(int lhs, bool rhs) => lhs / (rhs ? 1 : 0); + [MethodImpl(Inline)] public static uint Divide(uint lhs, bool rhs) => lhs / (rhs ? 1u : 0u); + [MethodImpl(Inline)] public static long Divide(long lhs, bool rhs) => lhs / (rhs ? 1L : 0L); + [MethodImpl(Inline)] public static ulong Divide(ulong lhs, bool rhs) => lhs / (rhs ? 1UL : 0UL); + [MethodImpl(Inline)] public static char Divide(char lhs, bool rhs) => (char) (lhs / (rhs ? 1 : '\0')); + [MethodImpl(Inline)] public static double Divide(double lhs, bool rhs) => lhs / (rhs ? 1d : 0d); + [MethodImpl(Inline)] public static float Divide(float lhs, bool rhs) => lhs / (rhs ? 1f : 0f); + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, bool rhs) => lhs / (rhs ? 1m : 0m); #endif - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Add(byte lhs, byte rhs) => (byte)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Add(byte lhs, short rhs) => (short)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Add(byte lhs, ushort rhs) => (ushort)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(byte lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Add(byte lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(byte lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(byte lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Add(byte lhs, char rhs) => (byte)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(byte lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(byte lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(byte lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Add(short lhs, byte rhs) => (short)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Add(short lhs, short rhs) => (short)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(short lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(short lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(short lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(short lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(short lhs, ulong rhs) => lhs + (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Add(short lhs, char rhs) => (short)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(short lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(short lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(short lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Add(ushort lhs, byte rhs) => (ushort)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(ushort lhs, short rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Add(ushort lhs, ushort rhs) => (ushort)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(ushort lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Add(ushort lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(ushort lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(ushort lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Add(ushort lhs, char rhs) => (ushort)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(ushort lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(ushort lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(ushort lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(int lhs, byte rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(int lhs, short rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(int lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(int lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(int lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(int lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(int lhs, ulong rhs) => lhs + (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(int lhs, char rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(int lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(int lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(int lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Add(uint lhs, byte rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(uint lhs, short rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Add(uint lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(uint lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Add(uint lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(uint lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(uint lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Add(uint lhs, char rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(uint lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(uint lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(uint lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(long lhs, byte rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(long lhs, short rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(long lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(long lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(long lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(long lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(long lhs, ulong rhs) => lhs + (long)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(long lhs, char rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(long lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(long lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(long lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(ulong lhs, byte rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(ulong lhs, short rhs) => lhs + (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(ulong lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(ulong lhs, int rhs) => lhs + (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(ulong lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(ulong lhs, long rhs) => lhs + (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(ulong lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(ulong lhs, char rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(ulong lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(ulong lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(ulong lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Add(char lhs, byte rhs) => (byte)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Add(char lhs, short rhs) => (short)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Add(char lhs, ushort rhs) => (ushort)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Add(char lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Add(char lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Add(char lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Add(char lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static char Add(char lhs, char rhs) => (char)(lhs + rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(char lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(char lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(char lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, byte rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, short rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, char rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(double lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(double lhs, decimal rhs) => (decimal)lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(float lhs, byte rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(float lhs, short rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(float lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(float lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(float lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(float lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(float lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(float lhs, char rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Add(float lhs, double rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Add(float lhs, float rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(float lhs, decimal rhs) => (decimal)lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, byte rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, short rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, ushort rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, int rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, uint rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, long rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, ulong rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, char rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, double rhs) => lhs + (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, float rhs) => lhs + (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Add(decimal lhs, decimal rhs) => lhs + rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Subtract(byte lhs, byte rhs) => (byte)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Subtract(byte lhs, short rhs) => (short)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Subtract(byte lhs, ushort rhs) => (ushort)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(byte lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Subtract(byte lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(byte lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(byte lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Subtract(byte lhs, char rhs) => (byte)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(byte lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(byte lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(byte lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Subtract(short lhs, byte rhs) => (short)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Subtract(short lhs, short rhs) => (short)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(short lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(short lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(short lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(short lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(short lhs, ulong rhs) => lhs - (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Subtract(short lhs, char rhs) => (short)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(short lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(short lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(short lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Subtract(ushort lhs, byte rhs) => (ushort)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(ushort lhs, short rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Subtract(ushort lhs, ushort rhs) => (ushort)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(ushort lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Subtract(ushort lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(ushort lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(ushort lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Subtract(ushort lhs, char rhs) => (ushort)(lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(ushort lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(ushort lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(ushort lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(int lhs, byte rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(int lhs, short rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(int lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(int lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(int lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(int lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(int lhs, ulong rhs) => lhs - (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(int lhs, char rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(int lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(int lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(int lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Subtract(uint lhs, byte rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(uint lhs, short rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Subtract(uint lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(uint lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Subtract(uint lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(uint lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(uint lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Subtract(uint lhs, char rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(uint lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(uint lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(uint lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(long lhs, byte rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(long lhs, short rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(long lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(long lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(long lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(long lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(long lhs, ulong rhs) => lhs - (long)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(long lhs, char rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(long lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(long lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(long lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(ulong lhs, byte rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(ulong lhs, short rhs) => lhs - (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(ulong lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(ulong lhs, int rhs) => lhs - (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(ulong lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(ulong lhs, long rhs) => lhs - (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(ulong lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(ulong lhs, char rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(ulong lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(ulong lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(ulong lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Subtract(char lhs, byte rhs) => (byte) (lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Subtract(char lhs, short rhs) => (short) (lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Subtract(char lhs, ushort rhs) => (ushort) (lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Subtract(char lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Subtract(char lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Subtract(char lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Subtract(char lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static char Subtract(char lhs, char rhs) => (char) (lhs - rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(char lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(char lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(char lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, byte rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, short rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, char rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(double lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(double lhs, decimal rhs) => (decimal)lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(float lhs, byte rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(float lhs, short rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(float lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(float lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(float lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(float lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(float lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(float lhs, char rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Subtract(float lhs, double rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Subtract(float lhs, float rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(float lhs, decimal rhs) => (decimal)lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, byte rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, short rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, ushort rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, int rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, uint rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, long rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, ulong rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, char rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, double rhs) => lhs - (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, float rhs) => lhs - (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Subtract(decimal lhs, decimal rhs) => lhs - rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Mod(byte lhs, byte rhs) => (byte)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Mod(byte lhs, short rhs) => (short)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Mod(byte lhs, ushort rhs) => (ushort)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(byte lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Mod(byte lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(byte lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(byte lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Mod(byte lhs, char rhs) => (byte)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(byte lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(byte lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(byte lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Mod(short lhs, byte rhs) => (short)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Mod(short lhs, short rhs) => (short)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(short lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(short lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(short lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(short lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(short lhs, ulong rhs) => lhs % (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Mod(short lhs, char rhs) => (short)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(short lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(short lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(short lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Mod(ushort lhs, byte rhs) => (ushort)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(ushort lhs, short rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Mod(ushort lhs, ushort rhs) => (ushort)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(ushort lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Mod(ushort lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(ushort lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(ushort lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Mod(ushort lhs, char rhs) => (ushort)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(ushort lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(ushort lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(ushort lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(int lhs, byte rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(int lhs, short rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(int lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(int lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(int lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(int lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(int lhs, ulong rhs) => lhs % (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(int lhs, char rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(int lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(int lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(int lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Mod(uint lhs, byte rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(uint lhs, short rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Mod(uint lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(uint lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Mod(uint lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(uint lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(uint lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Mod(uint lhs, char rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(uint lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(uint lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(uint lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(long lhs, byte rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(long lhs, short rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(long lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(long lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(long lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(long lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(long lhs, ulong rhs) => lhs % (long)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(long lhs, char rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(long lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(long lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(long lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(ulong lhs, byte rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(ulong lhs, short rhs) => lhs % (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(ulong lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(ulong lhs, int rhs) => lhs % (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(ulong lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(ulong lhs, long rhs) => lhs % (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(ulong lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(ulong lhs, char rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(ulong lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(ulong lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(ulong lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Mod(char lhs, byte rhs) => (byte)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Mod(char lhs, short rhs) => (short)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Mod(char lhs, ushort rhs) => (ushort)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Mod(char lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Mod(char lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Mod(char lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Mod(char lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static char Mod(char lhs, char rhs) => (char)(lhs % rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(char lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(char lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(char lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, byte rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, short rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, char rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(double lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(double lhs, decimal rhs) => (decimal)lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(float lhs, byte rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(float lhs, short rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(float lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(float lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(float lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(float lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(float lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(float lhs, char rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Mod(float lhs, double rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Mod(float lhs, float rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(float lhs, decimal rhs) => (decimal)lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, byte rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, short rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, ushort rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, int rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, uint rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, long rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, ulong rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, char rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, double rhs) => lhs % (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, float rhs) => lhs % (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Mod(decimal lhs, decimal rhs) => lhs % rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Multiply(byte lhs, byte rhs) => (byte)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Multiply(byte lhs, short rhs) => (short)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Multiply(byte lhs, ushort rhs) => (ushort) (lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(byte lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Multiply(byte lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(byte lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(byte lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Multiply(byte lhs, char rhs) => (byte)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(byte lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(byte lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(byte lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Multiply(short lhs, byte rhs) => (short)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Multiply(short lhs, short rhs) => (short)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(short lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(short lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(short lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(short lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(short lhs, ulong rhs) => lhs * (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Multiply(short lhs, char rhs) => (short)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(short lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(short lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(short lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Multiply(ushort lhs, byte rhs) => (ushort)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(ushort lhs, short rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Multiply(ushort lhs, ushort rhs) => (ushort)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(ushort lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Multiply(ushort lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(ushort lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(ushort lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Multiply(ushort lhs, char rhs) => (ushort)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(ushort lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(ushort lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(ushort lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(int lhs, byte rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(int lhs, short rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(int lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(int lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(int lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(int lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(int lhs, ulong rhs) => lhs * (int)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(int lhs, char rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(int lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(int lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(int lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Multiply(uint lhs, byte rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(uint lhs, short rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Multiply(uint lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(uint lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Multiply(uint lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(uint lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(uint lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Multiply(uint lhs, char rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(uint lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(uint lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(uint lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(long lhs, byte rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(long lhs, short rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(long lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(long lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(long lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(long lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(long lhs, ulong rhs) => lhs * (long)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(long lhs, char rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(long lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(long lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(long lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(ulong lhs, byte rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(ulong lhs, short rhs) => lhs * (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(ulong lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(ulong lhs, int rhs) => lhs * (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(ulong lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(ulong lhs, long rhs) => lhs * (ulong)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(ulong lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(ulong lhs, char rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(ulong lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(ulong lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(ulong lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Multiply(char lhs, byte rhs) => (byte)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Multiply(char lhs, short rhs) => (short)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Multiply(char lhs, ushort rhs) => (ushort)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Multiply(char lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Multiply(char lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Multiply(char lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Multiply(char lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static char Multiply(char lhs, char rhs) => (char)(lhs * rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(char lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(char lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(char lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, byte rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, short rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, char rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(double lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(double lhs, decimal rhs) => (decimal)lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(float lhs, byte rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(float lhs, short rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(float lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(float lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(float lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(float lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(float lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(float lhs, char rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Multiply(float lhs, double rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Multiply(float lhs, float rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(float lhs, decimal rhs) => (decimal)lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, byte rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, short rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, ushort rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, int rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, uint rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, long rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, ulong rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, char rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, double rhs) => lhs * (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, float rhs) => lhs * (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Multiply(decimal lhs, decimal rhs) => lhs * rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Divide(byte lhs, byte rhs) => (byte)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Divide(byte lhs, short rhs) => (short)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Divide(byte lhs, ushort rhs) => (ushort)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(byte lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Divide(byte lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(byte lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(byte lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Divide(byte lhs, char rhs) => (byte)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(byte lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(byte lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(byte lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Divide(short lhs, byte rhs) => (short)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Divide(short lhs, short rhs) => (short)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(short lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(short lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(short lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(short lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(short lhs, ulong rhs) => (double)lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Divide(short lhs, char rhs) => (short)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(short lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(short lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(short lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Divide(ushort lhs, byte rhs) => (ushort)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(ushort lhs, short rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Divide(ushort lhs, ushort rhs) => (ushort)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(ushort lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Divide(ushort lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(ushort lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(ushort lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Divide(ushort lhs, char rhs) => (ushort)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(ushort lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(ushort lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(ushort lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(int lhs, byte rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(int lhs, short rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(int lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(int lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(int lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(int lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(int lhs, ulong rhs) => lhs / (double)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(int lhs, char rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(int lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(int lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(int lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Divide(uint lhs, byte rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(uint lhs, short rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Divide(uint lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(uint lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Divide(uint lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(uint lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(uint lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Divide(uint lhs, char rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(uint lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(uint lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(uint lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(long lhs, byte rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(long lhs, short rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(long lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(long lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(long lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(long lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(long lhs, ulong rhs) => lhs / (double)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(long lhs, char rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(long lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(long lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(long lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(ulong lhs, byte rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(ulong lhs, short rhs) => lhs / (double)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(ulong lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(ulong lhs, int rhs) => lhs / (double)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(ulong lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(ulong lhs, long rhs) => lhs / (double)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(ulong lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(ulong lhs, char rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(ulong lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(ulong lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(ulong lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static byte Divide(char lhs, byte rhs) => (byte)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static short Divide(char lhs, short rhs) => (short)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ushort Divide(char lhs, ushort rhs) => (ushort)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static int Divide(char lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static uint Divide(char lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static long Divide(char lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static ulong Divide(char lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static char Divide(char lhs, char rhs) => (char)(lhs / rhs); - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(char lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(char lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(char lhs, decimal rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, byte rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, short rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, char rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(double lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(double lhs, decimal rhs) => (decimal)lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(float lhs, byte rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(float lhs, short rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(float lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(float lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(float lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(float lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(float lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(float lhs, char rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static double Divide(float lhs, double rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static float Divide(float lhs, float rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(float lhs, decimal rhs) => (decimal)lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, byte rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, short rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, ushort rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, int rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, uint rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, long rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, ulong rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, char rhs) => lhs / rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, double rhs) => lhs / (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, float rhs) => lhs / (decimal)rhs; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static decimal Divide(decimal lhs, decimal rhs) => lhs / rhs; } } diff --git a/src/NumSharp.Core/Utilities/MethodImplOptionsConstants.cs b/src/NumSharp.Core/Utilities/MethodImplOptionsConstants.cs new file mode 100644 index 00000000..c7abf169 --- /dev/null +++ b/src/NumSharp.Core/Utilities/MethodImplOptionsConstants.cs @@ -0,0 +1,36 @@ +using System.Runtime.CompilerServices; + +namespace NumSharp; + +/// +/// Method implementation option constants for use with . +/// +/// +/// Exposed globally via global using static — use directly without class prefix. +/// +/// +/// +/// [MethodImpl(OptimizeAndInline)] +/// public void HotPath() { } +/// +/// +public static class MethodImplOptionsConstants +{ + /// + /// Aggressive inlining + aggressive optimization (768). + /// Use for hot paths where both inlining and JIT optimization are critical. + /// + public const MethodImplOptions OptimizeAndInline = MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization; + + /// + /// Aggressive optimization only (512). + /// Use for methods too large to inline but still performance-critical. + /// + public const MethodImplOptions Optimize = MethodImplOptions.AggressiveOptimization; + + /// + /// Aggressive inlining only (256). + /// Use for small methods where inlining is beneficial. + /// + public const MethodImplOptions Inline = MethodImplOptions.AggressiveInlining; +} diff --git a/src/NumSharp.Core/Utilities/NonGenericConvert.cs b/src/NumSharp.Core/Utilities/NonGenericConvert.cs index 54692bfe..b899e3f8 100644 --- a/src/NumSharp.Core/Utilities/NonGenericConvert.cs +++ b/src/NumSharp.Core/Utilities/NonGenericConvert.cs @@ -15,7 +15,7 @@ public static class NonGenericConvert /// /// The object that will be casted to and then converted to /// #2 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static #2 From#1To#2(object input) { return Converts.To#2((#1)input); @@ -29,7 +29,7 @@ public static class NonGenericConvert /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromBooleanToByte(object input) { return Converts.ToByte((Boolean)input); @@ -40,7 +40,7 @@ public static Byte FromBooleanToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromBooleanToInt16(object input) { return Converts.ToInt16((Boolean)input); @@ -51,7 +51,7 @@ public static Int16 FromBooleanToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromBooleanToUInt16(object input) { return Converts.ToUInt16((Boolean)input); @@ -62,7 +62,7 @@ public static UInt16 FromBooleanToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromBooleanToInt32(object input) { return Converts.ToInt32((Boolean)input); @@ -73,7 +73,7 @@ public static Int32 FromBooleanToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromBooleanToUInt32(object input) { return Converts.ToUInt32((Boolean)input); @@ -84,7 +84,7 @@ public static UInt32 FromBooleanToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromBooleanToInt64(object input) { return Converts.ToInt64((Boolean)input); @@ -95,7 +95,7 @@ public static Int64 FromBooleanToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromBooleanToUInt64(object input) { return Converts.ToUInt64((Boolean)input); @@ -106,7 +106,7 @@ public static UInt64 FromBooleanToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromBooleanToChar(object input) { return Converts.ToChar((Boolean)input); @@ -117,7 +117,7 @@ public static Char FromBooleanToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromBooleanToDouble(object input) { return Converts.ToDouble((Boolean)input); @@ -128,7 +128,7 @@ public static Double FromBooleanToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromBooleanToSingle(object input) { return Converts.ToSingle((Boolean)input); @@ -139,7 +139,7 @@ public static Single FromBooleanToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromBooleanToDecimal(object input) { return Converts.ToDecimal((Boolean)input); @@ -150,7 +150,7 @@ public static Decimal FromBooleanToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromBooleanToString(object input) { return Converts.ToString((Boolean)input); @@ -161,7 +161,7 @@ public static String FromBooleanToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromByteToBoolean(object input) { return Converts.ToBoolean((Byte)input); @@ -172,7 +172,7 @@ public static Boolean FromByteToBoolean(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromByteToInt16(object input) { return Converts.ToInt16((Byte)input); @@ -183,7 +183,7 @@ public static Int16 FromByteToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromByteToUInt16(object input) { return Converts.ToUInt16((Byte)input); @@ -194,7 +194,7 @@ public static UInt16 FromByteToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromByteToInt32(object input) { return Converts.ToInt32((Byte)input); @@ -205,7 +205,7 @@ public static Int32 FromByteToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromByteToUInt32(object input) { return Converts.ToUInt32((Byte)input); @@ -216,7 +216,7 @@ public static UInt32 FromByteToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromByteToInt64(object input) { return Converts.ToInt64((Byte)input); @@ -227,7 +227,7 @@ public static Int64 FromByteToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromByteToUInt64(object input) { return Converts.ToUInt64((Byte)input); @@ -238,7 +238,7 @@ public static UInt64 FromByteToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromByteToChar(object input) { return Converts.ToChar((Byte)input); @@ -249,7 +249,7 @@ public static Char FromByteToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromByteToDouble(object input) { return Converts.ToDouble((Byte)input); @@ -260,7 +260,7 @@ public static Double FromByteToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromByteToSingle(object input) { return Converts.ToSingle((Byte)input); @@ -271,7 +271,7 @@ public static Single FromByteToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromByteToDecimal(object input) { return Converts.ToDecimal((Byte)input); @@ -282,7 +282,7 @@ public static Decimal FromByteToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromByteToString(object input) { return Converts.ToString((Byte)input); @@ -293,7 +293,7 @@ public static String FromByteToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromInt16ToBoolean(object input) { return Converts.ToBoolean((Int16)input); @@ -304,7 +304,7 @@ public static Boolean FromInt16ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromInt16ToByte(object input) { return Converts.ToByte((Int16)input); @@ -315,7 +315,7 @@ public static Byte FromInt16ToByte(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromInt16ToUInt16(object input) { return Converts.ToUInt16((Int16)input); @@ -326,7 +326,7 @@ public static UInt16 FromInt16ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromInt16ToInt32(object input) { return Converts.ToInt32((Int16)input); @@ -337,7 +337,7 @@ public static Int32 FromInt16ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromInt16ToUInt32(object input) { return Converts.ToUInt32((Int16)input); @@ -348,7 +348,7 @@ public static UInt32 FromInt16ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromInt16ToInt64(object input) { return Converts.ToInt64((Int16)input); @@ -359,7 +359,7 @@ public static Int64 FromInt16ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromInt16ToUInt64(object input) { return Converts.ToUInt64((Int16)input); @@ -370,7 +370,7 @@ public static UInt64 FromInt16ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromInt16ToChar(object input) { return Converts.ToChar((Int16)input); @@ -381,7 +381,7 @@ public static Char FromInt16ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromInt16ToDouble(object input) { return Converts.ToDouble((Int16)input); @@ -392,7 +392,7 @@ public static Double FromInt16ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromInt16ToSingle(object input) { return Converts.ToSingle((Int16)input); @@ -403,7 +403,7 @@ public static Single FromInt16ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromInt16ToDecimal(object input) { return Converts.ToDecimal((Int16)input); @@ -414,7 +414,7 @@ public static Decimal FromInt16ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromInt16ToString(object input) { return Converts.ToString((Int16)input); @@ -425,7 +425,7 @@ public static String FromInt16ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromUInt16ToBoolean(object input) { return Converts.ToBoolean((UInt16)input); @@ -436,7 +436,7 @@ public static Boolean FromUInt16ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromUInt16ToByte(object input) { return Converts.ToByte((UInt16)input); @@ -447,7 +447,7 @@ public static Byte FromUInt16ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromUInt16ToInt16(object input) { return Converts.ToInt16((UInt16)input); @@ -458,7 +458,7 @@ public static Int16 FromUInt16ToInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromUInt16ToInt32(object input) { return Converts.ToInt32((UInt16)input); @@ -469,7 +469,7 @@ public static Int32 FromUInt16ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromUInt16ToUInt32(object input) { return Converts.ToUInt32((UInt16)input); @@ -480,7 +480,7 @@ public static UInt32 FromUInt16ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromUInt16ToInt64(object input) { return Converts.ToInt64((UInt16)input); @@ -491,7 +491,7 @@ public static Int64 FromUInt16ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromUInt16ToUInt64(object input) { return Converts.ToUInt64((UInt16)input); @@ -502,7 +502,7 @@ public static UInt64 FromUInt16ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromUInt16ToChar(object input) { return Converts.ToChar((UInt16)input); @@ -513,7 +513,7 @@ public static Char FromUInt16ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromUInt16ToDouble(object input) { return Converts.ToDouble((UInt16)input); @@ -524,7 +524,7 @@ public static Double FromUInt16ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromUInt16ToSingle(object input) { return Converts.ToSingle((UInt16)input); @@ -535,7 +535,7 @@ public static Single FromUInt16ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromUInt16ToDecimal(object input) { return Converts.ToDecimal((UInt16)input); @@ -546,7 +546,7 @@ public static Decimal FromUInt16ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromUInt16ToString(object input) { return Converts.ToString((UInt16)input); @@ -557,7 +557,7 @@ public static String FromUInt16ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromInt32ToBoolean(object input) { return Converts.ToBoolean((Int32)input); @@ -568,7 +568,7 @@ public static Boolean FromInt32ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromInt32ToByte(object input) { return Converts.ToByte((Int32)input); @@ -579,7 +579,7 @@ public static Byte FromInt32ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromInt32ToInt16(object input) { return Converts.ToInt16((Int32)input); @@ -590,7 +590,7 @@ public static Int16 FromInt32ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromInt32ToUInt16(object input) { return Converts.ToUInt16((Int32)input); @@ -601,7 +601,7 @@ public static UInt16 FromInt32ToUInt16(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromInt32ToUInt32(object input) { return Converts.ToUInt32((Int32)input); @@ -612,7 +612,7 @@ public static UInt32 FromInt32ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromInt32ToInt64(object input) { return Converts.ToInt64((Int32)input); @@ -623,7 +623,7 @@ public static Int64 FromInt32ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromInt32ToUInt64(object input) { return Converts.ToUInt64((Int32)input); @@ -634,7 +634,7 @@ public static UInt64 FromInt32ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromInt32ToChar(object input) { return Converts.ToChar((Int32)input); @@ -645,7 +645,7 @@ public static Char FromInt32ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromInt32ToDouble(object input) { return Converts.ToDouble((Int32)input); @@ -656,7 +656,7 @@ public static Double FromInt32ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromInt32ToSingle(object input) { return Converts.ToSingle((Int32)input); @@ -667,7 +667,7 @@ public static Single FromInt32ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromInt32ToDecimal(object input) { return Converts.ToDecimal((Int32)input); @@ -678,7 +678,7 @@ public static Decimal FromInt32ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromInt32ToString(object input) { return Converts.ToString((Int32)input); @@ -689,7 +689,7 @@ public static String FromInt32ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromUInt32ToBoolean(object input) { return Converts.ToBoolean((UInt32)input); @@ -700,7 +700,7 @@ public static Boolean FromUInt32ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromUInt32ToByte(object input) { return Converts.ToByte((UInt32)input); @@ -711,7 +711,7 @@ public static Byte FromUInt32ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromUInt32ToInt16(object input) { return Converts.ToInt16((UInt32)input); @@ -722,7 +722,7 @@ public static Int16 FromUInt32ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromUInt32ToUInt16(object input) { return Converts.ToUInt16((UInt32)input); @@ -733,7 +733,7 @@ public static UInt16 FromUInt32ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromUInt32ToInt32(object input) { return Converts.ToInt32((UInt32)input); @@ -744,7 +744,7 @@ public static Int32 FromUInt32ToInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromUInt32ToInt64(object input) { return Converts.ToInt64((UInt32)input); @@ -755,7 +755,7 @@ public static Int64 FromUInt32ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromUInt32ToUInt64(object input) { return Converts.ToUInt64((UInt32)input); @@ -766,7 +766,7 @@ public static UInt64 FromUInt32ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromUInt32ToChar(object input) { return Converts.ToChar((UInt32)input); @@ -777,7 +777,7 @@ public static Char FromUInt32ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromUInt32ToDouble(object input) { return Converts.ToDouble((UInt32)input); @@ -788,7 +788,7 @@ public static Double FromUInt32ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromUInt32ToSingle(object input) { return Converts.ToSingle((UInt32)input); @@ -799,7 +799,7 @@ public static Single FromUInt32ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromUInt32ToDecimal(object input) { return Converts.ToDecimal((UInt32)input); @@ -810,7 +810,7 @@ public static Decimal FromUInt32ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromUInt32ToString(object input) { return Converts.ToString((UInt32)input); @@ -821,7 +821,7 @@ public static String FromUInt32ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromInt64ToBoolean(object input) { return Converts.ToBoolean((Int64)input); @@ -832,7 +832,7 @@ public static Boolean FromInt64ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromInt64ToByte(object input) { return Converts.ToByte((Int64)input); @@ -843,7 +843,7 @@ public static Byte FromInt64ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromInt64ToInt16(object input) { return Converts.ToInt16((Int64)input); @@ -854,7 +854,7 @@ public static Int16 FromInt64ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromInt64ToUInt16(object input) { return Converts.ToUInt16((Int64)input); @@ -865,7 +865,7 @@ public static UInt16 FromInt64ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromInt64ToInt32(object input) { return Converts.ToInt32((Int64)input); @@ -876,7 +876,7 @@ public static Int32 FromInt64ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromInt64ToUInt32(object input) { return Converts.ToUInt32((Int64)input); @@ -887,7 +887,7 @@ public static UInt32 FromInt64ToUInt32(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromInt64ToUInt64(object input) { return Converts.ToUInt64((Int64)input); @@ -898,7 +898,7 @@ public static UInt64 FromInt64ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromInt64ToChar(object input) { return Converts.ToChar((Int64)input); @@ -909,7 +909,7 @@ public static Char FromInt64ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromInt64ToDouble(object input) { return Converts.ToDouble((Int64)input); @@ -920,7 +920,7 @@ public static Double FromInt64ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromInt64ToSingle(object input) { return Converts.ToSingle((Int64)input); @@ -931,7 +931,7 @@ public static Single FromInt64ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromInt64ToDecimal(object input) { return Converts.ToDecimal((Int64)input); @@ -942,7 +942,7 @@ public static Decimal FromInt64ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromInt64ToString(object input) { return Converts.ToString((Int64)input); @@ -953,7 +953,7 @@ public static String FromInt64ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromUInt64ToBoolean(object input) { return Converts.ToBoolean((UInt64)input); @@ -964,7 +964,7 @@ public static Boolean FromUInt64ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromUInt64ToByte(object input) { return Converts.ToByte((UInt64)input); @@ -975,7 +975,7 @@ public static Byte FromUInt64ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromUInt64ToInt16(object input) { return Converts.ToInt16((UInt64)input); @@ -986,7 +986,7 @@ public static Int16 FromUInt64ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromUInt64ToUInt16(object input) { return Converts.ToUInt16((UInt64)input); @@ -997,7 +997,7 @@ public static UInt16 FromUInt64ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromUInt64ToInt32(object input) { return Converts.ToInt32((UInt64)input); @@ -1008,7 +1008,7 @@ public static Int32 FromUInt64ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromUInt64ToUInt32(object input) { return Converts.ToUInt32((UInt64)input); @@ -1019,7 +1019,7 @@ public static UInt32 FromUInt64ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromUInt64ToInt64(object input) { return Converts.ToInt64((UInt64)input); @@ -1030,7 +1030,7 @@ public static Int64 FromUInt64ToInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromUInt64ToChar(object input) { return Converts.ToChar((UInt64)input); @@ -1041,7 +1041,7 @@ public static Char FromUInt64ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromUInt64ToDouble(object input) { return Converts.ToDouble((UInt64)input); @@ -1052,7 +1052,7 @@ public static Double FromUInt64ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromUInt64ToSingle(object input) { return Converts.ToSingle((UInt64)input); @@ -1063,7 +1063,7 @@ public static Single FromUInt64ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromUInt64ToDecimal(object input) { return Converts.ToDecimal((UInt64)input); @@ -1074,7 +1074,7 @@ public static Decimal FromUInt64ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromUInt64ToString(object input) { return Converts.ToString((UInt64)input); @@ -1085,7 +1085,7 @@ public static String FromUInt64ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromCharToBoolean(object input) { return Converts.ToBoolean((Char)input); @@ -1096,7 +1096,7 @@ public static Boolean FromCharToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromCharToByte(object input) { return Converts.ToByte((Char)input); @@ -1107,7 +1107,7 @@ public static Byte FromCharToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromCharToInt16(object input) { return Converts.ToInt16((Char)input); @@ -1118,7 +1118,7 @@ public static Int16 FromCharToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromCharToUInt16(object input) { return Converts.ToUInt16((Char)input); @@ -1129,7 +1129,7 @@ public static UInt16 FromCharToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromCharToInt32(object input) { return Converts.ToInt32((Char)input); @@ -1140,7 +1140,7 @@ public static Int32 FromCharToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromCharToUInt32(object input) { return Converts.ToUInt32((Char)input); @@ -1151,7 +1151,7 @@ public static UInt32 FromCharToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromCharToInt64(object input) { return Converts.ToInt64((Char)input); @@ -1162,7 +1162,7 @@ public static Int64 FromCharToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromCharToUInt64(object input) { return Converts.ToUInt64((Char)input); @@ -1173,7 +1173,7 @@ public static UInt64 FromCharToUInt64(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromCharToDouble(object input) { return Converts.ToDouble((Char)input); @@ -1184,7 +1184,7 @@ public static Double FromCharToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromCharToSingle(object input) { return Converts.ToSingle((Char)input); @@ -1195,7 +1195,7 @@ public static Single FromCharToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromCharToDecimal(object input) { return Converts.ToDecimal((Char)input); @@ -1206,7 +1206,7 @@ public static Decimal FromCharToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromCharToString(object input) { return Converts.ToString((Char)input); @@ -1217,7 +1217,7 @@ public static String FromCharToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromDoubleToBoolean(object input) { return Converts.ToBoolean((Double)input); @@ -1228,7 +1228,7 @@ public static Boolean FromDoubleToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromDoubleToByte(object input) { return Converts.ToByte((Double)input); @@ -1239,7 +1239,7 @@ public static Byte FromDoubleToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromDoubleToInt16(object input) { return Converts.ToInt16((Double)input); @@ -1250,7 +1250,7 @@ public static Int16 FromDoubleToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromDoubleToUInt16(object input) { return Converts.ToUInt16((Double)input); @@ -1261,7 +1261,7 @@ public static UInt16 FromDoubleToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromDoubleToInt32(object input) { return Converts.ToInt32((Double)input); @@ -1272,7 +1272,7 @@ public static Int32 FromDoubleToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromDoubleToUInt32(object input) { return Converts.ToUInt32((Double)input); @@ -1283,7 +1283,7 @@ public static UInt32 FromDoubleToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromDoubleToInt64(object input) { return Converts.ToInt64((Double)input); @@ -1294,7 +1294,7 @@ public static Int64 FromDoubleToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromDoubleToUInt64(object input) { return Converts.ToUInt64((Double)input); @@ -1305,7 +1305,7 @@ public static UInt64 FromDoubleToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromDoubleToChar(object input) { return Converts.ToChar((Double)input); @@ -1316,7 +1316,7 @@ public static Char FromDoubleToChar(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromDoubleToSingle(object input) { return Converts.ToSingle((Double)input); @@ -1327,7 +1327,7 @@ public static Single FromDoubleToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromDoubleToDecimal(object input) { return Converts.ToDecimal((Double)input); @@ -1338,7 +1338,7 @@ public static Decimal FromDoubleToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromDoubleToString(object input) { return Converts.ToString((Double)input); @@ -1349,7 +1349,7 @@ public static String FromDoubleToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromSingleToBoolean(object input) { return Converts.ToBoolean((Single)input); @@ -1360,7 +1360,7 @@ public static Boolean FromSingleToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromSingleToByte(object input) { return Converts.ToByte((Single)input); @@ -1371,7 +1371,7 @@ public static Byte FromSingleToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromSingleToInt16(object input) { return Converts.ToInt16((Single)input); @@ -1382,7 +1382,7 @@ public static Int16 FromSingleToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromSingleToUInt16(object input) { return Converts.ToUInt16((Single)input); @@ -1393,7 +1393,7 @@ public static UInt16 FromSingleToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromSingleToInt32(object input) { return Converts.ToInt32((Single)input); @@ -1404,7 +1404,7 @@ public static Int32 FromSingleToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromSingleToUInt32(object input) { return Converts.ToUInt32((Single)input); @@ -1415,7 +1415,7 @@ public static UInt32 FromSingleToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromSingleToInt64(object input) { return Converts.ToInt64((Single)input); @@ -1426,7 +1426,7 @@ public static Int64 FromSingleToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromSingleToUInt64(object input) { return Converts.ToUInt64((Single)input); @@ -1437,7 +1437,7 @@ public static UInt64 FromSingleToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromSingleToChar(object input) { return Converts.ToChar((Single)input); @@ -1448,7 +1448,7 @@ public static Char FromSingleToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromSingleToDouble(object input) { return Converts.ToDouble((Single)input); @@ -1459,7 +1459,7 @@ public static Double FromSingleToDouble(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromSingleToDecimal(object input) { return Converts.ToDecimal((Single)input); @@ -1470,7 +1470,7 @@ public static Decimal FromSingleToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromSingleToString(object input) { return Converts.ToString((Single)input); @@ -1481,7 +1481,7 @@ public static String FromSingleToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromDecimalToBoolean(object input) { return Converts.ToBoolean((Decimal)input); @@ -1492,7 +1492,7 @@ public static Boolean FromDecimalToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromDecimalToByte(object input) { return Converts.ToByte((Decimal)input); @@ -1503,7 +1503,7 @@ public static Byte FromDecimalToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromDecimalToInt16(object input) { return Converts.ToInt16((Decimal)input); @@ -1514,7 +1514,7 @@ public static Int16 FromDecimalToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromDecimalToUInt16(object input) { return Converts.ToUInt16((Decimal)input); @@ -1525,7 +1525,7 @@ public static UInt16 FromDecimalToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromDecimalToInt32(object input) { return Converts.ToInt32((Decimal)input); @@ -1536,7 +1536,7 @@ public static Int32 FromDecimalToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromDecimalToUInt32(object input) { return Converts.ToUInt32((Decimal)input); @@ -1547,7 +1547,7 @@ public static UInt32 FromDecimalToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromDecimalToInt64(object input) { return Converts.ToInt64((Decimal)input); @@ -1558,7 +1558,7 @@ public static Int64 FromDecimalToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromDecimalToUInt64(object input) { return Converts.ToUInt64((Decimal)input); @@ -1569,7 +1569,7 @@ public static UInt64 FromDecimalToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromDecimalToChar(object input) { return Converts.ToChar((Decimal)input); @@ -1580,7 +1580,7 @@ public static Char FromDecimalToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromDecimalToDouble(object input) { return Converts.ToDouble((Decimal)input); @@ -1591,7 +1591,7 @@ public static Double FromDecimalToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromDecimalToSingle(object input) { return Converts.ToSingle((Decimal)input); @@ -1602,7 +1602,7 @@ public static Single FromDecimalToSingle(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static String FromDecimalToString(object input) { return Converts.ToString((Decimal)input); @@ -1613,7 +1613,7 @@ public static String FromDecimalToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Boolean FromStringToBoolean(object input) { return Converts.ToBoolean((String)input); @@ -1624,7 +1624,7 @@ public static Boolean FromStringToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Byte FromStringToByte(object input) { return Converts.ToByte((String)input); @@ -1635,7 +1635,7 @@ public static Byte FromStringToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int16 FromStringToInt16(object input) { return Converts.ToInt16((String)input); @@ -1646,7 +1646,7 @@ public static Int16 FromStringToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt16 FromStringToUInt16(object input) { return Converts.ToUInt16((String)input); @@ -1657,7 +1657,7 @@ public static UInt16 FromStringToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int32 FromStringToInt32(object input) { return Converts.ToInt32((String)input); @@ -1668,7 +1668,7 @@ public static Int32 FromStringToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt32 FromStringToUInt32(object input) { return Converts.ToUInt32((String)input); @@ -1679,7 +1679,7 @@ public static UInt32 FromStringToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Int64 FromStringToInt64(object input) { return Converts.ToInt64((String)input); @@ -1690,7 +1690,7 @@ public static Int64 FromStringToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static UInt64 FromStringToUInt64(object input) { return Converts.ToUInt64((String)input); @@ -1701,7 +1701,7 @@ public static UInt64 FromStringToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Char FromStringToChar(object input) { return Converts.ToChar((String)input); @@ -1712,7 +1712,7 @@ public static Char FromStringToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Double FromStringToDouble(object input) { return Converts.ToDouble((String)input); @@ -1723,7 +1723,7 @@ public static Double FromStringToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Single FromStringToSingle(object input) { return Converts.ToSingle((String)input); @@ -1734,7 +1734,7 @@ public static Single FromStringToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Decimal FromStringToDecimal(object input) { return Converts.ToDecimal((String)input); diff --git a/src/NumSharp.Core/Utilities/SteppingExtension.cs b/src/NumSharp.Core/Utilities/SteppingExtension.cs index 38b01d4c..b273b35e 100644 --- a/src/NumSharp.Core/Utilities/SteppingExtension.cs +++ b/src/NumSharp.Core/Utilities/SteppingExtension.cs @@ -1,37 +1,37 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace NumSharp.Utilities -{ - public static class SteppingExtension - { - // this will step an array ... [1,2,3,4].Step(2) => [1,3] - // if step is 1 the original array is returned without copying it - public static T[] Step(this T[] array, int step) - { - // todo: optimize performance? avoid array copying as much as possible, etc. - if (step == 0) - throw new ArgumentException("Step of 0 is not allowed!"); - if (step == 1) - return array; - if (step == -1) - return array.AsEnumerable().Reverse().ToArray(); - var stepped_enumerable = Step(step < 0 ? array.AsEnumerable().Reverse().GetEnumerator() : array.OfType().GetEnumerator(), Math.Abs(step)); - return stepped_enumerable.ToArray(); - } - - private static IEnumerable Step(IEnumerator enumerator, int step) - { - while (enumerator.MoveNext()) - { - yield return enumerator.Current; - for (int i = 0; i < step - 1; i++) - { - if (!enumerator.MoveNext()) - yield break; - } - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; + +namespace NumSharp.Utilities +{ + public static class SteppingExtension + { + // this will step an array ... [1,2,3,4].Step(2) => [1,3] + // if step is 1 the original array is returned without copying it + public static T[] Step(this T[] array, int step) + { + // todo: optimize performance? avoid array copying as much as possible, etc. + if (step == 0) + throw new ArgumentException("Step of 0 is not allowed!"); + if (step == 1) + return array; + if (step == -1) + return array.AsEnumerable().Reverse().ToArray(); + var stepped_enumerable = Step(step < 0 ? array.AsEnumerable().Reverse().GetEnumerator() : array.OfType().GetEnumerator(), Math.Abs(step)); + return stepped_enumerable.ToArray(); + } + + private static IEnumerable Step(IEnumerator enumerator, int step) + { + while (enumerator.MoveNext()) + { + yield return enumerator.Current; + for (int i = 0; i < step - 1; i++) + { + if (!enumerator.MoveNext()) + yield break; + } + } + } + } +} diff --git a/src/NumSharp.Core/Utilities/TypelessConvert.cs b/src/NumSharp.Core/Utilities/TypelessConvert.cs index b9ddb353..94d7b589 100644 --- a/src/NumSharp.Core/Utilities/TypelessConvert.cs +++ b/src/NumSharp.Core/Utilities/TypelessConvert.cs @@ -197,7 +197,7 @@ public static TypelessConvertDelegate GetConverter(Type input, Type output) /// /// The object that will be casted to and then converted to /// #2 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object From#1To#2(object input) { return Converts.To#2((#1)input); @@ -211,7 +211,7 @@ public static TypelessConvertDelegate GetConverter(Type input, Type output) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToByte(object input) { return Converts.ToByte((Boolean)input); @@ -222,7 +222,7 @@ public static object FromBooleanToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToInt16(object input) { return Converts.ToInt16((Boolean)input); @@ -233,7 +233,7 @@ public static object FromBooleanToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToUInt16(object input) { return Converts.ToUInt16((Boolean)input); @@ -244,7 +244,7 @@ public static object FromBooleanToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToInt32(object input) { return Converts.ToInt32((Boolean)input); @@ -255,7 +255,7 @@ public static object FromBooleanToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToUInt32(object input) { return Converts.ToUInt32((Boolean)input); @@ -266,7 +266,7 @@ public static object FromBooleanToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToInt64(object input) { return Converts.ToInt64((Boolean)input); @@ -277,7 +277,7 @@ public static object FromBooleanToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToUInt64(object input) { return Converts.ToUInt64((Boolean)input); @@ -288,7 +288,7 @@ public static object FromBooleanToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToChar(object input) { return Converts.ToChar((Boolean)input); @@ -299,7 +299,7 @@ public static object FromBooleanToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToDouble(object input) { return Converts.ToDouble((Boolean)input); @@ -310,7 +310,7 @@ public static object FromBooleanToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToSingle(object input) { return Converts.ToSingle((Boolean)input); @@ -321,7 +321,7 @@ public static object FromBooleanToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToDecimal(object input) { return Converts.ToDecimal((Boolean)input); @@ -332,7 +332,7 @@ public static object FromBooleanToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromBooleanToString(object input) { return Converts.ToString((Boolean)input); @@ -343,7 +343,7 @@ public static object FromBooleanToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToBoolean(object input) { return Converts.ToBoolean((Byte)input); @@ -354,7 +354,7 @@ public static object FromByteToBoolean(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToInt16(object input) { return Converts.ToInt16((Byte)input); @@ -365,7 +365,7 @@ public static object FromByteToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToUInt16(object input) { return Converts.ToUInt16((Byte)input); @@ -376,7 +376,7 @@ public static object FromByteToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToInt32(object input) { return Converts.ToInt32((Byte)input); @@ -387,7 +387,7 @@ public static object FromByteToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToUInt32(object input) { return Converts.ToUInt32((Byte)input); @@ -398,7 +398,7 @@ public static object FromByteToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToInt64(object input) { return Converts.ToInt64((Byte)input); @@ -409,7 +409,7 @@ public static object FromByteToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToUInt64(object input) { return Converts.ToUInt64((Byte)input); @@ -420,7 +420,7 @@ public static object FromByteToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToChar(object input) { return Converts.ToChar((Byte)input); @@ -431,7 +431,7 @@ public static object FromByteToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToDouble(object input) { return Converts.ToDouble((Byte)input); @@ -442,7 +442,7 @@ public static object FromByteToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToSingle(object input) { return Converts.ToSingle((Byte)input); @@ -453,7 +453,7 @@ public static object FromByteToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToDecimal(object input) { return Converts.ToDecimal((Byte)input); @@ -464,7 +464,7 @@ public static object FromByteToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromByteToString(object input) { return Converts.ToString((Byte)input); @@ -475,7 +475,7 @@ public static object FromByteToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToBoolean(object input) { return Converts.ToBoolean((Int16)input); @@ -486,7 +486,7 @@ public static object FromInt16ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToByte(object input) { return Converts.ToByte((Int16)input); @@ -497,7 +497,7 @@ public static object FromInt16ToByte(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToUInt16(object input) { return Converts.ToUInt16((Int16)input); @@ -508,7 +508,7 @@ public static object FromInt16ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToInt32(object input) { return Converts.ToInt32((Int16)input); @@ -519,7 +519,7 @@ public static object FromInt16ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToUInt32(object input) { return Converts.ToUInt32((Int16)input); @@ -530,7 +530,7 @@ public static object FromInt16ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToInt64(object input) { return Converts.ToInt64((Int16)input); @@ -541,7 +541,7 @@ public static object FromInt16ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToUInt64(object input) { return Converts.ToUInt64((Int16)input); @@ -552,7 +552,7 @@ public static object FromInt16ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToChar(object input) { return Converts.ToChar((Int16)input); @@ -563,7 +563,7 @@ public static object FromInt16ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToDouble(object input) { return Converts.ToDouble((Int16)input); @@ -574,7 +574,7 @@ public static object FromInt16ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToSingle(object input) { return Converts.ToSingle((Int16)input); @@ -585,7 +585,7 @@ public static object FromInt16ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToDecimal(object input) { return Converts.ToDecimal((Int16)input); @@ -596,7 +596,7 @@ public static object FromInt16ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt16ToString(object input) { return Converts.ToString((Int16)input); @@ -607,7 +607,7 @@ public static object FromInt16ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToBoolean(object input) { return Converts.ToBoolean((UInt16)input); @@ -618,7 +618,7 @@ public static object FromUInt16ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToByte(object input) { return Converts.ToByte((UInt16)input); @@ -629,7 +629,7 @@ public static object FromUInt16ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToInt16(object input) { return Converts.ToInt16((UInt16)input); @@ -640,7 +640,7 @@ public static object FromUInt16ToInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToInt32(object input) { return Converts.ToInt32((UInt16)input); @@ -651,7 +651,7 @@ public static object FromUInt16ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToUInt32(object input) { return Converts.ToUInt32((UInt16)input); @@ -662,7 +662,7 @@ public static object FromUInt16ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToInt64(object input) { return Converts.ToInt64((UInt16)input); @@ -673,7 +673,7 @@ public static object FromUInt16ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToUInt64(object input) { return Converts.ToUInt64((UInt16)input); @@ -684,7 +684,7 @@ public static object FromUInt16ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToChar(object input) { return Converts.ToChar((UInt16)input); @@ -695,7 +695,7 @@ public static object FromUInt16ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToDouble(object input) { return Converts.ToDouble((UInt16)input); @@ -706,7 +706,7 @@ public static object FromUInt16ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToSingle(object input) { return Converts.ToSingle((UInt16)input); @@ -717,7 +717,7 @@ public static object FromUInt16ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToDecimal(object input) { return Converts.ToDecimal((UInt16)input); @@ -728,7 +728,7 @@ public static object FromUInt16ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt16ToString(object input) { return Converts.ToString((UInt16)input); @@ -739,7 +739,7 @@ public static object FromUInt16ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToBoolean(object input) { return Converts.ToBoolean((Int32)input); @@ -750,7 +750,7 @@ public static object FromInt32ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToByte(object input) { return Converts.ToByte((Int32)input); @@ -761,7 +761,7 @@ public static object FromInt32ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToInt16(object input) { return Converts.ToInt16((Int32)input); @@ -772,7 +772,7 @@ public static object FromInt32ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToUInt16(object input) { return Converts.ToUInt16((Int32)input); @@ -783,7 +783,7 @@ public static object FromInt32ToUInt16(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToUInt32(object input) { return Converts.ToUInt32((Int32)input); @@ -794,7 +794,7 @@ public static object FromInt32ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToInt64(object input) { return Converts.ToInt64((Int32)input); @@ -805,7 +805,7 @@ public static object FromInt32ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToUInt64(object input) { return Converts.ToUInt64((Int32)input); @@ -816,7 +816,7 @@ public static object FromInt32ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToChar(object input) { return Converts.ToChar((Int32)input); @@ -827,7 +827,7 @@ public static object FromInt32ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToDouble(object input) { return Converts.ToDouble((Int32)input); @@ -838,7 +838,7 @@ public static object FromInt32ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToSingle(object input) { return Converts.ToSingle((Int32)input); @@ -849,7 +849,7 @@ public static object FromInt32ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToDecimal(object input) { return Converts.ToDecimal((Int32)input); @@ -860,7 +860,7 @@ public static object FromInt32ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt32ToString(object input) { return Converts.ToString((Int32)input); @@ -871,7 +871,7 @@ public static object FromInt32ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToBoolean(object input) { return Converts.ToBoolean((UInt32)input); @@ -882,7 +882,7 @@ public static object FromUInt32ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToByte(object input) { return Converts.ToByte((UInt32)input); @@ -893,7 +893,7 @@ public static object FromUInt32ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToInt16(object input) { return Converts.ToInt16((UInt32)input); @@ -904,7 +904,7 @@ public static object FromUInt32ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToUInt16(object input) { return Converts.ToUInt16((UInt32)input); @@ -915,7 +915,7 @@ public static object FromUInt32ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToInt32(object input) { return Converts.ToInt32((UInt32)input); @@ -926,7 +926,7 @@ public static object FromUInt32ToInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToInt64(object input) { return Converts.ToInt64((UInt32)input); @@ -937,7 +937,7 @@ public static object FromUInt32ToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToUInt64(object input) { return Converts.ToUInt64((UInt32)input); @@ -948,7 +948,7 @@ public static object FromUInt32ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToChar(object input) { return Converts.ToChar((UInt32)input); @@ -959,7 +959,7 @@ public static object FromUInt32ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToDouble(object input) { return Converts.ToDouble((UInt32)input); @@ -970,7 +970,7 @@ public static object FromUInt32ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToSingle(object input) { return Converts.ToSingle((UInt32)input); @@ -981,7 +981,7 @@ public static object FromUInt32ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToDecimal(object input) { return Converts.ToDecimal((UInt32)input); @@ -992,7 +992,7 @@ public static object FromUInt32ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt32ToString(object input) { return Converts.ToString((UInt32)input); @@ -1003,7 +1003,7 @@ public static object FromUInt32ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToBoolean(object input) { return Converts.ToBoolean((Int64)input); @@ -1014,7 +1014,7 @@ public static object FromInt64ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToByte(object input) { return Converts.ToByte((Int64)input); @@ -1025,7 +1025,7 @@ public static object FromInt64ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToInt16(object input) { return Converts.ToInt16((Int64)input); @@ -1036,7 +1036,7 @@ public static object FromInt64ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToUInt16(object input) { return Converts.ToUInt16((Int64)input); @@ -1047,7 +1047,7 @@ public static object FromInt64ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToInt32(object input) { return Converts.ToInt32((Int64)input); @@ -1058,7 +1058,7 @@ public static object FromInt64ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToUInt32(object input) { return Converts.ToUInt32((Int64)input); @@ -1069,7 +1069,7 @@ public static object FromInt64ToUInt32(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToUInt64(object input) { return Converts.ToUInt64((Int64)input); @@ -1080,7 +1080,7 @@ public static object FromInt64ToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToChar(object input) { return Converts.ToChar((Int64)input); @@ -1091,7 +1091,7 @@ public static object FromInt64ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToDouble(object input) { return Converts.ToDouble((Int64)input); @@ -1102,7 +1102,7 @@ public static object FromInt64ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToSingle(object input) { return Converts.ToSingle((Int64)input); @@ -1113,7 +1113,7 @@ public static object FromInt64ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToDecimal(object input) { return Converts.ToDecimal((Int64)input); @@ -1124,7 +1124,7 @@ public static object FromInt64ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromInt64ToString(object input) { return Converts.ToString((Int64)input); @@ -1135,7 +1135,7 @@ public static object FromInt64ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToBoolean(object input) { return Converts.ToBoolean((UInt64)input); @@ -1146,7 +1146,7 @@ public static object FromUInt64ToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToByte(object input) { return Converts.ToByte((UInt64)input); @@ -1157,7 +1157,7 @@ public static object FromUInt64ToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToInt16(object input) { return Converts.ToInt16((UInt64)input); @@ -1168,7 +1168,7 @@ public static object FromUInt64ToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToUInt16(object input) { return Converts.ToUInt16((UInt64)input); @@ -1179,7 +1179,7 @@ public static object FromUInt64ToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToInt32(object input) { return Converts.ToInt32((UInt64)input); @@ -1190,7 +1190,7 @@ public static object FromUInt64ToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToUInt32(object input) { return Converts.ToUInt32((UInt64)input); @@ -1201,7 +1201,7 @@ public static object FromUInt64ToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToInt64(object input) { return Converts.ToInt64((UInt64)input); @@ -1212,7 +1212,7 @@ public static object FromUInt64ToInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToChar(object input) { return Converts.ToChar((UInt64)input); @@ -1223,7 +1223,7 @@ public static object FromUInt64ToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToDouble(object input) { return Converts.ToDouble((UInt64)input); @@ -1234,7 +1234,7 @@ public static object FromUInt64ToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToSingle(object input) { return Converts.ToSingle((UInt64)input); @@ -1245,7 +1245,7 @@ public static object FromUInt64ToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToDecimal(object input) { return Converts.ToDecimal((UInt64)input); @@ -1256,7 +1256,7 @@ public static object FromUInt64ToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromUInt64ToString(object input) { return Converts.ToString((UInt64)input); @@ -1267,7 +1267,7 @@ public static object FromUInt64ToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToBoolean(object input) { return Converts.ToBoolean((Char)input); @@ -1278,7 +1278,7 @@ public static object FromCharToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToByte(object input) { return Converts.ToByte((Char)input); @@ -1289,7 +1289,7 @@ public static object FromCharToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToInt16(object input) { return Converts.ToInt16((Char)input); @@ -1300,7 +1300,7 @@ public static object FromCharToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToUInt16(object input) { return Converts.ToUInt16((Char)input); @@ -1311,7 +1311,7 @@ public static object FromCharToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToInt32(object input) { return Converts.ToInt32((Char)input); @@ -1322,7 +1322,7 @@ public static object FromCharToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToUInt32(object input) { return Converts.ToUInt32((Char)input); @@ -1333,7 +1333,7 @@ public static object FromCharToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToInt64(object input) { return Converts.ToInt64((Char)input); @@ -1344,7 +1344,7 @@ public static object FromCharToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToUInt64(object input) { return Converts.ToUInt64((Char)input); @@ -1355,7 +1355,7 @@ public static object FromCharToUInt64(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToDouble(object input) { return Converts.ToDouble((Char)input); @@ -1366,7 +1366,7 @@ public static object FromCharToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToSingle(object input) { return Converts.ToSingle((Char)input); @@ -1377,7 +1377,7 @@ public static object FromCharToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToDecimal(object input) { return Converts.ToDecimal((Char)input); @@ -1388,7 +1388,7 @@ public static object FromCharToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromCharToString(object input) { return Converts.ToString((Char)input); @@ -1399,7 +1399,7 @@ public static object FromCharToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToBoolean(object input) { return Converts.ToBoolean((Double)input); @@ -1410,7 +1410,7 @@ public static object FromDoubleToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToByte(object input) { return Converts.ToByte((Double)input); @@ -1421,7 +1421,7 @@ public static object FromDoubleToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToInt16(object input) { return Converts.ToInt16((Double)input); @@ -1432,7 +1432,7 @@ public static object FromDoubleToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToUInt16(object input) { return Converts.ToUInt16((Double)input); @@ -1443,7 +1443,7 @@ public static object FromDoubleToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToInt32(object input) { return Converts.ToInt32((Double)input); @@ -1454,7 +1454,7 @@ public static object FromDoubleToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToUInt32(object input) { return Converts.ToUInt32((Double)input); @@ -1465,7 +1465,7 @@ public static object FromDoubleToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToInt64(object input) { return Converts.ToInt64((Double)input); @@ -1476,7 +1476,7 @@ public static object FromDoubleToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToUInt64(object input) { return Converts.ToUInt64((Double)input); @@ -1487,7 +1487,7 @@ public static object FromDoubleToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToChar(object input) { return Converts.ToChar((Double)input); @@ -1498,7 +1498,7 @@ public static object FromDoubleToChar(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToSingle(object input) { return Converts.ToSingle((Double)input); @@ -1509,7 +1509,7 @@ public static object FromDoubleToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToDecimal(object input) { return Converts.ToDecimal((Double)input); @@ -1520,7 +1520,7 @@ public static object FromDoubleToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDoubleToString(object input) { return Converts.ToString((Double)input); @@ -1531,7 +1531,7 @@ public static object FromDoubleToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToBoolean(object input) { return Converts.ToBoolean((Single)input); @@ -1542,7 +1542,7 @@ public static object FromSingleToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToByte(object input) { return Converts.ToByte((Single)input); @@ -1553,7 +1553,7 @@ public static object FromSingleToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToInt16(object input) { return Converts.ToInt16((Single)input); @@ -1564,7 +1564,7 @@ public static object FromSingleToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToUInt16(object input) { return Converts.ToUInt16((Single)input); @@ -1575,7 +1575,7 @@ public static object FromSingleToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToInt32(object input) { return Converts.ToInt32((Single)input); @@ -1586,7 +1586,7 @@ public static object FromSingleToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToUInt32(object input) { return Converts.ToUInt32((Single)input); @@ -1597,7 +1597,7 @@ public static object FromSingleToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToInt64(object input) { return Converts.ToInt64((Single)input); @@ -1608,7 +1608,7 @@ public static object FromSingleToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToUInt64(object input) { return Converts.ToUInt64((Single)input); @@ -1619,7 +1619,7 @@ public static object FromSingleToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToChar(object input) { return Converts.ToChar((Single)input); @@ -1630,7 +1630,7 @@ public static object FromSingleToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToDouble(object input) { return Converts.ToDouble((Single)input); @@ -1641,7 +1641,7 @@ public static object FromSingleToDouble(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToDecimal(object input) { return Converts.ToDecimal((Single)input); @@ -1652,7 +1652,7 @@ public static object FromSingleToDecimal(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromSingleToString(object input) { return Converts.ToString((Single)input); @@ -1663,7 +1663,7 @@ public static object FromSingleToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToBoolean(object input) { return Converts.ToBoolean((Decimal)input); @@ -1674,7 +1674,7 @@ public static object FromDecimalToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToByte(object input) { return Converts.ToByte((Decimal)input); @@ -1685,7 +1685,7 @@ public static object FromDecimalToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToInt16(object input) { return Converts.ToInt16((Decimal)input); @@ -1696,7 +1696,7 @@ public static object FromDecimalToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToUInt16(object input) { return Converts.ToUInt16((Decimal)input); @@ -1707,7 +1707,7 @@ public static object FromDecimalToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToInt32(object input) { return Converts.ToInt32((Decimal)input); @@ -1718,7 +1718,7 @@ public static object FromDecimalToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToUInt32(object input) { return Converts.ToUInt32((Decimal)input); @@ -1729,7 +1729,7 @@ public static object FromDecimalToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToInt64(object input) { return Converts.ToInt64((Decimal)input); @@ -1740,7 +1740,7 @@ public static object FromDecimalToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToUInt64(object input) { return Converts.ToUInt64((Decimal)input); @@ -1751,7 +1751,7 @@ public static object FromDecimalToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToChar(object input) { return Converts.ToChar((Decimal)input); @@ -1762,7 +1762,7 @@ public static object FromDecimalToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToDouble(object input) { return Converts.ToDouble((Decimal)input); @@ -1773,7 +1773,7 @@ public static object FromDecimalToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToSingle(object input) { return Converts.ToSingle((Decimal)input); @@ -1784,7 +1784,7 @@ public static object FromDecimalToSingle(object input) /// /// The object that will be casted to and then converted to /// String - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromDecimalToString(object input) { return Converts.ToString((Decimal)input); @@ -1795,7 +1795,7 @@ public static object FromDecimalToString(object input) /// /// The object that will be casted to and then converted to /// Boolean - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToBoolean(object input) { return Converts.ToBoolean((String)input); @@ -1806,7 +1806,7 @@ public static object FromStringToBoolean(object input) /// /// The object that will be casted to and then converted to /// Byte - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToByte(object input) { return Converts.ToByte((String)input); @@ -1817,7 +1817,7 @@ public static object FromStringToByte(object input) /// /// The object that will be casted to and then converted to /// Int16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToInt16(object input) { return Converts.ToInt16((String)input); @@ -1828,7 +1828,7 @@ public static object FromStringToInt16(object input) /// /// The object that will be casted to and then converted to /// UInt16 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToUInt16(object input) { return Converts.ToUInt16((String)input); @@ -1839,7 +1839,7 @@ public static object FromStringToUInt16(object input) /// /// The object that will be casted to and then converted to /// Int32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToInt32(object input) { return Converts.ToInt32((String)input); @@ -1850,7 +1850,7 @@ public static object FromStringToInt32(object input) /// /// The object that will be casted to and then converted to /// UInt32 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToUInt32(object input) { return Converts.ToUInt32((String)input); @@ -1861,7 +1861,7 @@ public static object FromStringToUInt32(object input) /// /// The object that will be casted to and then converted to /// Int64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToInt64(object input) { return Converts.ToInt64((String)input); @@ -1872,7 +1872,7 @@ public static object FromStringToInt64(object input) /// /// The object that will be casted to and then converted to /// UInt64 - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToUInt64(object input) { return Converts.ToUInt64((String)input); @@ -1883,7 +1883,7 @@ public static object FromStringToUInt64(object input) /// /// The object that will be casted to and then converted to /// Char - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToChar(object input) { return Converts.ToChar((String)input); @@ -1894,7 +1894,7 @@ public static object FromStringToChar(object input) /// /// The object that will be casted to and then converted to /// Double - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToDouble(object input) { return Converts.ToDouble((String)input); @@ -1905,7 +1905,7 @@ public static object FromStringToDouble(object input) /// /// The object that will be casted to and then converted to /// Single - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToSingle(object input) { return Converts.ToSingle((String)input); @@ -1916,7 +1916,7 @@ public static object FromStringToSingle(object input) /// /// The object that will be casted to and then converted to /// Decimal - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static object FromStringToDecimal(object input) { return Converts.ToDecimal((String)input); diff --git a/src/NumSharp.Core/Utilities/py.cs b/src/NumSharp.Core/Utilities/py.cs index 6bf3219f..70831e19 100644 --- a/src/NumSharp.Core/Utilities/py.cs +++ b/src/NumSharp.Core/Utilities/py.cs @@ -1,62 +1,62 @@ -using System; -using System.Numerics; -using System.Text.RegularExpressions; - -namespace NumSharp.Utilities -{ - /// - /// Implements Python utility functions that are often used in connection with numpy - /// - public static class py - { - public static int[] range(int n) - { - var a = new int[n]; - for (int i = 0; i < n; i++) - a[i] = i; - return a; - } - /// - /// 解析单个Python风格的复数字符串为Complex对象 - /// - private static readonly Regex _pythonComplexRegex = new Regex( -@"^(?-?\d+(\.\d+)?)?((?\+|-)?(?\d+(\.\d+)?)?)?j$|^(?-?\d+(\.\d+)?)$", -RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture); - public static Complex complex(string input) - { - var match = _pythonComplexRegex.Match(input); - if (!match.Success) - throw new FormatException($"Invalid Python complex format: '{input}'. Expected format like '10+5j', '3-2j', '4j' or '5'."); - - // 解析仅实部的场景 - if (match.Groups["onlyReal"].Success) - { - double real = double.Parse(match.Groups["onlyReal"].Value); - return new Complex(real, 0); - } - - // 解析实部(默认0) - double realPart = 0; - if (double.TryParse(match.Groups["real"].Value, out double r)) - realPart = r; - - // 解析虚部(处理特殊情况:j / -j / +j) - double imagPart = 0; - string imagStr = match.Groups["imag"].Value; - string imagSign = match.Groups["imagSign"].Value; - - if (string.IsNullOrEmpty(imagStr) && !string.IsNullOrEmpty(input.TrimEnd('j', 'J'))) - { - // 处理仅虚部的情况:j → 1j, -j → -1j, +j → 1j - imagStr = "1"; - } - - if (double.TryParse(imagStr, out double im)) - { - imagPart = im * (imagSign == "-" ? -1 : 1); - } - - return new Complex(realPart, imagPart); - } - } -} +using System; +using System.Numerics; +using System.Text.RegularExpressions; + +namespace NumSharp.Utilities +{ + /// + /// Implements Python utility functions that are often used in connection with numpy + /// + public static class py + { + public static int[] range(int n) + { + var a = new int[n]; + for (int i = 0; i < n; i++) + a[i] = i; + return a; + } + /// + /// 解析单个Python风格的复数字符串为Complex对象 + /// + private static readonly Regex _pythonComplexRegex = new Regex( +@"^(?-?\d+(\.\d+)?)?((?\+|-)?(?\d+(\.\d+)?)?)?j$|^(?-?\d+(\.\d+)?)$", +RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.ExplicitCapture); + public static Complex complex(string input) + { + var match = _pythonComplexRegex.Match(input); + if (!match.Success) + throw new FormatException($"Invalid Python complex format: '{input}'. Expected format like '10+5j', '3-2j', '4j' or '5'."); + + // 解析仅实部的场景 + if (match.Groups["onlyReal"].Success) + { + double real = double.Parse(match.Groups["onlyReal"].Value); + return new Complex(real, 0); + } + + // 解析实部(默认0) + double realPart = 0; + if (double.TryParse(match.Groups["real"].Value, out double r)) + realPart = r; + + // 解析虚部(处理特殊情况:j / -j / +j) + double imagPart = 0; + string imagStr = match.Groups["imag"].Value; + string imagSign = match.Groups["imagSign"].Value; + + if (string.IsNullOrEmpty(imagStr) && !string.IsNullOrEmpty(input.TrimEnd('j', 'J'))) + { + // 处理仅虚部的情况:j → 1j, -j → -1j, +j → 1j + imagStr = "1"; + } + + if (double.TryParse(imagStr, out double im)) + { + imagPart = im * (imagSign == "-" ? -1 : 1); + } + + return new Complex(realPart, imagPart); + } + } +} diff --git a/src/NumSharp.Core/View/Shape.Reshaping.cs b/src/NumSharp.Core/View/Shape.Reshaping.cs index a5091cb2..61616826 100644 --- a/src/NumSharp.Core/View/Shape.Reshaping.cs +++ b/src/NumSharp.Core/View/Shape.Reshaping.cs @@ -19,7 +19,7 @@ public partial struct Shape /// If shape's size mismatches current shape size. /// If 's size == 0 /// When true, then guards are skipped. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public readonly Shape Reshape(Shape newShape, bool @unsafe = true) { if (IsBroadcasted) @@ -70,7 +70,7 @@ public readonly Shape Reshape(Shape newShape, bool @unsafe = true) /// /// Changes the shape representing this storage (broadcast version). /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] private readonly Shape _reshapeBroadcast(Shape newShape, bool @unsafe = true) { // Handle -1 in reshape diff --git a/src/NumSharp.Core/View/Shape.Unmanaged.cs b/src/NumSharp.Core/View/Shape.Unmanaged.cs index d5ba880a..a2c87e5d 100644 --- a/src/NumSharp.Core/View/Shape.Unmanaged.cs +++ b/src/NumSharp.Core/View/Shape.Unmanaged.cs @@ -1,126 +1,126 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; -using System.Text; - -namespace NumSharp -{ - public partial struct Shape - { - /// - /// Get offset index out of coordinate indices (pointer version). - /// NumPy-aligned: offset + sum(indices * strides) - /// - /// A pointer to the coordinates to turn into linear offset - /// The number of dimensions - /// The index in the memory block that refers to a specific value. - [MethodImpl((MethodImplOptions)768)] - public readonly unsafe int GetOffset(int* indices, int ndims) - { - // Scalar case - if (dimensions.Length == 0) - return offset + (ndims > 0 ? indices[0] : 0); - - // NumPy formula: offset + sum(indices * strides) - int off = offset; - unchecked - { - for (int i = 0; i < ndims; i++) - off += strides[i] * indices[i]; - } - return off; - } - - /// - /// Gets the shape based on given and the index offset (C-Contiguous) inside the current storage. - /// - /// The selection of indexes 0 based. - /// - /// Used for slicing, returned shape is the new shape of the slice and offset is the offset from current address. - [MethodImpl((MethodImplOptions)768)] - public readonly unsafe (Shape Shape, int Offset) GetSubshape(int* dims, int ndims) - { - if (ndims == 0) - return (this, 0); - - int offset; - var dim = ndims; - var newNDim = dimensions.Length - dim; - if (IsBroadcasted) - { - var dimsClone = stackalloc int[ndims]; - for (int j = 0; j < ndims; j++) - dimsClone[j] = dims[j]; - - // NumPy-aligned: compute unreduced dims on the fly (stride=0 means broadcast) - // Unbroadcast indices (wrap around for broadcast dimensions) - for (int i = 0; i < dim; i++) - { - int unreducedDim = strides[i] == 0 ? 1 : dimensions[i]; - dimsClone[i] = dimsClone[i] % unreducedDim; - } - - // Compute offset using strides - offset = this.offset; - for (int i = 0; i < dim; i++) - offset += strides[i] * dimsClone[i]; - - var retShape = new int[newNDim]; - var retStrides = new int[newNDim]; - for (int i = 0; i < newNDim; i++) - { - retShape[i] = this.dimensions[dim + i]; - retStrides[i] = this.strides[dim + i]; - } - - // Create result with bufferSize preserved (immutable constructor) - int bufSize = this.bufferSize > 0 ? this.bufferSize : this.size; - var result = new Shape(retShape, retStrides, offset, bufSize); - return (result, offset); - } - - //compute offset - offset = GetOffset(dims, ndims); - - // Use bufferSize for bounds checking (NumPy-aligned: no ViewInfo dependency) - int boundSize = bufferSize > 0 ? bufferSize : size; - if (offset >= boundSize) - throw new IndexOutOfRangeException($"The offset {offset} is out of range in Shape {boundSize}"); - - if (ndims == dimensions.Length) - return (Scalar, offset); - - //compute subshape - var innerShape = new int[newNDim]; - for (int i = 0; i < innerShape.Length; i++) - innerShape[i] = this.dimensions[dim + i]; - - //TODO! This is not full support of sliced, - //TODO! when sliced it usually diverts from this function but it would be better if we add support for sliced arrays too. - return (new Shape(innerShape), offset); - } - - - /// - /// Translates coordinates with negative indices, e.g:

- /// np.arange(9)[-1] == np.arange(9)[8]

- /// np.arange(9)[-2] == np.arange(9)[7]

- ///
- /// The dimensions these coordinates are targeting - /// The coordinates. - /// Coordinates without negative indices. - [SuppressMessage("ReSharper", "ParameterHidesMember"), MethodImpl((MethodImplOptions)512)] - public static unsafe void InferNegativeCoordinates(int[] dimensions, int* coords, int coordsCount) - { - for (int i = 0; i < coordsCount; i++) - { - var curr = coords[i]; - if (curr < 0) - coords[i] = dimensions[i] + curr; - } - } - - /// - } -} +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Text; + +namespace NumSharp +{ + public partial struct Shape + { + /// + /// Get offset index out of coordinate indices (pointer version). + /// NumPy-aligned: offset + sum(indices * strides) + /// + /// A pointer to the coordinates to turn into linear offset + /// The number of dimensions + /// The index in the memory block that refers to a specific value. + [MethodImpl(OptimizeAndInline)] + public readonly unsafe int GetOffset(int* indices, int ndims) + { + // Scalar case + if (dimensions.Length == 0) + return offset + (ndims > 0 ? indices[0] : 0); + + // NumPy formula: offset + sum(indices * strides) + int off = offset; + unchecked + { + for (int i = 0; i < ndims; i++) + off += strides[i] * indices[i]; + } + return off; + } + + /// + /// Gets the shape based on given and the index offset (C-Contiguous) inside the current storage. + /// + /// The selection of indexes 0 based. + /// + /// Used for slicing, returned shape is the new shape of the slice and offset is the offset from current address. + [MethodImpl(OptimizeAndInline)] + public readonly unsafe (Shape Shape, int Offset) GetSubshape(int* dims, int ndims) + { + if (ndims == 0) + return (this, 0); + + int offset; + var dim = ndims; + var newNDim = dimensions.Length - dim; + if (IsBroadcasted) + { + var dimsClone = stackalloc int[ndims]; + for (int j = 0; j < ndims; j++) + dimsClone[j] = dims[j]; + + // NumPy-aligned: compute unreduced dims on the fly (stride=0 means broadcast) + // Unbroadcast indices (wrap around for broadcast dimensions) + for (int i = 0; i < dim; i++) + { + int unreducedDim = strides[i] == 0 ? 1 : dimensions[i]; + dimsClone[i] = dimsClone[i] % unreducedDim; + } + + // Compute offset using strides + offset = this.offset; + for (int i = 0; i < dim; i++) + offset += strides[i] * dimsClone[i]; + + var retShape = new int[newNDim]; + var retStrides = new int[newNDim]; + for (int i = 0; i < newNDim; i++) + { + retShape[i] = this.dimensions[dim + i]; + retStrides[i] = this.strides[dim + i]; + } + + // Create result with bufferSize preserved (immutable constructor) + int bufSize = this.bufferSize > 0 ? this.bufferSize : this.size; + var result = new Shape(retShape, retStrides, offset, bufSize); + return (result, offset); + } + + //compute offset + offset = GetOffset(dims, ndims); + + // Use bufferSize for bounds checking (NumPy-aligned: no ViewInfo dependency) + int boundSize = bufferSize > 0 ? bufferSize : size; + if (offset >= boundSize) + throw new IndexOutOfRangeException($"The offset {offset} is out of range in Shape {boundSize}"); + + if (ndims == dimensions.Length) + return (Scalar, offset); + + //compute subshape + var innerShape = new int[newNDim]; + for (int i = 0; i < innerShape.Length; i++) + innerShape[i] = this.dimensions[dim + i]; + + //TODO! This is not full support of sliced, + //TODO! when sliced it usually diverts from this function but it would be better if we add support for sliced arrays too. + return (new Shape(innerShape), offset); + } + + + /// + /// Translates coordinates with negative indices, e.g:

+ /// np.arange(9)[-1] == np.arange(9)[8]

+ /// np.arange(9)[-2] == np.arange(9)[7]

+ ///
+ /// The dimensions these coordinates are targeting + /// The coordinates. + /// Coordinates without negative indices. + [SuppressMessage("ReSharper", "ParameterHidesMember"), MethodImpl(Optimize)] + public static unsafe void InferNegativeCoordinates(int[] dimensions, int* coords, int coordsCount) + { + for (int i = 0; i < coordsCount; i++) + { + var curr = coords[i]; + if (curr < 0) + coords[i] = dimensions[i] + curr; + } + } + + /// + } +} diff --git a/src/NumSharp.Core/View/Shape.cs b/src/NumSharp.Core/View/Shape.cs index dd0e50fa..ee7d2512 100644 --- a/src/NumSharp.Core/View/Shape.cs +++ b/src/NumSharp.Core/View/Shape.cs @@ -55,7 +55,7 @@ public enum ArrayFlags /// public readonly bool IsSliced { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => offset != 0 || (bufferSize > 0 && bufferSize != size) || !IsContiguous; } @@ -71,7 +71,7 @@ public readonly bool IsSliced /// public readonly bool IsContiguous { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => (_flags & (int)ArrayFlags.C_CONTIGUOUS) != 0; } @@ -80,7 +80,7 @@ public readonly bool IsContiguous /// /// Computes array flags from dimensions and strides (static for readonly struct). /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private static int ComputeFlagsStatic(int[] dims, int[] strides) { int flags = 0; @@ -109,7 +109,7 @@ private static int ComputeFlagsStatic(int[] dims, int[] strides) /// /// Computes whether any dimension is broadcast (stride=0 with dim > 1). /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private static bool ComputeIsBroadcastedStatic(int[] dims, int[] strides) { if (strides == null || strides.Length == 0) @@ -123,7 +123,7 @@ private static bool ComputeIsBroadcastedStatic(int[] dims, int[] strides) /// /// Computes C-contiguity from stride values (NumPy algorithm). /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private static bool ComputeIsContiguousStatic(int[] dims, int[] strides) { if (dims == null || dims.Length == 0) @@ -148,7 +148,7 @@ private static bool ComputeIsContiguousStatic(int[] dims, int[] strides) /// /// Computes size and hash from dimensions. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private static (int size, int hash) ComputeSizeAndHash(int[] dims) { if (dims == null || dims.Length == 0) @@ -170,7 +170,7 @@ private static (int size, int hash) ComputeSizeAndHash(int[] dims) /// /// Computes C-contiguous strides for given dimensions. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] private static int[] ComputeContiguousStrides(int[] dims) { if (dims == null || dims.Length == 0) @@ -192,7 +192,7 @@ private static int[] ComputeContiguousStrides(int[] dims) ///
public readonly bool IsSimpleSlice { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => IsSliced && !IsBroadcasted; } @@ -230,7 +230,7 @@ public readonly bool IsSimpleSlice /// public readonly bool IsBroadcasted { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => (_flags & (int)ArrayFlags.BROADCASTED) != 0; } @@ -240,7 +240,7 @@ public readonly bool IsBroadcasted /// public readonly bool IsWriteable { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => (_flags & (int)ArrayFlags.WRITEABLE) != 0; } @@ -251,7 +251,7 @@ public readonly bool IsWriteable /// public readonly bool OwnsData { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => (_flags & (int)ArrayFlags.OWNDATA) != 0; } @@ -261,7 +261,7 @@ public readonly bool OwnsData /// public readonly ArrayFlags Flags { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => (ArrayFlags)_flags; } @@ -272,7 +272,7 @@ public readonly ArrayFlags Flags /// public readonly bool IsScalarBroadcast { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get { if (strides == null || strides.Length == 0) @@ -294,7 +294,7 @@ public readonly bool IsScalarBroadcast /// public readonly int OriginalSize { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get { if (strides == null || strides.Length == 0) @@ -331,7 +331,7 @@ public readonly int OriginalSize /// /// Create a new scalar shape /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] internal static Shape NewScalar() { return new Shape(); @@ -358,19 +358,19 @@ public static Shape Matrix(int rows, int cols) public readonly int NDim { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => dimensions.Length; } public readonly int[] Dimensions { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => dimensions; } public readonly int[] Strides { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => strides; } @@ -379,7 +379,7 @@ public readonly int[] Strides /// public readonly int Size { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => size; } @@ -390,7 +390,7 @@ public readonly int Size /// public readonly int Offset { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => offset; } @@ -401,7 +401,7 @@ public readonly int Offset /// public readonly int BufferSize { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => bufferSize > 0 ? bufferSize : size; } @@ -533,7 +533,7 @@ public Shape(int[] dims, int[] strides, Shape originalShape) this._flags = ComputeFlagsStatic(dims, strides); } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public Shape(params int[] dims) { if (dims == null) @@ -555,7 +555,7 @@ public Shape(params int[] dims) /// An empty shape without any fields set (all dimensions are 0). /// /// Used internally for building shapes that will be filled in. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static Shape Empty(int ndim) { // Create shape with zero dimensions and zero strides @@ -564,9 +564,9 @@ public static Shape Empty(int ndim) public readonly int this[int dim] { - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] get => dimensions[dim < 0 ? dimensions.Length + dim : dim]; - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] set => dimensions[dim < 0 ? dimensions.Length + dim : dim] = value; } @@ -577,7 +577,7 @@ public readonly int this[int dim] /// The offset within the bounds of . /// The transformed offset. /// For contiguous shapes, returns offset directly. For non-contiguous, translates through coordinates. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public readonly int TransformOffset(int offset) { // For contiguous shapes, direct return @@ -594,7 +594,7 @@ public readonly int TransformOffset(int offset) /// /// The coordinates to turn into linear offset /// The index in the memory block that refers to a specific value. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public readonly int GetOffset(params int[] indices) { // Scalar with single index: direct offset access @@ -611,7 +611,7 @@ public readonly int GetOffset(params int[] indices) /// /// The 1D coordinate to turn into linear offset /// The index in the memory block that refers to a specific value. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] internal readonly int GetOffset_1D(int index) { // Scalar case: direct offset access @@ -629,7 +629,7 @@ internal readonly int GetOffset_1D(int index) /// /// The coordinates to turn into linear offset /// The index in the memory block that refers to a specific value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] internal readonly int GetOffsetSimple(params int[] indices) { int off = offset; @@ -644,7 +644,7 @@ internal readonly int GetOffsetSimple(params int[] indices) /// /// Simplified offset calculation for 1D access. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] internal readonly int GetOffsetSimple(int index) { // Scalar case: direct offset access @@ -656,7 +656,7 @@ internal readonly int GetOffsetSimple(int index) /// /// Simplified offset calculation for 2D access. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] internal readonly int GetOffsetSimple(int i, int j) { return offset + i * strides[0] + j * strides[1]; @@ -665,7 +665,7 @@ internal readonly int GetOffsetSimple(int i, int j) /// /// Simplified offset calculation for 3D access. /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] internal readonly int GetOffsetSimple(int i, int j, int k) { return offset + i * strides[0] + j * strides[1] + k * strides[2]; @@ -678,7 +678,7 @@ internal readonly int GetOffsetSimple(int i, int j, int k) /// The selection of indexes 0 based. /// /// Used for slicing, returned shape is the new shape of the slice and offset is the offset from current address. - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public readonly (Shape Shape, int Offset) GetSubshape(params int[] indicies) { if (indicies.Length == 0) @@ -751,7 +751,7 @@ public readonly (Shape Shape, int Offset) GetSubshape(params int[] indicies) /// /// the index if you would iterate from 0 to shape.size in row major order /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public readonly int[] GetCoordinates(int offset) { // For non-contiguous shapes (transposed, stepped slices, broadcast), strides @@ -805,7 +805,7 @@ public readonly int[] GetCoordinates(int offset) return coords2; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static int GetSize(int[] dims) { int size = 1; @@ -847,7 +847,7 @@ public static int[] GetAxis(int[] dims, int axis) /// Extracts the shape of given . /// /// Supports both jagged and multi-dim. - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] public static int[] ExtractShape(Array array) { if (array == null) @@ -885,11 +885,11 @@ public static int[] ExtractShape(Array array) #region Slicing support - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public readonly Shape Slice(string slicing_notation) => this.Slice(NumSharp.Slice.ParseSlices(slicing_notation)); - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public readonly Shape Slice(params Slice[] input_slices) { if (IsEmpty) @@ -1139,7 +1139,7 @@ public override int GetHashCode() /// The dimensions these coordinates are targeting /// The coordinates. /// Coordinates without negative indices. - [SuppressMessage("ReSharper", "ParameterHidesMember"), MethodImpl((MethodImplOptions)512)] + [SuppressMessage("ReSharper", "ParameterHidesMember"), MethodImpl(Optimize)] public static int[] InferNegativeCoordinates(int[] dimensions, int[] coords) { for (int i = 0; i < coords.Length; i++) diff --git a/src/NumSharp.Core/View/Slice.cs b/src/NumSharp.Core/View/Slice.cs index 588bbcfc..7c56ee6e 100644 --- a/src/NumSharp.Core/View/Slice.cs +++ b/src/NumSharp.Core/View/Slice.cs @@ -69,8 +69,8 @@ public class Slice : IIndex /// public static readonly Slice Ellipsis = new Slice(0, 0, 1) { IsEllipsis = true }; - /// - /// insert a new dimension at this point + /// + /// insert a new dimension at this point /// public static readonly Slice NewAxis = new Slice(0, 0, 1) { IsNewAxis = true }; @@ -79,15 +79,15 @@ public class Slice : IIndex /// /// /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public static Slice Index(int index) => new Slice(index, index + 1) { IsIndex = true }; - ///// - ///// return multiple elements for this dimension specified by the given index array (or boolean mask array) - ///// - ///// + ///// + ///// return multiple elements for this dimension specified by the given index array (or boolean mask array) + ///// + ///// ///// - //[MethodImpl(MethodImplOptions.AggressiveInlining)] + //[MethodImpl(Inline)] //public static Slice Select(NDArray index_array_or_mask) => new Slice(null, null) { Selection=index_array_or_mask }; public int? Start; @@ -97,7 +97,7 @@ public class Slice : IIndex public bool IsEllipsis; public bool IsNewAxis; - ///// + ///// ///// Array of integer indices to select elements by index extraction or boolean values to select by masking the elements of the given dimension. ///// //public NDArray Selection = null; @@ -261,7 +261,7 @@ public override string ToString() // return the size of the slice, given the data dimension on this axis // note: this works only with sanitized shapes! - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(Inline)] public int GetSize() { var astep = Math.Abs(Step); @@ -273,7 +273,7 @@ public int GetSize() /// /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public SliceDef ToSliceDef(int dim) { if (IsIndex) @@ -394,14 +394,14 @@ public SliceDef(string def) public bool IsIndex { - [MethodImpl((MethodImplOptions)768)] get => Count == -1; + [MethodImpl(OptimizeAndInline)] get => Count == -1; } /// /// reverts the order of the slice sequence /// /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public SliceDef Invert() { return new SliceDef() {Count = Count, Start = (Start + Step * Count), Step = -Step}; @@ -419,7 +419,7 @@ public override string ToString() /// /// Merge calculates the resulting one-time slice on the original data if it is sliced repeatedly /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public SliceDef Merge(SliceDef other) { if (other.Count == 0) diff --git a/test/NumSharp.Benchmark/Cast.cs b/test/NumSharp.Benchmark/Cast.cs index 30e458e6..73af39ca 100644 --- a/test/NumSharp.Benchmark/Cast.cs +++ b/test/NumSharp.Benchmark/Cast.cs @@ -60,7 +60,7 @@ public int MakeRef1() return 0; } - [MethodImpl((MethodImplOptions)512)] + [MethodImpl(Optimize)] static unsafe TDest ReinterpretCast(TSource source) { var tr = __makeref(source); diff --git a/test/NumSharp.Benchmark/Unmanaged/CastT.cs b/test/NumSharp.Benchmark/Unmanaged/CastT.cs index 3947e9d4..8e83afc1 100644 --- a/test/NumSharp.Benchmark/Unmanaged/CastT.cs +++ b/test/NumSharp.Benchmark/Unmanaged/CastT.cs @@ -94,39 +94,39 @@ public double FastCastFunction() return ret; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] private double Function(T value) { return FastCast(value); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] private double FunctionB(T value) { return (double)(object)value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] private double FunctionC(T value) where T : struct { return (double)(ValueType)value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] private double FunctionD(T value) where T : IComparable { return (double)(IComparable)value; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] private double FunctionE(T value) where T : IComparable { return Unsafe.As(ref value); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] private TOut FastCast(object @in) { return (TOut)@in; diff --git a/test/NumSharp.Benchmark/Unmanaged/MathOp.cs b/test/NumSharp.Benchmark/Unmanaged/MathOp.cs index 73b39c55..32b38b79 100644 --- a/test/NumSharp.Benchmark/Unmanaged/MathOp.cs +++ b/test/NumSharp.Benchmark/Unmanaged/MathOp.cs @@ -366,7 +366,7 @@ public void Direct() /// this was stolen from Vector{T} /// This is fast because typeof vs typeof is evaluation during compilation time or as soon as JIT optimizes it. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static T ScalarAdd(T left, T right) where T : IComparable { if (typeof(T) == typeof(byte)) @@ -405,7 +405,7 @@ public static T ScalarAdd(T left, T right) where T : IComparable /// this was stolen from Vector{T} /// This is fast because typeof vs typeof is evaluation during compilation time or as soon as JIT optimizes it. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static T ScalarAddSwitch(T left, T right) where T : IComparable { //if (typeof(T) == typeof(byte)) @@ -493,7 +493,7 @@ public static T ScalarAddSwitch(T left, T right) where T : IComparable /// this was stolen from Vector{T} /// This is fast because T vs T is evaluation during compilation time or as soon as JIT optimizes it. /// - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static object ScalarAddBoxed(object left, object right) { var T = left.GetType(); @@ -524,19 +524,19 @@ public struct MathComputer where T : struct { public T Value; - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public MathComputer(T val) { Value = val; } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static T operator +(MathComputer lhs, T rhs) { return lhs + new MathComputer(rhs); } - [MethodImpl((MethodImplOptions)768)] + [MethodImpl(OptimizeAndInline)] public static T operator +(MathComputer left, MathComputer right) { if (typeof(T) == typeof(byte)) diff --git a/test/NumSharp.Benchmark/Unmanaged/UnmanagedCopy.cs b/test/NumSharp.Benchmark/Unmanaged/UnmanagedCopy.cs index a09e3292..808390b0 100644 --- a/test/NumSharp.Benchmark/Unmanaged/UnmanagedCopy.cs +++ b/test/NumSharp.Benchmark/Unmanaged/UnmanagedCopy.cs @@ -121,7 +121,7 @@ // public static extern int MemCopy(void* dest, void* src, UIntPtr count); -// [MethodImpl((MethodImplOptions)768)] +// [MethodImpl(OptimizeAndInline)] // public static UnmanagedMemoryBlock Copy3(UnmanagedMemoryBlock source) where T : unmanaged // { // var len = source.Count * sizeof(T); @@ -132,7 +132,7 @@ // return ret; // } -// [MethodImpl((MethodImplOptions)768)] +// [MethodImpl(OptimizeAndInline)] // public static UnmanagedMemoryBlock Copy2(UnmanagedMemoryBlock source) where T : unmanaged // { // var len = source.Count * sizeof(T); @@ -143,7 +143,7 @@ // return ret; // } -// [MethodImpl((MethodImplOptions)768)] +// [MethodImpl(OptimizeAndInline)] // public static UnmanagedMemoryBlock Copy1(UnmanagedMemoryBlock source) where T : unmanaged // { // var ret = new UnmanagedMemoryBlock(source.Count); @@ -153,7 +153,7 @@ // return ret; // } -// [MethodImpl((MethodImplOptions)768)] +// [MethodImpl(OptimizeAndInline)] // public static UnmanagedMemoryBlock Copy(UnmanagedMemoryBlock source) where T : unmanaged // { // var ret = new UnmanagedMemoryBlock(source.Count);