Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{ED90FF1C-59D4-4AB0-860E-2872ECA1BFEC}"
EndProject
Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ ..\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{634a3b2b-09f5-4810-b630-ade4d36c47df}*SharedItemsImports = 5
+ EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Checked|Any CPU = Checked|Any CPU
+ Checked|x64 = Checked|x64
+ Checked|x86 = Checked|x86
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
- Checked|Any CPU = Checked|Any CPU
- Checked|x64 = Checked|x64
- Checked|x86 = Checked|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|Any CPU.ActiveCfg = Checked|x64
+ {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|Any CPU.Build.0 = Checked|x64
+ {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x64.ActiveCfg = Checked|x64
+ {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x64.Build.0 = Checked|x64
+ {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x86.ActiveCfg = Checked|x86
+ {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x86.Build.0 = Checked|x86
{634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Debug|Any CPU.ActiveCfg = Debug|x64
{634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Debug|Any CPU.Build.0 = Debug|x64
{634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Debug|x64.ActiveCfg = Debug|x64
{634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Release|x64.Build.0 = Release|x64
{634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Release|x86.ActiveCfg = Release|x86
{634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Release|x86.Build.0 = Release|x86
- {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|Any CPU.ActiveCfg = Checked|x64
- {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|Any CPU.Build.0 = Checked|x64
- {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x64.ActiveCfg = Checked|x64
- {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x64.Build.0 = Checked|x64
- {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x86.ActiveCfg = Checked|x86
- {634A3B2B-09F5-4810-B630-ADE4D36C47DF}.Checked|x86.Build.0 = Checked|x86
+ {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x64.Build.0 = Debug|Any CPU
+ {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x86.Build.0 = Debug|Any CPU
{9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Debug|x64.ActiveCfg = Debug|Any CPU
{9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Release|x64.Build.0 = Release|Any CPU
{9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Release|x86.ActiveCfg = Release|Any CPU
{9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Release|x86.Build.0 = Release|Any CPU
- {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x64.ActiveCfg = Debug|Any CPU
- {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x64.Build.0 = Debug|Any CPU
- {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x86.ActiveCfg = Debug|Any CPU
- {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F}.Checked|x86.Build.0 = Debug|Any CPU
+ {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x64.Build.0 = Debug|Any CPU
+ {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x86.Build.0 = Debug|Any CPU
{5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Debug|x64.ActiveCfg = Debug|Any CPU
{5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Release|x64.Build.0 = Release|Any CPU
{5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Release|x86.ActiveCfg = Release|Any CPU
{5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Release|x86.Build.0 = Release|Any CPU
- {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x64.ActiveCfg = Debug|Any CPU
- {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x64.Build.0 = Debug|Any CPU
- {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x86.ActiveCfg = Debug|Any CPU
- {5B2027FA-F43A-4E80-880F-B3A7A2720AA7}.Checked|x86.Build.0 = Debug|Any CPU
+ {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x64.Build.0 = Debug|Any CPU
+ {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x86.Build.0 = Debug|Any CPU
{ED450846-85A0-4CED-B4D9-9EB769CF794B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED450846-85A0-4CED-B4D9-9EB769CF794B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED450846-85A0-4CED-B4D9-9EB769CF794B}.Debug|x64.ActiveCfg = Debug|Any CPU
{ED450846-85A0-4CED-B4D9-9EB769CF794B}.Release|x64.Build.0 = Release|Any CPU
{ED450846-85A0-4CED-B4D9-9EB769CF794B}.Release|x86.ActiveCfg = Release|Any CPU
{ED450846-85A0-4CED-B4D9-9EB769CF794B}.Release|x86.Build.0 = Release|Any CPU
- {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x64.ActiveCfg = Debug|Any CPU
- {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x64.Build.0 = Debug|Any CPU
- {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x86.ActiveCfg = Debug|Any CPU
- {ED450846-85A0-4CED-B4D9-9EB769CF794B}.Checked|x86.Build.0 = Debug|Any CPU
+ {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x64.Build.0 = Debug|Any CPU
+ {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x86.Build.0 = Debug|Any CPU
{B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Debug|x64.ActiveCfg = Debug|Any CPU
{B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Release|x64.Build.0 = Release|Any CPU
{B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Release|x86.ActiveCfg = Release|Any CPU
{B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Release|x86.Build.0 = Release|Any CPU
- {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x64.ActiveCfg = Debug|Any CPU
- {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x64.Build.0 = Debug|Any CPU
- {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x86.ActiveCfg = Debug|Any CPU
- {B38797B1-BB45-4B30-9D4F-79D9F4B3735B}.Checked|x86.Build.0 = Debug|Any CPU
+ {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x64.Build.0 = Debug|Any CPU
+ {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x86.Build.0 = Debug|Any CPU
{88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Debug|x64.ActiveCfg = Debug|Any CPU
{88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Release|x64.Build.0 = Release|Any CPU
{88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Release|x86.ActiveCfg = Release|Any CPU
{88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Release|x86.Build.0 = Release|Any CPU
- {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x64.ActiveCfg = Debug|Any CPU
- {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x64.Build.0 = Debug|Any CPU
- {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x86.ActiveCfg = Debug|Any CPU
- {88F4A78E-4EF9-4EB6-995E-CD24152C4704}.Checked|x86.Build.0 = Debug|Any CPU
+ {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x64.Build.0 = Debug|Any CPU
+ {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x86.Build.0 = Debug|Any CPU
{DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Debug|x64.ActiveCfg = Debug|Any CPU
{DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Release|x64.Build.0 = Release|Any CPU
{DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Release|x86.ActiveCfg = Release|Any CPU
{DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Release|x86.Build.0 = Release|Any CPU
- {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x64.ActiveCfg = Debug|Any CPU
- {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x64.Build.0 = Debug|Any CPU
- {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x86.ActiveCfg = Debug|Any CPU
- {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237}.Checked|x86.Build.0 = Debug|Any CPU
+ {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x64.Build.0 = Debug|Any CPU
+ {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x86.Build.0 = Debug|Any CPU
{7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Debug|x64.ActiveCfg = Debug|Any CPU
{7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Release|x64.Build.0 = Release|Any CPU
{7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Release|x86.ActiveCfg = Release|Any CPU
{7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Release|x86.Build.0 = Release|Any CPU
- {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x64.ActiveCfg = Debug|Any CPU
- {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x64.Build.0 = Debug|Any CPU
- {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x86.ActiveCfg = Debug|Any CPU
- {7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598}.Checked|x86.Build.0 = Debug|Any CPU
+ {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x64.Build.0 = Debug|Any CPU
+ {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x86.Build.0 = Debug|Any CPU
{C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Debug|x64.ActiveCfg = Debug|Any CPU
{C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Release|x64.Build.0 = Release|Any CPU
{C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Release|x86.ActiveCfg = Release|Any CPU
{C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Release|x86.Build.0 = Release|Any CPU
- {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x64.ActiveCfg = Debug|Any CPU
- {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x64.Build.0 = Debug|Any CPU
- {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x86.ActiveCfg = Debug|Any CPU
- {C6EDFA8A-956E-4398-B31F-FA87312BDF9B}.Checked|x86.Build.0 = Debug|Any CPU
+ {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
+ {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|Any CPU.Build.0 = Debug|Any CPU
+ {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x64.ActiveCfg = Debug|Any CPU
+ {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x64.Build.0 = Debug|Any CPU
+ {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x86.ActiveCfg = Debug|Any CPU
+ {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x86.Build.0 = Debug|Any CPU
{F99EAF58-533E-4941-A0C5-5101309D8AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F99EAF58-533E-4941-A0C5-5101309D8AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F99EAF58-533E-4941-A0C5-5101309D8AB9}.Debug|x64.ActiveCfg = Debug|Any CPU
{F99EAF58-533E-4941-A0C5-5101309D8AB9}.Release|x64.Build.0 = Release|Any CPU
{F99EAF58-533E-4941-A0C5-5101309D8AB9}.Release|x86.ActiveCfg = Release|Any CPU
{F99EAF58-533E-4941-A0C5-5101309D8AB9}.Release|x86.Build.0 = Release|Any CPU
- {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|Any CPU.ActiveCfg = Debug|Any CPU
- {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|Any CPU.Build.0 = Debug|Any CPU
- {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x64.ActiveCfg = Debug|Any CPU
- {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x64.Build.0 = Debug|Any CPU
- {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x86.ActiveCfg = Debug|Any CPU
- {F99EAF58-533E-4941-A0C5-5101309D8AB9}.Checked|x86.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{634A3B2B-09F5-4810-B630-ADE4D36C47DF} = {FC10C682-DF71-4EEA-A3A5-E716C1C88AC0}
+ {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F} = {2C4425BA-8478-4BCB-B616-E6FC28ADEAB9}
+ {5B2027FA-F43A-4E80-880F-B3A7A2720AA7} = {ED90FF1C-59D4-4AB0-860E-2872ECA1BFEC}
{ED450846-85A0-4CED-B4D9-9EB769CF794B} = {FC10C682-DF71-4EEA-A3A5-E716C1C88AC0}
+ {B38797B1-BB45-4B30-9D4F-79D9F4B3735B} = {2C4425BA-8478-4BCB-B616-E6FC28ADEAB9}
{88F4A78E-4EF9-4EB6-995E-CD24152C4704} = {FC10C682-DF71-4EEA-A3A5-E716C1C88AC0}
+ {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237} = {ED90FF1C-59D4-4AB0-860E-2872ECA1BFEC}
{7FAD5E59-D362-4ED6-B3D5-FAD9CD5A2598} = {FC10C682-DF71-4EEA-A3A5-E716C1C88AC0}
{C6EDFA8A-956E-4398-B31F-FA87312BDF9B} = {FC10C682-DF71-4EEA-A3A5-E716C1C88AC0}
{F99EAF58-533E-4941-A0C5-5101309D8AB9} = {FC10C682-DF71-4EEA-A3A5-E716C1C88AC0}
- {9EDBE037-EFE0-4B72-B602-E4C3F0C05F2F} = {2C4425BA-8478-4BCB-B616-E6FC28ADEAB9}
- {B38797B1-BB45-4B30-9D4F-79D9F4B3735B} = {2C4425BA-8478-4BCB-B616-E6FC28ADEAB9}
- {5B2027FA-F43A-4E80-880F-B3A7A2720AA7} = {ED90FF1C-59D4-4AB0-860E-2872ECA1BFEC}
- {DFC21F4E-EC4F-4310-A4DA-B7094AA4D237} = {ED90FF1C-59D4-4AB0-860E-2872ECA1BFEC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F9EDC1DC-52BE-4C40-90D2-41EE6FB7FA5C}
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
+using System.Runtime.Versioning;
using Xunit;
using Xunit.Sdk;
/// <summary>
/// Vector{T} tests that use random number generation and a unified generic test structure
/// </summary>
+ [RequiresPreviewFeatures]
public class GenericVectorTests
{
// Static constructor in top-level class\
public void StaticOneVectorSingle() { TestStaticOneVector<float>(); }
[Fact]
public void StaticOneVectorDouble() { TestStaticOneVector<double>(); }
- private void TestStaticOneVector<T>() where T : struct
+ private void TestStaticOneVector<T>() where T : struct, INumber<T>
{
Vector<T> vector = Vector<T>.One;
T oneValue = Util.One<T>();
public void StaticZeroVectorSingle() { TestStaticZeroVector<float>(); }
[Fact]
public void StaticZeroVectorDouble() { TestStaticZeroVector<double>(); }
- private void TestStaticZeroVector<T>() where T : struct
+ private void TestStaticZeroVector<T>() where T : struct, INumber<T>
{
Vector<T> vector = Vector<T>.Zero;
T zeroValue = Util.Zero<T>();
public void EqualsVectorSingle() { TestEqualsVector<float>(); }
[Fact]
public void EqualsVectorDouble() { TestEqualsVector<double>(); }
- private void TestEqualsVector<T>() where T : struct
+ private void TestEqualsVector<T>() where T : struct, INumber<T>
{
T[] values = GenerateRandomValuesForVector<T>();
Vector<T> vector1 = new Vector<T>(values);
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void AdditionDouble() { TestAddition<double>(); }
- private void TestAddition<T>() where T : struct
+ private void TestAddition<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
public void AdditionOverflowUInt64() { TestAdditionOverflow<ulong>(); }
[Fact]
public void AdditionOverflowInt64() { TestAdditionOverflow<long>(); }
- private void TestAdditionOverflow<T>() where T : struct
+ private void TestAdditionOverflow<T>() where T : struct, INumber<T>
{
T maxValue = GetMaxValueExact<T>();
Vector<T> maxValueVector = new Vector<T>(maxValue);
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void SubtractionDouble() { TestSubtraction<double>(); }
- private void TestSubtraction<T>() where T : struct
+ private void TestSubtraction<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
public void SubtractionOverflowUInt64() { TestSubtractionOverflow<ulong>(); }
[Fact]
public void SubtractionOverflowInt64() { TestSubtractionOverflow<long>(); }
- private void TestSubtractionOverflow<T>() where T : struct
+ private void TestSubtractionOverflow<T>() where T : struct, INumber<T>
{
T minValue = GetMinValueExact<T>();
Vector<T> minValueVector = new Vector<T>(minValue);
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void MultiplicationDouble() { TestMultiplication<double>(); }
- private void TestMultiplication<T>() where T : struct
+ private void TestMultiplication<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void MultiplicationWithScalarDouble() { TestMultiplicationWithScalar<double>(); }
- private void TestMultiplicationWithScalar<T>() where T : struct
+ private void TestMultiplicationWithScalar<T>() where T : struct, INumber<T>
{
T[] values = GenerateRandomValuesForVector<T>();
T factor = Util.GenerateSingleValue<T>(GetMinValue<T>(), GetMaxValue<T>());
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void DivisionDouble() { TestDivision<double>(); }
- private void TestDivision<T>() where T : struct
+ private void TestDivision<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
values1 = values1.Select(val => val.Equals(Util.Zero<T>()) ? Util.One<T>() : val).ToArray(); // Avoid divide-by-zero
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void UnaryMinusDouble() { TestUnaryMinus<double>(); }
- private void TestUnaryMinus<T>() where T : struct
+ private void TestUnaryMinus<T>() where T : struct, INumber<T>
{
T[] values = GenerateRandomValuesForVector<T>();
Vector<T> vector = new Vector<T>(values);
public void BitwiseXorOperatorUInt64() { TestBitwiseXorOperator<ulong>(); }
[Fact]
public void BitwiseXorOperatorInt64() { TestBitwiseXorOperator<long>(); }
- private void TestBitwiseXorOperator<T>() where T : struct
+ private void TestBitwiseXorOperator<T>() where T : struct, IBitwiseOperators<T,T,T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
public void BitwiseOnesComplementOperatorUInt64() { TestBitwiseOnesComplementOperator<ulong>(); }
[Fact]
public void BitwiseOnesComplementOperatorInt64() { TestBitwiseOnesComplementOperator<long>(); }
- private void TestBitwiseOnesComplementOperator<T>() where T : struct
+ private void TestBitwiseOnesComplementOperator<T>() where T : struct, IBitwiseOperators<T,T,T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
Vector<T> randomVector1 = new Vector<T>(values1);
public void BitwiseAndNotUInt64() { TestBitwiseAndNot<ulong>(); }
[Fact]
public void BitwiseAndNotInt64() { TestBitwiseAndNot<long>(); }
- private void TestBitwiseAndNot<T>() where T : struct
+ private void TestBitwiseAndNot<T>() where T : struct, IBitwiseOperators<T,T,T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void VectorGreaterThanDouble() { TestVectorGreaterThan<double>(); }
- private void TestVectorGreaterThan<T>() where T : struct
+ private void TestVectorGreaterThan<T>() where T : struct, INumber<T>
{
var values1 = GenerateRandomValuesForVector<T>();
var values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void GreaterThanOrEqualDouble() { TestVectorGreaterThanOrEqual<double>(); }
- private void TestVectorGreaterThanOrEqual<T>() where T : struct
+ private void TestVectorGreaterThanOrEqual<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void LessThanDouble() { TestVectorLessThan<double>(); }
- private void TestVectorLessThan<T>() where T : struct
+ private void TestVectorLessThan<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void LessThanOrEqualDouble() { TestVectorLessThanOrEqual<double>(); }
- private void TestVectorLessThanOrEqual<T>() where T : struct
+ private void TestVectorLessThanOrEqual<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void LessThanAnyDouble() { TestVectorLessThanAny<double>(); }
- private void TestVectorLessThanAny<T>() where T : struct
+ private void TestVectorLessThanAny<T>() where T : struct, INumber<T>
{
T[] values1 = new T[Vector<T>.Count];
for (int g = 0; g < Vector<T>.Count; g++)
public void LessThanAllSingle() { TestVectorLessThanAll<float>(); }
[Fact]
public void LessThanAllDouble() { TestVectorLessThanAll<double>(); }
- private void TestVectorLessThanAll<T>() where T : struct
+ private void TestVectorLessThanAll<T>() where T : struct, INumber<T>
{
T[] values1 = new T[Vector<T>.Count];
for (int g = 0; g < Vector<T>.Count; g++)
public void VectorEqualsSingle() { TestVectorEquals<float>(); }
[Fact]
public void VectorEqualsDouble() { TestVectorEquals<double>(); }
- private void TestVectorEquals<T>() where T : struct
+ private void TestVectorEquals<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2;
public void VectorEqualsAnySingle() { TestVectorEqualsAny<float>(); }
[Fact]
public void VectorEqualsAnyDouble() { TestVectorEqualsAny<double>(); }
- private void TestVectorEqualsAny<T>() where T : struct
+ private void TestVectorEqualsAny<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2;
public void VectorEqualsAllSingle() { TestVectorEqualsAll<float>(); }
[Fact]
public void VectorEqualsAllDouble() { TestVectorEqualsAll<double>(); }
- private void TestVectorEqualsAll<T>() where T : struct
+ private void TestVectorEqualsAll<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2;
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void ConditionalSelectDouble() { TestConditionalSelect<double>(); }
- private void TestConditionalSelect<T>() where T : struct
+ private void TestConditionalSelect<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void DotProductDouble() { TestDotProduct<double>(); }
- private void TestDotProduct<T>() where T : struct
+ private void TestDotProduct<T>() where T : struct, INumber<T>
{
T[] values1 = Util.GenerateRandomValues<T>(Vector<T>.Count);
T[] values2 = Util.GenerateRandomValues<T>(Vector<T>.Count);
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void MaxDouble() { TestMax<double>(); }
- private void TestMax<T>() where T : struct
+ private void TestMax<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void MinDouble() { TestMin<double>(); }
- private void TestMin<T>() where T : struct
+ private void TestMin<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void SquareRootDouble() { TestSquareRoot<double>(15); }
- private void TestSquareRoot<T>(int precision = -1) where T : struct, IEquatable<T>
+ private void TestSquareRoot<T>(int precision = -1) where T : struct, INumber<T>, IEquatable<T>
{
T[] values = GenerateRandomValuesForVector<T>();
Vector<T> vector = new Vector<T>(values);
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void AbsDouble() { TestAbs<double>(); }
- private void TestAbs<T>() where T : struct
+ private void TestAbs<T>() where T : struct, INumber<T>
{
T[] values = Util.GenerateRandomValues<T>(Vector<T>.Count, GetMinValue<T>() + 1, GetMaxValue<T>());
Vector<T> vector = new Vector<T>(values);
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void MultiplicationReflectionDouble() { TestMultiplicationReflection<double>(); }
- private void TestMultiplicationReflection<T>() where T : struct
+ private void TestMultiplicationReflection<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void AdditionReflectionDouble() { TestAdditionReflection<double>(); }
- private void TestAdditionReflection<T>() where T : struct
+ private void TestAdditionReflection<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
T[] values2 = GenerateRandomValuesForVector<T>();
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60347", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsX86Process))]
public void DivisionReflectionDouble() { TestDivisionReflection<double>(); }
- private void TestDivisionReflection<T>() where T : struct
+ private void TestDivisionReflection<T>() where T : struct, INumber<T>
{
T[] values1 = GenerateRandomValuesForVector<T>();
values1 = values1.Select(val => val.Equals(Util.Zero<T>()) ? Util.One<T>() : val).ToArray(); // Avoid divide-by-zero
<Compile Include="PlaneTests.cs" />
<Compile Include="QuaternionTests.cs" />
</ItemGroup>
+ <ItemGroup>
+ <!-- it's a reference assembly, but the project system doesn't know that - include it during compilation, but don't publish it -->
+ <ProjectReference Include="$(LibrariesProjectRoot)System.Runtime.Experimental\ref\System.Runtime.Experimental.csproj" IncludeAssets="compile" Private="false" />
+ </ItemGroup>
</Project>
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Runtime.Versioning;
+
namespace System.Numerics.Tests
{
public static class Util
return value;
}
- public static T Abs<T>(T value) where T : struct
+ [RequiresPreviewFeatures]
+ public static T Abs<T>(T value) where T : INumber<T>
{
- // unsigned types
- if (value is byte) return value;
- else if (value is ushort) return value;
- else if (value is uint) return value;
- else if (value is ulong) return value;
- // signed types
- else if (value is short) return (T)(ValueType)(short) ( Math.Abs((short) (ValueType)value) );
- else if (value is int) return (T)(ValueType)(int) ( Math.Abs((int) (ValueType)value) );
- else if (value is long) return (T)(ValueType)(long) ( Math.Abs((long) (ValueType)value) );
- else if (value is sbyte) return (T)(ValueType)(sbyte) ( Math.Abs((sbyte) (ValueType)value) );
- else if (value is float) return (T)(ValueType)(float) ( Math.Abs((float) (ValueType)value) );
- else if (value is double) return (T)(ValueType)(double) ( Math.Abs((double)(ValueType)value) );
- else throw new NotImplementedException();
+ return T.Abs(value);
}
-
- public static T Sqrt<T>(T value) where T : struct
+ [RequiresPreviewFeatures]
+ public static T Sqrt<T>(T value) where T : struct, INumber<T>
{
- unchecked
- {
- if (value is short) return (T)(ValueType)(short) ( Math.Sqrt((short) (ValueType)value) );
- else if (value is int) return (T)(ValueType)(int) ( Math.Sqrt((int) (ValueType)value) );
- else if (value is long) return (T)(ValueType)(long) ( Math.Sqrt((long) (ValueType)value) );
- else if (value is ushort) return (T)(ValueType)(ushort) ( Math.Sqrt((ushort)(ValueType)value) );
- else if (value is uint) return (T)(ValueType)(uint) ( Math.Sqrt((uint) (ValueType)value) );
- else if (value is ulong) return (T)(ValueType)(ulong) ( Math.Sqrt((ulong) (ValueType)value) );
- else if (value is byte) return (T)(ValueType)(byte) ( Math.Sqrt((byte) (ValueType)value) );
- else if (value is sbyte) return (T)(ValueType)(sbyte) ( Math.Sqrt((sbyte) (ValueType)value) );
- else if (value is float) return (T)(ValueType)(float) ( Math.Sqrt((float) (ValueType)value) );
- else if (value is double) return (T)(ValueType)(double) ( Math.Sqrt((double)(ValueType)value) );
- else throw new NotImplementedException();
- }
+ double dValue = Create<T, double>(value);
+ double dSqrt = Math.Sqrt(dValue);
+ return T.CreateTruncating<double>(dSqrt);
}
- public static T Multiply<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ private static TSelf Create<TOther, TSelf>(TOther value)
+ where TOther : INumber<TOther>
+ where TSelf : INumber<TSelf>
+ => TSelf.Create<TOther>(value);
+
+ [RequiresPreviewFeatures]
+ public static T Multiply<T>(T left, T right) where T : INumber<T>
{
- unchecked
- {
- if (left is short) return (T)(ValueType)(short) ( (short) (ValueType)left * (short) (ValueType)right );
- else if (left is int) return (T)(ValueType)(int) ( (int) (ValueType)left * (int) (ValueType)right );
- else if (left is long) return (T)(ValueType)(long) ( (long) (ValueType)left * (long) (ValueType)right );
- else if (left is ushort) return (T)(ValueType)(ushort) ( (ushort)(ValueType)left * (ushort)(ValueType)right );
- else if (left is uint) return (T)(ValueType)(uint) ( (uint) (ValueType)left * (uint) (ValueType)right );
- else if (left is ulong) return (T)(ValueType)(ulong) ( (ulong) (ValueType)left * (ulong) (ValueType)right );
- else if (left is byte) return (T)(ValueType)(byte) ( (byte) (ValueType)left * (byte) (ValueType)right );
- else if (left is sbyte) return (T)(ValueType)(sbyte) ( (sbyte) (ValueType)left * (sbyte) (ValueType)right );
- else if (left is float) return (T)(ValueType)(float) ( (float) (ValueType)left * (float) (ValueType)right );
- else if (left is double) return (T)(ValueType)(double) ( (double)(ValueType)left * (double)(ValueType)right );
- else throw new NotImplementedException();
- }
+ return left * right;
}
- public static T Divide<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static T Divide<T>(T left, T right) where T : INumber<T>
{
- if (left is short) return (T)(ValueType)(short) ( (short) (ValueType)left / (short) (ValueType)right );
- else if (left is int) return (T)(ValueType)(int) ( (int) (ValueType)left / (int) (ValueType)right );
- else if (left is long) return (T)(ValueType)(long) ( (long) (ValueType)left / (long) (ValueType)right );
- else if (left is ushort) return (T)(ValueType)(ushort) ( (ushort)(ValueType)left / (ushort)(ValueType)right );
- else if (left is uint) return (T)(ValueType)(uint) ( (uint) (ValueType)left / (uint) (ValueType)right );
- else if (left is ulong) return (T)(ValueType)(ulong) ( (ulong) (ValueType)left / (ulong) (ValueType)right );
- else if (left is byte) return (T)(ValueType)(byte) ( (byte) (ValueType)left / (byte) (ValueType)right );
- else if (left is sbyte) return (T)(ValueType)(sbyte) ( (sbyte) (ValueType)left / (sbyte) (ValueType)right );
- else if (left is float) return (T)(ValueType)(float) ( (float) (ValueType)left / (float) (ValueType)right );
- else if (left is double) return (T)(ValueType)(double) ( (double)(ValueType)left / (double)(ValueType)right );
- else throw new NotImplementedException();
+ return left / right;
}
- public static T Add<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static T Add<T>(T left, T right) where T : INumber<T>
{
- unchecked
- {
- if (left is short) return (T)(ValueType)(short) ( (short) (ValueType)left + (short) (ValueType)right );
- else if (left is int) return (T)(ValueType)(int) ( (int) (ValueType)left + (int) (ValueType)right );
- else if (left is long) return (T)(ValueType)(long) ( (long) (ValueType)left + (long) (ValueType)right );
- else if (left is ushort) return (T)(ValueType)(ushort) ( (ushort)(ValueType)left + (ushort)(ValueType)right );
- else if (left is uint) return (T)(ValueType)(uint) ( (uint) (ValueType)left + (uint) (ValueType)right );
- else if (left is ulong) return (T)(ValueType)(ulong) ( (ulong) (ValueType)left + (ulong) (ValueType)right );
- else if (left is byte) return (T)(ValueType)(byte) ( (byte) (ValueType)left + (byte) (ValueType)right );
- else if (left is sbyte) return (T)(ValueType)(sbyte) ( (sbyte) (ValueType)left + (sbyte) (ValueType)right );
- else if (left is float) return (T)(ValueType)(float) ( (float) (ValueType)left + (float) (ValueType)right );
- else if (left is double) return (T)(ValueType)(double) ( (double)(ValueType)left + (double)(ValueType)right );
- else throw new NotImplementedException();
- }
+ return left + right;
}
- public static T Subtract<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static T Subtract<T>(T left, T right) where T : INumber<T>
{
- unchecked
- {
- if (left is short) return (T)(ValueType)(short) ( (short) (ValueType)left - (short) (ValueType)right );
- else if (left is int) return (T)(ValueType)(int) ( (int) (ValueType)left - (int) (ValueType)right );
- else if (left is long) return (T)(ValueType)(long) ( (long) (ValueType)left - (long) (ValueType)right );
- else if (left is ushort) return (T)(ValueType)(ushort) ( (ushort)(ValueType)left - (ushort)(ValueType)right );
- else if (left is uint) return (T)(ValueType)(uint) ( (uint) (ValueType)left - (uint) (ValueType)right );
- else if (left is ulong) return (T)(ValueType)(ulong) ( (ulong) (ValueType)left - (ulong) (ValueType)right );
- else if (left is byte) return (T)(ValueType)(byte) ( (byte) (ValueType)left - (byte) (ValueType)right );
- else if (left is sbyte) return (T)(ValueType)(sbyte) ( (sbyte) (ValueType)left - (sbyte) (ValueType)right );
- else if (left is float) return (T)(ValueType)(float) ( (float) (ValueType)left - (float) (ValueType)right );
- else if (left is double) return (T)(ValueType)(double) ( (double)(ValueType)left - (double)(ValueType)right );
- else throw new NotImplementedException();
- }
+ return left - right;
}
- public static T Xor<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static T Xor<T>(T left, T right) where T : IBitwiseOperators<T, T, T>
{
- if (left is short) return (T)(ValueType)(short) ( (short) (ValueType)left ^ (short) (ValueType)right );
- else if (left is int) return (T)(ValueType)(int) ( (int) (ValueType)left ^ (int) (ValueType)right );
- else if (left is long) return (T)(ValueType)(long) ( (long) (ValueType)left ^ (long) (ValueType)right );
- else if (left is ushort) return (T)(ValueType)(ushort) ( (ushort)(ValueType)left ^ (ushort)(ValueType)right );
- else if (left is uint) return (T)(ValueType)(uint) ( (uint) (ValueType)left ^ (uint) (ValueType)right );
- else if (left is ulong) return (T)(ValueType)(ulong) ( (ulong) (ValueType)left ^ (ulong) (ValueType)right );
- else if (left is byte) return (T)(ValueType)(byte) ( (byte) (ValueType)left ^ (byte) (ValueType)right );
- else if (left is sbyte) return (T)(ValueType)(sbyte) ( (sbyte) (ValueType)left ^ (sbyte) (ValueType)right );
- else throw new NotImplementedException();
+ return left ^ right;
}
- public static T AndNot<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static T AndNot<T>(T left, T right) where T : IBitwiseOperators<T, T, T>
{
- if (left is short) return (T)(ValueType)(short) ( (short) (ValueType)left & ~(short) (ValueType)right );
- else if (left is int) return (T)(ValueType)(int) ( (int) (ValueType)left & ~(int) (ValueType)right );
- else if (left is long) return (T)(ValueType)(long) ( (long) (ValueType)left & ~(long) (ValueType)right );
- else if (left is ushort) return (T)(ValueType)(ushort) ( (ushort)(ValueType)left & ~(ushort)(ValueType)right );
- else if (left is uint) return (T)(ValueType)(uint) ( (uint) (ValueType)left & ~(uint) (ValueType)right );
- else if (left is ulong) return (T)(ValueType)(ulong) ( (ulong) (ValueType)left & ~(ulong) (ValueType)right );
- else if (left is byte) return (T)(ValueType)(byte) ( (byte) (ValueType)left & ~(byte) (ValueType)right );
- else if (left is sbyte) return (T)(ValueType)(sbyte) ( (sbyte) (ValueType)left & ~(sbyte) (ValueType)right );
- else throw new NotImplementedException();
+ return left & ~ right;
}
- public static T OnesComplement<T>(T left) where T : struct
+ [RequiresPreviewFeatures]
+ public static T OnesComplement<T>(T left) where T : IBitwiseOperators<T, T, T>
{
- unchecked
- {
- if (left is short) return (T)(ValueType)(short) ( ~(short) (ValueType)left );
- else if (left is int) return (T)(ValueType)(int) ( ~(int) (ValueType)left );
- else if (left is long) return (T)(ValueType)(long) ( ~(long) (ValueType)left );
- else if (left is ushort) return (T)(ValueType)(ushort) ( ~(ushort)(ValueType)left );
- else if (left is uint) return (T)(ValueType)(uint) ( ~(uint) (ValueType)left );
- else if (left is ulong) return (T)(ValueType)(ulong) ( ~(ulong) (ValueType)left );
- else if (left is byte) return (T)(ValueType)(byte) ( ~(byte) (ValueType)left );
- else if (left is sbyte) return (T)(ValueType)(sbyte) ( ~(sbyte) (ValueType)left );
- else throw new NotImplementedException();
- }
+ return ~left;
}
public static float Clamp(float value, float min, float max)
return value > max ? max : value < min ? min : value;
}
- public static T Zero<T>() where T : struct
+ [RequiresPreviewFeatures]
+ public static T Zero<T>() where T : struct, INumber<T>
{
- if (typeof(T) == typeof(short)) return (T)(ValueType)(short) 0;
- else if (typeof(T) == typeof(int)) return (T)(ValueType)(int) 0;
- else if (typeof(T) == typeof(long)) return (T)(ValueType)(long) 0;
- else if (typeof(T) == typeof(ushort)) return (T)(ValueType)(ushort) 0;
- else if (typeof(T) == typeof(uint)) return (T)(ValueType)(uint) 0;
- else if (typeof(T) == typeof(ulong)) return (T)(ValueType)(ulong) 0;
- else if (typeof(T) == typeof(byte)) return (T)(ValueType)(byte) 0;
- else if (typeof(T) == typeof(sbyte)) return (T)(ValueType)(sbyte) 0;
- else if (typeof(T) == typeof(float)) return (T)(ValueType)(float) 0;
- else if (typeof(T) == typeof(double)) return (T)(ValueType)(double) 0;
- else throw new NotImplementedException();
+ return T.Zero;
}
- public static T One<T>() where T : struct
+ [RequiresPreviewFeatures]
+ public static T One<T>() where T : struct, INumber<T>
{
- if (typeof(T) == typeof(short)) return (T)(ValueType)(short) 1;
- else if (typeof(T) == typeof(int)) return (T)(ValueType)(int) 1;
- else if (typeof(T) == typeof(long)) return (T)(ValueType)(long) 1;
- else if (typeof(T) == typeof(ushort)) return (T)(ValueType)(ushort) 1;
- else if (typeof(T) == typeof(uint)) return (T)(ValueType)(uint) 1;
- else if (typeof(T) == typeof(ulong)) return (T)(ValueType)(ulong) 1;
- else if (typeof(T) == typeof(byte)) return (T)(ValueType)(byte) 1;
- else if (typeof(T) == typeof(sbyte)) return (T)(ValueType)(sbyte) 1;
- else if (typeof(T) == typeof(float)) return (T)(ValueType)(float) 1;
- else if (typeof(T) == typeof(double)) return (T)(ValueType)(double) 1;
- else throw new NotImplementedException();
+ return T.One;
}
- public static bool GreaterThan<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static bool GreaterThan<T>(T left, T right) where T : INumber<T>
{
- if (left is short) return (short)(ValueType) left > (short)(ValueType) right;
- else if (left is int) return (int)(ValueType) left > (int)(ValueType) right;
- else if (left is long) return (long)(ValueType) left > (long)(ValueType) right;
- else if (left is ushort) return (ushort)(ValueType) left > (ushort)(ValueType) right;
- else if (left is uint) return (uint)(ValueType) left > (uint)(ValueType) right;
- else if (left is ulong) return (ulong)(ValueType) left > (ulong)(ValueType) right;
- else if (left is byte) return (byte)(ValueType) left > (byte)(ValueType) right;
- else if (left is sbyte) return (sbyte)(ValueType) left > (sbyte)(ValueType) right;
- else if (left is float) return (float)(ValueType) left > (float)(ValueType) right;
- else if (left is double) return (double)(ValueType) left > (double)(ValueType) right;
- else throw new NotImplementedException();
+ return left > right;
}
- public static bool GreaterThanOrEqual<T>(T left, T right) where T : struct
- {
- if (left is short) return (short)(ValueType) left >= (short)(ValueType) right;
- else if (left is int) return (int)(ValueType) left >= (int)(ValueType) right;
- else if (left is long) return (long)(ValueType) left >= (long)(ValueType) right;
- else if (left is ushort) return (ushort)(ValueType) left >= (ushort)(ValueType) right;
- else if (left is uint) return (uint)(ValueType) left >= (uint)(ValueType) right;
- else if (left is ulong) return (ulong)(ValueType) left >= (ulong)(ValueType) right;
- else if (left is byte) return (byte)(ValueType) left >= (byte)(ValueType) right;
- else if (left is sbyte) return (sbyte)(ValueType) left >= (sbyte)(ValueType) right;
- else if (left is float) return (float)(ValueType) left >= (float)(ValueType) right;
- else if (left is double) return (double)(ValueType) left >= (double)(ValueType) right;
- else throw new NotImplementedException();
+ [RequiresPreviewFeatures]
+ public static bool GreaterThanOrEqual<T>(T left, T right) where T : INumber<T>
+ {
+ return left >= right;
}
- public static bool LessThan<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static bool LessThan<T>(T left, T right) where T : INumber<T>
{
- if (left is short) return (short)(ValueType) left < (short)(ValueType) right;
- else if (left is int) return (int)(ValueType) left < (int)(ValueType) right;
- else if (left is long) return (long)(ValueType) left < (long)(ValueType) right;
- else if (left is ushort) return (ushort)(ValueType) left < (ushort)(ValueType) right;
- else if (left is uint) return (uint)(ValueType) left < (uint)(ValueType) right;
- else if (left is ulong) return (ulong)(ValueType) left < (ulong)(ValueType) right;
- else if (left is byte) return (byte)(ValueType) left < (byte)(ValueType) right;
- else if (left is sbyte) return (sbyte)(ValueType) left < (sbyte)(ValueType) right;
- else if (left is float) return (float)(ValueType) left < (float)(ValueType) right;
- else if (left is double) return (double)(ValueType) left < (double)(ValueType) right;
- else throw new NotImplementedException();
+ return left < right;
}
- public static bool LessThanOrEqual<T>(T left, T right) where T : struct
+ [RequiresPreviewFeatures]
+ public static bool LessThanOrEqual<T>(T left, T right) where T : INumber<T>
{
- if (left is short) return (short)(ValueType) left <= (short)(ValueType) right;
- else if (left is int) return (int)(ValueType) left <= (int)(ValueType) right;
- else if (left is long) return (long)(ValueType) left <= (long)(ValueType) right;
- else if (left is ushort) return (ushort)(ValueType) left <= (ushort)(ValueType) right;
- else if (left is uint) return (uint)(ValueType) left <= (uint)(ValueType) right;
- else if (left is ulong) return (ulong)(ValueType) left <= (ulong)(ValueType) right;
- else if (left is byte) return (byte)(ValueType) left <= (byte)(ValueType) right;
- else if (left is sbyte) return (sbyte)(ValueType) left <= (sbyte)(ValueType) right;
- else if (left is float) return (float)(ValueType) left <= (float)(ValueType) right;
- else if (left is double) return (double)(ValueType) left <= (double)(ValueType) right;
- else throw new NotImplementedException();
+ return left <= right;
}
- public static bool AnyEqual<T>(T[] left, T[] right) where T : struct
+ [RequiresPreviewFeatures]
+ public static bool AnyEqual<T>(T[] left, T[] right) where T : INumber<T>
{
for (int g = 0; g < left.Length; g++)
{
- if (((IEquatable<T>)left[g]).Equals(right[g]))
+ if(left[g] == right[g])
{
return true;
}
return false;
}
- public static bool AllEqual<T>(T[] left, T[] right) where T : struct
+ [RequiresPreviewFeatures]
+ public static bool AllEqual<T>(T[] left, T[] right) where T : INumber<T>
{
for (int g = 0; g < left.Length; g++)
{
- if (!((IEquatable<T>)left[g]).Equals(right[g]))
+ if (left[g] != right[g])
{
return false;
}